Commit Graph

858 Commits

Author SHA1 Message Date
qctecmdr
6bd6a4e1b8 Merge "driver: waipio: set static priority configuration to firmware" 2021-05-25 21:01:15 -07:00
Vikash Garodia
252625c6d0 driver: waipio: set static priority configuration to firmware
Existing video driver expects session priority to be set
explicitly during static configuration. CAP_ROOT is not
enabled for decoders, hence explicit setting is needed.

Change-Id: Id754b38f15e9e045d31797557a4a7aa7a296346e
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2021-05-25 16:59:26 +05:30
Darshana Patil
e5ec6843e8 video: driver: modify max mapped output count
adjust MAX_MAP_OUTPUT_COUNT based on resolution
to enhance performance and reduce memory pressure.
- For 8K session: count = 20
- For 4K session: count = 32
- For 1080p session: count = 48
- For all remaining sessions: count = 64

reduce MAX_DPB_COUNT to 32.
reduce DEFAULT_MAX_HOST_BUF_COUNT to 64.

Change-Id: I0e6d25121947524b843e9cce96b75871aba174af
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-05-24 16:58:19 -07:00
Mihir Ganu
702fe54c21 video: driver: Always raise interrupt request
Skip optimizations in read/write queues and always
raise interrupt request.

Change-Id: I36457e92f0a54b73af6d20748c9bb50bccdd6610
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2021-05-24 14:21:38 -07:00
Maheshwar Ajja
4e4e404c32 video: driver: avoid integer overflow issue
Use u32 instead of int to avoid interger overflow.

Change-Id: I4e2971a11074539d49d612a9ef1bda0502970afa
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2021-05-21 19:04:33 -07:00
qctecmdr
70eb3b1a5d Merge "video: driver: reject odd resolution for encode sessions" 2021-05-21 14:19:15 -07:00
qctecmdr
173b9f8b09 Merge "driver: waipio: allow higher fps rate" 2021-05-21 14:19:15 -07:00
Darshana Patil
d538a9ff99 video: driver: optimise release buffer function
Do not unmap buffers when firmware sends release
done. Only delete these buffers from release list.
Unmap buffers when removing stale entries from
mappings list.
update max dpb count to 32 and host buf count to 128.

Change-Id: I71fc3f722f068d8f2eeeb81041d4e495092c254f
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-05-21 17:44:17 +05:30
qctecmdr
502487ee71 Merge "video: driver: printk fault from __load_fw_to_memory" 2021-05-21 02:55:23 -07:00
Vikash Garodia
edce8f49c9 driver: waipio: allow higher fps rate
Driver would allow clients to set any value for rate during
static state. In dynamic state, if the rate value is such
that it crosses the maximum supported load, the setting
is rejeceted. Again the rejection is only for realtime session.

Change-Id: Iaeb786243fe4ca61f9e6f671a24a09dc98eaabfa
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2021-05-21 15:07:46 +05:30
qctecmdr
3353bfaa62 Merge "video: driver: update removable buffer condition" 2021-05-21 01:15:17 -07:00
qctecmdr
db3c2f79da Merge "video: driver: Update MBPF session admission check" 2021-05-20 23:17:47 -07:00
qctecmdr
a4038a8565 Merge "video: driver: fix core lock acquire and release sequence" 2021-05-20 18:12:48 -07:00
Darshana Patil
2fa47b832d video: driver: printk fault from __load_fw_to_memory
fix printk fault from __load_fw_to_memory.

Change-Id: I50a8594f99b478cb5e9d6859c2212afd238cf1e8
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-05-20 17:49:42 -07:00
Darshana Patil
c897e250bd video: driver: reject odd resolution for encode sessions
reject odd resolution for encode session only.

Change-Id: I197688edb9e7f40d8b43524f7423ba52bb738cc2
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-05-20 17:46:34 -07:00
Darshana Patil
ec5c6643a3 video: driver: update removable buffer condition
added condition that a buffer should not be present
in release list while removing excessive mappings.

Change-Id: Ib74396ab20720399f4a077fbbc23b97f11f439d7
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-05-20 11:05:56 -07:00
Mihir Ganu
4eda00e068 video: driver: Update MBPF session admission check
Update session admission check to enforce max MBPF limit
by considering both realtime and non-realtime sessions.

Change-Id: I2556a6d7e4220f3151406febef3f0ebde9b4a20b
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2021-05-20 10:51:34 -07:00
Govindaraj Rajagopal
7f084e9a18 video: driver: add additional profile support for image session
Added main & main10 profile support for HEIC image session.

Change-Id: I738c6e55c361bdccac7c4d1165abcf9363d80eb7
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-05-20 16:27:15 +05:30
Govindaraj Rajagopal
53578c8ec2 video: driver: fix core lock acquire and release sequence
[1] Added return type to strict_check() api and bail out if
    strict_check fails.
