提交图

1028 次代码提交

作者 SHA1 备注 提交日期
Darshana Patil
e4360dc18e video: driver: misc fixes for venv project
Change-Id: I4b5495ac4669a1e4519ac855d6b995e9d259f335
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-08-01 17:21:24 -07:00
Govindaraj Rajagopal
12adb66124 video: driver: add asynchronous probe support
Added async probe for video driver to reduce bootup latency.

In insmod/probe sequence, registered all video sub-devices with
component_model framework, so that once all sub-device probe
completes master/vidc node bind() callback willbe called. So as
part of bind, video driver will do core_init sequence. Due to
async probe all sub-device probe willbe called asynchronously
from different threads.

During rmmod/remove sequence master/vidc node may not be called
first and instead child node remove might be called, which will
intern calls component_del() api. 1st call to this api will
internally invoke unbind() callback of master. So as part of
unbind() video driver will do core_deinit() sequence.

of_platform_depopulate() will act as sync point on master node.
Which will make sure all residual sub-device removal completion.
So it will guarantee video device/master cleanup happens only
after all sub-devices removal.

Change-Id: Ia40d4b1aa54633ef26fff2c207da78f15e305363
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-08-01 17:21:04 -07:00
Akshata Sahukar
089b0f125b video: driver: 5 percent increase for vsp and vpp cycles
8k@30 fps encode has a very low margin for sw/fw at 338MHz.
Hence, increase core clock little bit(5%) to move to the next
corner i.e., 366MHz.

Change-Id: Idebde3c726086ec49d1fb0ca4525953dd3a30ba9
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-08-01 17:20:33 -07:00
Renjiang Han
da980f7582 video: driver: Set the fps of vp9 to the standard value
180fps is not a standard value, so we need to change
MAXIMUM_OVERRIDE_VP9_FPS to 200.

Change-Id: Ia32fc20598b8a2908ec3057dd0b00b40ea429b42
Signed-off-by: Renjiang Han <quic_renjiang@quicinc.com>
2022-08-01 17:20:14 -07:00
Mihir Ganu
34c527a939 video: driver: Subscribe to output metadata in both ports
Subscribe output metadatas in both input and output ports
so that metadatas which are detected in bitstream before
output port is started are not missed.
Example: AV1 HDR metadata which can be part of first ETB
(sequence header OBU + metadata OBU)

Change-Id: I77d75b42dcee79e0258ba96e6ab86d06ead2eaf4
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2022-08-01 17:19:58 -07:00
Akshata Sahukar
50a00f8265 video: driver: Avoid device crash after fence usecase execution
Since spin lock for fence is per session based and stored in instance
memory, by the time fence consumer released the fence, driver close
might be called and instance memory might be cleared. So, when fence
consumer released the fence, at the time of fence release callback,
this spin lock might nt be available. This race condition is resulting
into device crash after fence playback session ends. Avoid this by
using per fence based spin lock, which decouples it from instance
memory.

Change-Id: I12d6976c0bac3f0211bb16e24009603b37471ef3
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-08-01 17:19:38 -07:00
Mihir Ganu
1e87ceec2b video: driver: Introduce a property to set COMV bufcount
Certain codecs/use cases require larger COMV buffer sizes to achieve
performance. Introduce a property to set COMV bufcount and calculate
COMV buffer size based on the bufcount.

Change-Id: Ib0ed8afe77708dc453cbcc121bcd8606db637152
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2022-08-01 17:19:20 -07:00
Sachu George
b79ec844f2 video-driver: Updating H264 Decoder CMD_BUF size calculation.
Internal Buffer(CMD_BUF) size calculation is changed from (3 * 4) to 48
in firmware for H264 decoder. Aligning with same calculation in driver.

Change-Id: I974bca7d2e128cee24bf237b6f9ea606f386031d
2022-08-01 16:23:49 -07:00
Dikshita Agarwal
ea38b901b7 video: driver: update msm_media_info to use vidc colorformat
Update all functions in msm_media_info.h to use vidc color formats
instead of v4l2 color formats macros to restrict the usage of private
color format defines in only helper functions.

Change-Id: Ib308c76af7b16ddac93023202191a47b21d68f5c
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-07-27 15:40:05 +05:30
Dikshita Agarwal
39623d261e video: driver: use cap id for v4l2 ctrl to hfi value mapping
Use cap_id instead of ctrl_id while assigning the respective
hfi values for a v4l2 control and vice versa.

Change-Id: I42f3733a28b4b00ca04605dfc1d2ef0a6fb7833d
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-07-27 15:08:12 +05:30
Dikshita Agarwal
e5bc8371ea video: driver: use cap_id instead of v4l2_id for control handling
Instead of using private v4l2 ids, use cap_id while handling
different caps in s_ctrl and g_ctrl ops.

Change-Id: I4d5dbb151ef5bc2dd348a06663e0beae0756d761
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-07-21 23:38:32 +05:30
Dikshita Agarwal
fd5d2c059b video: driver: use CAP_FLAG_DYNAMIC_ALLOWED flag to allow ctrls
Currently ctrl_id is being used to decide whether to allow or not
certain control dynamically i.e. after stream on.
Use CAP_FLAG_DYNAMIC_ALLOWED to do the same instead.

Change-Id: I56bf5e725ae7bd4ece8aa2bde0aa84c42e759c17
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-07-21 23:37:14 +05:30
Dikshita Agarwal
b3fa32cf81 video: driver: prepare upstream caps database
- Remove caps related to private controls.
- Update parent, child dependencies for caps if not
  standard.
- Keep the caps which doesn't have v4l2 control associated
  and are used internally for some features.
- keep  non-standard but good to have features by removing
  the v4l2 control associated.

Change-Id: I31326c94edf3ef864f30765f44852b11c5eaf6ac
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-07-12 14:56:20 +05:30
Dikshita Agarwal
69d0c83f55 video: driver: split control code
Split control code into msm_vidc_control.c and
msm_vidc_control_ext.c files.

Change-Id: I95f13d66f33fb75da4ebaa08e24bf31fe5de55b4
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-07-12 12:15:54 +05:30
Tanya Kashyap(Temp)
85380e3c4a Fasr Forward 'origin/video-kernel.lnx.1.0' into video-kernel.lnx.4.0
* origin/video-kernel.lnx.1.0:
  vidoe driver: increase decoder maximum FPS and OR
  video-driver: Add driver support for anorak
  video: driver: release internal buffer as part of start/resume
  video-driver: fix encoder output buffer size
  video: driver: check for drain last flag for decoder only
  video: driver: initial state machine changes
  video: driver: fix use-after-free issues with __read_queue() api

Change-Id: I55bd67dd1f2d6d2025b3fc9840d815589fcfc2fc
2022-07-07 11:11:44 -07:00
qctecmdr
48f5a64bbd Merge "vidoe driver: increase decoder maximum FPS and OR" 2022-07-05 01:57:14 -07:00
Zhongbo Shi
627e5c6176 vidoe driver: increase decoder maximum FPS and OR
Increase decoder maximum FPS and Operating Rate
to 960.

Change-Id: Ic3634bb0c78bc9dc27e732147bb0cc65d8ccfc4a
Signed-off-by: Zhongbo Shi <quic_zhongbos@quicinc.com>
2022-07-04 13:17:20 +08:00
Sachu George
a709f30d05 video-driver: Add driver support for anorak
Adding driver support for anorak(Halliday).

Change-Id: I65239264758a1cc462ef6c458cb0a12f1fcdaf53
Signed-off-by: Sachu George <quic_sachgeor@quicinc.com>
2022-07-02 18:01:19 -07:00
qctecmdr
2567eb16d3 Merge "video: driver: release internal buffer as part of start/resume" 2022-07-01 23:37:58 -07:00
qctecmdr
b0513bcda8 Merge "video: driver: check for drain last flag for decoder only" 2022-07-01 23:37:56 -07:00
Darshana Patil
fb1ecb69d0 video: driver: release internal buffer as part of start/resume
Change-Id: I45469c0a569fbc282aa1dbd217654e49eb50f54f
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-06-30 15:18:08 -07:00
Zhongbo Shi
cd799e6c31 video-driver: fix encoder output buffer size
Fix encoder output buffer size for CQ mode
to YUVSizex2x1.25.