[2] Fix all the failures with #1.
[3] Added WARN_ON() for strict_check failure.
[4] Ensured &core->lock is acquired before calling below api's.
    - __write_register
    - __write_register_masked
    - __iface_cmdq_write_relaxed
    - __suspend
    - __resume
    - venus_hfi_core_init
    - venus_hfi_core_deinit.

Change-Id: I7f0a3ca6c2aec2758220c90bff9260367f10820b
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-05-20 14:34:11 +05:30
Akshata Sahukar
945883602d video: driver: add support to set csc coefficients
Add support to honor client enablement of csc custom
matrix and set csc coeff to video firmware.

Change-Id: I14d702eb7033541aa439bebe11df7fc4aa49ffdb
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-05-19 17:17:01 -07:00
Darshana Patil
6a6a3cba5c video: driver: update alignment for p010
update alignment to 128 for stride in  pixel
calculation for p010 color format.

Change-Id: I0fda66f06409bb9947c88a60a88a9ea8f70505a5
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-05-18 12:41:51 -07:00
qctecmdr
c3bed56c94 Merge "video: driver: modify bytesused if DPB tag list enabled" 2021-05-17 21:49:01 -07:00
qctecmdr
0287f0d1f4 Merge "video: driver: modify unmap excess mappings" 2021-05-17 21:49:01 -07:00
Darshana Patil
cad8267eca video: driver: modify bytesused if DPB tag list enabled
vb2 is not allowing client to pass data in output meta plane.
adjust the bytesused as client will send buffer tag metadata
in output meta plane if DPB_TAG_LIST metadata enabled.

Change-Id: I2d99d0acf559c4b92e0610d518f6cfbdd54a2c19
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-05-17 18:43:37 -07:00
Darshana Patil
da09aa48ed video: driver: modify unmap excess mappings
Unmap only those entries with refcount 1 and
which are not present in read_only buffers
list.

Change-Id: I0bc918c3f5c1fe1a1ed62a0c16b578155a8e6d6e
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-05-17 17:15:29 -07:00
Govindaraj Rajagopal
d9518d9182 video: driver: fix list usage without init
If workqueue creation fails, driver is accessing buffer lists
in session close sequence, which is not yet inited and leading
to NULL ptr dereferrence issue, while traversing uninitialized
list. So added change to avoid accessing list without init
completion.

Change-Id: Icb3aa6b7edaf27e73873ec289d6a921a2613e77e
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-05-17 21:51:03 +05:30
qctecmdr
288887b59d Merge "video: driver: hb layer buf count and hfi buffer macro CL:30683524 changes" 2021-05-15 14:39:13 -07:00
qctecmdr
279c643900 Merge "msm: vidc: Add support of timestamps based frame rate" 2021-05-15 14:09:18 -07:00
qctecmdr
76b516e7e6 Merge "video: driver: Add index check in enum format" 2021-05-14 21:48:57 -07:00
Akshata Sahukar
724e5f525e video: driver: hb layer buf count and hfi buffer macro CL:30683524 changes
[1] Update enc input min count buffers count when HB layer encoding
    is enabled.
[2] Also align hfi buffer macro file with CL: 30683524.
[3] This change also fixes VPSS buffer size mismatch issue.

Change-Id: I63d91ff204f1e11e71e3c0633b582c47c5e9b102
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-05-14 21:40:28 -07:00
qctecmdr
cdda26a16e Merge "video: driver: define hfi setter for configuring pipe" 2021-05-14 16:18:08 -07:00
Mihir Ganu
3f52f1e392 video: driver: Add index check in enum format
Add index check in enum fmt call and add the missing
break statement in handle_session_property.

Change-Id: Ida294f9ad4b8fa5c86d73b0e5bbd5297d8dbcd1b
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2021-05-14 14:46:12 -07:00
Darshana Patil
e7c7a2fb02 video-driver: add decode QP metadata support
add v4l2 extension and necassary support for
decoder QP metadata.

Change-Id: I364ef9b7b3a63bef0a59c955018bc8456f12d03f
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-05-14 13:43:16 -07:00
Vikash Garodia
90d7de5658 video: driver: define hfi setter for configuring pipe
Deprecate custom pipe setting and use the hfi setter
to configure it alongwith other configurations.

Change-Id: Iffbd25df89f43cf77c1fa85ffa97601a31998410
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2021-05-14 23:48:15 +05:30
Vikash Garodia
75ecec1bb5 video: driver: Add support dynamic low latency for decoder
Latency property is set to firmware during streamon output port,
if set as part of initial configuration by client.
During runtime, the property is set as and when configured by
client.

1. Make the latency property dynamic for decoder.
2. For encoder, the same gets set to firmware with regular
   v4l2 set properties.
3. For decoder, set the property explicitly during streamon
   output port.

Change-Id: I35990614b95e57f113ddacfc2272cad6ae0dde82
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2021-05-14 23:47:30 +05:30
Govindaraj Rajagopal
003d8a79fa msm: vidc: Add support of timestamps based frame rate
Add timestamp based frame rate detection.