Change-Id: Ib4581a0dc7fbb99fee827c676106806d4ea89157
Signed-off-by: Zhongbo Shi <quic_zhongbos@quicinc.com>
2022-06-30 00:29:22 -07:00
Darshana Patil
c5a62d98a4 video: driver: check for drain last flag for decoder only
As part of stop done, check if firmware has returned drain
last flag only for decoder.

Change-Id: I9738fe316b4e3081a8ab9c8066ef5f59ac0720f0
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-06-29 16:47:56 -07:00
Darshana Patil
10794c2968 video: driver: initial state machine changes
- hierarchical state model which comprises of
  top level states and sub states
- top level states include OPEN, CLOSE, ERROR,
  INPUT_STREAMING, OUTPUT_STREAMING, STREAMING.
- sub states include DRAIN, DRC, DRAIN_LAST_BUFFER,
  DRC_LAST_BUFFER, INPUT_PAUSE, OUTPUT_PAUSE.
- follows deterministic approach for key sequences
  like DRC, DRAIN and last flag handling i.e none
  of these events are ignored or discarded.
- removal of auto start of firmware input port as
  part of ipsc handling.
- introduction of hfi commands for host controlled
  PAUSE and RESUME of firmware ports.
- introduction of information last flag packets
  for DRC and DRAIN when FW has insufficient
  output buffers.

Change-Id: Ie8c8f44af464d06f5a7bb76822f749c9874f869a
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-06-29 10:47:54 -07:00
Govindaraj Rajagopal
06643c1de9 video: driver: fix use-after-free issues with __read_queue() api
Incase of synchronous cmd(HFI_CMD_INIT, HFI_CMD_STOP, HFI_CMD_CLOSE)
timeout cases, video driver will attempt to do core_deinit sequence
and will free all interface queues mappings as part of core_deinit.

If at same time ISR handler is fired then reverse thread will attempt
to dequeue packets from message and debug queue. Reverse thread will
not acquire core->lock for performance reasone. Dequeueing packets
without acquiring core->lock might lead to use-after-free issues.

Uploaded change to address above mentioned issue.

Change-Id: I2047b28d69611129c4fdefcfb8a843c895e11dbb
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-06-29 09:17:02 +05:30
Tanya Kashyap(Temp)
111e2c9603 Fast Forward video driver project video-kernel.lnx.1.0' into video-kernel.lnx.4.0
* origin/video-kernel.lnx.1.0:
  video: driver: allow turbo for av1 and concurrent sessions
  video: driver: Modify Min QP in CAP_TO_8BIT_QP macro
  video: driver: Modify Min QP for 8 and 10 bit usecase
  video: driver: fix possible memory corruption issue
  video: Allow slice configuration for VBR
  video: driver: buffer tracing changes
  video: driver: fix order of fence node delete and put
  video: driver: fix faulty msm_vidc_vmem_alloc() failures
  video: driver: vp9 1080p decoder needs to reach 180fps
  video: driver: update bitstream buffer size calculation
  video: driver: initialize local variables
  video: use DLKM flag instead of QMAA flag to compile driver
  video: driver: Calculate AV1 VSP cycles using perf model
  video: driver: fix for initial input_rate calculation
  video: driver: Add missing capabilites
  video: driver: Adjust bandwidth votes for AV1 film grain
  video: driver: Optimize HEVC Bin buffer allocation
  video: driver:  Use max bitrate depending upon session
  video-driver: add to support DolbyVision metadata
  video: driver: fix slice mode support
  video: driver: introduce lock for set & get volatile controls
  video: driver: fix incorrect crop resolution
  video: driver: Use vzalloc instead of kzalloc
  video: driver: introduce client lock
  video-driver: Add support for subframe_input
  video: driver: Optimize encoder bin buffer size
  driver: video: Remove calls to power features during priority handling
  video: driver: Fix realtime load calculation
  video: driver: Add Complexity vs. Operating Rate handling
  video: driver: support upto level 6.2 for AVC and HEVC dec
  video: driver: enable transcode stat for decoder
  video: driver: Create and use single spin lock for dma fence

Change-Id: I167e6c6347d478cdb7435b3574a5b839b60c49c7
2022-06-27 19:02:28 -07:00
qctecmdr
df3fd88dac Merge "video: driver: allow turbo for av1 and concurrent sessions" 2022-06-26 11:07:53 -07:00
qctecmdr
c7360bccc3 Merge "video: driver: Modify Min QP in CAP_TO_8BIT_QP macro" 2022-06-26 01:20:54 -07:00
Deepa Guthyappa Madivalara
b4b05a5f97 video: driver: allow turbo for av1 and concurrent sessions
allow turbo clk for av1 session or concurrent session
otherwise limit to nominal always

Change-Id: If2280bb3756e99cda018c7ec1767aa1c32e36228
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2022-06-24 16:49:42 -07:00
qctecmdr
be6dd00dcf Merge "video: driver: buffer tracing changes" 2022-06-23 17:00:03 -07:00
qctecmdr
71b6839128 Merge "video: driver: fix possible memory corruption issue" 2022-06-23 17:00:03 -07:00
Vedang Nagar
2eacac6058 video: driver: Modify Min QP in CAP_TO_8BIT_QP macro
For HEVC 8 bit usecase, QP values are being capped
from [-11,51] to [1,51]. Modifying the same in
CAP_TO_8BIT_QP macro.

Change-Id: Id17fab4c62770140131f0f8454fc480090732d0b
Signed-off-by: Vedang Nagar <quic_vnagar@quicinc.com>
2022-06-24 00:38:18 +05:30
Vedang Nagar
9f8cff04a3 video: driver: Modify Min QP for 8 and 10 bit usecase
As part of firmware stress test with QP range of [0, 5],
FW gets a divide by zero exception with QP 0, and RC
validation happens with QP range of [1, MaxQP].
Modifing Min QP from 0 to 1 for 8 bit and from
-12 to -11 for 10 bit usecases to avoid multiple FW issues.

Change-Id: I29d8fd785cfafbcb1b73984b3f79900307c22c10
Signed-off-by: Vedang Nagar <quic_vnagar@quicinc.com>
2022-06-24 00:23:12 +05:30
Govindaraj Rajagopal
cd4ea5b043 video: driver: fix possible memory corruption issue
__flush_debug_queue() currently uses core->response_packet
or core->packet for flushing debug queue. So these were
allocated only 4096 bytes, but in read_queue(), boundaries
were checked against VIDC_IFACEQ_VAR_HUGE_PKT_SIZE macro
which is of size 1024 * 12 bytes.

So if FW log packet size is in between 4 KB to 12 KB then
read_queue() allows memcpy() into core->response_packet
or core->packet that will lead to redzone corruption issue
with adjacent alive/valid allocations i.e futher lead to
kernel panic at kfree() sequence(during object validation).

Uploaded change to use same sizes during allocation and
read_queue() validation.

Change-Id: If82766c1479d7589605386f3e314ff2ccd97f6d0
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-06-23 19:45:09 +05:30
Manikanta Kanamarlapudi
1f2238abb9 video: Allow slice configuration for VBR
Allow slice configuration for VBR

Change-Id: I289aa22fa9c97260b32dc34a1f95ad8b1b500287
2022-06-23 13:00:27 +05:30
Akshata Sahukar
1e7edf5b98 video: driver: buffer tracing changes
1. Introduce new v4l2 control to get HAL session id and
   print the same in driver to have unqiue session id
   between HAL and driver
2. Copy input buffer timestamp into input meta buffer
   to track input meta buffer done at HAL side. Required
   specially for fence use case.

Change-Id: I146b153fa0baea3b684a482de5da19e736df3736
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-06-22 16:41:08 -07:00
qctecmdr
9808a535b5 Merge "video: driver: fix order of fence node delete and put" 2022-06-21 16:08:17 -07:00
Darshana Patil
c6472ffcfb video: driver: fix order of fence node delete and put
delete fence node from the list and then call
fence_put(). This fixes random crashes in fence
testcase