Change-Id: Id0c522e01769ea6cf214c7b84c11faae6049e2ef
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-05-12 21:50:05 +05:30
qctecmdr
992a58254f Merge "video: driver: update proper state in vb2_buffer_done" 2021-05-11 20:49:09 -07:00
qctecmdr
6f7a39d1d4 Merge "video: driver: report system error when packet validation fails" 2021-05-11 18:24:02 -07:00
Akshata Sahukar
967d049715 video: driver: Support max 1 enh HB layer when cvp is disabled
Allow max 1 enh layers when cvp metadata is disabled for HB
layer type.

Change-Id: If6e33462e8be36a4ca1fb1f253875678b697c05a
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-05-11 16:47:14 -07:00
Akshata Sahukar
4a81629d7c video: driver: report system error when packet validation fails
Report system error when packet validation fails to avoid
unpredictable failures.

Change-Id: I196c21aba1d19846fe766585e4955b3aca3fd59e
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-05-11 13:12:26 -07:00
qctecmdr
849dab200f Merge "video: driver: handle race condition in msm_vidc_core_init" 2021-05-11 00:44:17 -07:00
qctecmdr
4837c16676 Merge "video: driver: add frame_skip mode control setting for heic" 2021-05-10 18:11:09 -07:00
Govindaraj Rajagopal
9a7e929dfe video: driver: handle race condition in msm_vidc_core_init
Core is moved to init state before completing full init sequence.
So subsequent new open request assumes core is already inited and
attempts to initiate a hfi_session with firmware, which is not
correct and core_init is a sync cmd, so core->lock() is released,
so that reverse thread can issue sys_init_done. But new session is
acquiring core->lock() and corroupting core->init_done.task_list
completion structure variable i.e leading to list_corruption issues.
So added change to address these issues.

Change-Id: I0b983a06b8ea58134ea93831246309c9ccbdf0d1
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-05-10 17:20:58 +05:30
Govindaraj Rajagopal
57180ce6f2 video: driver: update proper state in vb2_buffer_done
V4l2 clears buffer state related flags. So for driver errors
send state as error to avoid skipping V4L2_BUF_FLAG_ERROR
flag at v4l2 side.

Change-Id: Ifcb96d390746a71e8dbcf261f718439ef9ecfc91
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-05-10 10:48:15 +05:30
Qiwei Liu
2e2fbdb7e5 video: driver: support non-zero data_offset
In V4L2 definition, bytesused contains both data_offset
and actual payload size, whereas in HFI definition, data_size
only contain actual payload size after data_offset.
Add conversions to correctly support non-zero data_offset.

Change-Id: Ib581e942e39e0adbb673c53d1b31e669bdb2b998
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
2021-05-07 07:31:39 -07:00
Govindaraj Rajagopal
0995dfc215 video: driver: add frame_skip mode control setting for heic
Added V4L2_CID_MPEG_VIDEO_FRAME_SKIP_MODE support for
heic codec type.

Change-Id: I4eaca697729c45ebf72067a9d34a7dc8d607f0fa
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-05-07 14:21:48 +05:30
qctecmdr
cfd1584e2a Merge "video: driver: add support for main10StillPic profile" 2021-05-06 23:16:26 -07:00
Akshata Sahukar
1739ce7b92 video: driver: modify blur resolution setting and fix b_frames
[1] External blur is disbled to firmware if either blur width or
    blur height exceeds driver crop width or crop height.
    Also, it is disabled when both blur width and blur height is
    equal to blur width and blur height.
[2] fix b_frame adjustment calculation formula.

Change-Id: I71458b72095542f12c31094f7b9fc3bd34a7c66b
Signed-off-by: Akshata Sahukar <asahukar@quicinc.com>
2021-05-06 14:01:02 -07:00
Govindaraj Rajagopal
f05007686d video: driver: add support for main10StillPic profile
Added support for V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10_STILL_PICTURE.
It willbe used in 10bit image encoding usecases.

Change-Id: I14877547f1f4792eefb0ea6bcecf2643627c125a
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-05-06 22:09:25 +05:30
Govindaraj Rajagopal
03db3bfd7f video: driver: add check_session_supported for session admission
- check total mbps is within range(including current session)
- check total mbpf is within range(including current session)
- image session:
    - decode: Only non-secure allowed
    - encode: check basic image_encode requirements
        - wxh should be within allowed cap range
        - only linear fmt
        - input & output is 512 aligned
        - only CQ bitrate mode
        - GOP size should be zero
        - b-frame count is zero
        - timedelta based RC disabled
        - still-pic profile for 8bit and main10 for 10bit
- interlace resolution should be less than (1920*1088)/256.
- reject odd input or output resolution
- output resolution is with in inst->cap [min, max] range.
- current session mbpf is less than inst->cap[MBPF].max

Change-Id: I81c46950a8ef5b64bf5ac94564613998b1079b52
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2021-05-04 14:21:57 -07:00