Change-Id: Ib2cdc3a4046a6065bff991fdebe178dddc8847b2
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-06-21 12:56:58 -07:00
Govindaraj Rajagopal
e433d223a6 video: driver: fix faulty msm_vidc_vmem_alloc() failures
Sometimes uninitialized local pointer variables were passed to
msm_vidc_vmem_alloc() call for allocating memory. Uninitialized
variables might garbage value, so msm_vidc_vmem_alloc() is
treating that double alloc request and returning error. So i.e
leading to undefined behaviour.

For e.x, msm_vidc_update_input_cr() call will never add any
entries into &inst->enc_input_crs(due to above mentioned issue),
So i.e leading to populate invalid input compression ratio in
encoder usecase.

Change-Id: I4507b343bee8eec7252cf946ad8d3120efd7bacb
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-06-21 19:29:12 +05:30
qctecmdr
a753289adb Merge "video: driver: vp9 1080p decoder needs to reach 180fps" 2022-06-20 20:23:01 -07:00
qctecmdr
585ef29ef8 Merge "video: driver: initialize local variables" 2022-06-20 16:50:00 -07:00
qctecmdr
e90c0c454a Merge "video: driver: update bitstream buffer size calculation" 2022-06-20 16:50:00 -07:00
Renjiang Han
6bf3bcb9cc video: driver: vp9 1080p decoder needs to reach 180fps
cts requires vp9 1080p decoder to achieve 180fps on AndroidT.

Change-Id: I68f53a661cb9644dee085652e19962e3bac132c4
Signed-off-by: Renjiang Han <quic_renjiang@quicinc.com>
2022-06-20 19:13:01 +08:00
Deepa Guthyappa Madivalara
197328a67e video: driver: update bitstream buffer size calculation
calculate bitstream buffer size using firware macro

Change-Id: I1a06007ae8cd2852d70a426ba57119563813ebc5
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2022-06-15 11:52:56 -07:00
Deepa Guthyappa Madivalara
0c87473d7b video: driver: initialize local variables
initialize local vairables to avoid errors

Change-Id: I768f3da15870ec3151cbe4eb37299c44609ebddb
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2022-06-14 15:28:06 -07:00
Maheshwar Ajja
76281289b4 video: use DLKM flag instead of QMAA flag to compile driver
Use TARGET_KERNEL_DLKM_DISABLE and TARGET_KERNEL_DLKM_VIDEO_OVERRIDE
to compile video driver.

Change-Id: Id824aac78c4c0ce856ba1c92ab1bda4e679475cc
Signed-off-by: Maheshwar Ajja <quic_majja@quicinc.com>
2022-06-14 10:18:33 -07:00
Mihir Ganu
78615ba9fc video: driver: Calculate AV1 VSP cycles using perf model
Calculate AV1 VSP cycles using calculations in Kalama perf model.
For legacy codecs, VSP cycles are still calculated using
legacy MB_CYCLES_VSP.

Change-Id: I2535924d650bffd4da32e187fe9e84a27d03ad37
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2022-06-10 13:10:08 -07:00
Deepa Guthyappa Madivalara
ea5082d827 video: driver: fix for initial input_rate calculation
1. do not update input_rate until 30 inputs are
   received.
2. Fixes unwated downgrade from RT to NRT in UHD cases

Change-Id: I8d38a64829b44a0e335b69329ac5279a7b8a782d
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2022-06-08 16:05:08 -07:00
qctecmdr
b820a1314e Merge "video: driver: Add missing capabilites" 2022-06-06 12:42:38 -07:00
Vedang Nagar
cbfbff897a video: driver: Add missing capabilites
Add mising capabilites in msm_vidc_waipio.c
for the changes done in msm_vidc_kalama.c

Change-Id: Idc75533162c977333efb4caec992ee13408ce422
Signed-off-by: Vedang Nagar <quic_vnagar@quicinc.com>
2022-06-06 14:21:27 +05:30