提交線圖

1009 次程式碼提交

作者 SHA1 備註 日期
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
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
Mihir Ganu
84e39edbcf video: driver: Adjust bandwidth votes for AV1 film grain
For AV1 bitstreams with film grain, split mode is used for
UBWC colorformats as well. Consider split mode to calculate
bandwidth votes.

Change-Id: I98bf07b8be7f0e829af5e55ed6d0c3659ae099f2
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2022-06-03 14:42:20 -07:00
Mihir Ganu
ec484c856b video: driver: Optimize HEVC Bin buffer allocation
Optimize HEVC Bin buffer allocation by allocating 25% additional
bitstream buffer size for 10 bit HEVC usecase and avoiding the
extra memory allocation for 8 bit usecases.

Change-Id: Iebbedf43e80fad852807349cbe7f70cf7a632a73
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2022-06-02 10:59:49 -07:00
qctecmdr
12c5ef4768 Merge "video-driver: add to support DolbyVision metadata" 2022-06-01 23:48:24 -07:00
qctecmdr
395e8686ec Merge "video: driver: Use max bitrate depending upon session" 2022-06-01 21:40:44 -07:00
Deepa Guthyappa Madivalara
0160053f46 video: driver: Use max bitrate depending upon session
1. Host will use HQ quality mode for all INTRA encoding case
2. Cap bitarate and bit rate boost to max bitrate of current
   session config

Change-Id: I8e8d19998ebeff992c290fbd18c072b2b93ffef2
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2022-06-01 11:36:14 -07:00
Zhongbo Shi
f781c619a9 video-driver: add to support DolbyVision metadata
1. add DolbyVision metadata cap and V4L2 id;
2. Increase decoder persist buffer size;
3. Increase decoder output meta buffer size;
4. Increase encoder input meta buffer size;
5. Parse buffer overflow flag and set buffer flag
   accordingly;

Change-Id: I8fa5e89068dd479033d28f627e585edc3a1c58bb
Signed-off-by: Zhongbo Shi <quic_zhongbos@quicinc.com>
2022-06-01 16:29:30 +08:00
qctecmdr
9ee0638b20 Merge "video: driver: fix slice mode support" 2022-05-31 19:39:44 -07:00
Akshata Sahukar
5713e9a303 video: driver: fix slice mode support
Allow client to set slice mode control to slice off for
HEIC codec.

Change-Id: Iffc8be23990a5dad451550cccb8236cc32951b2a
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-05-31 14:36:04 -07:00
Darshana Patil
e39962d028 video: driver: introduce lock for set & get volatile controls
Acquire client and inst lock for s_ctrl and g_volatile_ctrl

Change-Id: I97341b69ea5390133c46711c38be51326c80b224
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-05-31 11:20:03 -07:00
Akshata Sahukar
93742170e9 video: driver: fix incorrect crop resolution
Store unaligned resolution in driver inst formats
to avoid crop resolution getting updated to aligned
resolution whenever client did g_fmt and s_fmt again
after setting raw input resolution.

Change-Id: Ic2b6cf6e7d418d2bf0c35270199b914648e933d4
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-05-27 16:44:02 -07:00
qctecmdr
5dc3050cce Merge "video-driver: Add support for subframe_input" 2022-05-27 13:07:50 -07:00
qctecmdr
80ff8d2af2 Merge "video: driver: enable transcode stat for decoder" 2022-05-27 00:44:21 -07:00
qctecmdr
ccb76eb0e9 Merge "video: driver: Use vzalloc instead of kzalloc" 2022-05-26 19:19:15 -07:00
qctecmdr
5689776c4e Merge "video: driver: introduce client lock" 2022-05-26 18:57:44 -07:00
qctecmdr
ae681247a3 Merge "driver: video: Remove calls to power features during priority handling" 2022-05-26 16:19:46 -07:00
qctecmdr
54c511cf4b Merge "video: driver: Optimize encoder bin buffer size" 2022-05-26 16:19:46 -07:00
Deepa Guthyappa Madivalara
13d203ba7f video: driver: Use vzalloc instead of kzalloc
kzalloc might fail to allocate physically contiguous
memory which may not be available always and hence use
vzalloc to allocate virtually contiguous memory

Change-Id: I8ad89ef107da301217f3d1ec307b9b27b4edd2de
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2022-05-26 15:25:26 -07:00
Darshana Patil
2a687b2750 video: driver: introduce client lock
Acquire client lock for every entry point
in driver. This is needed especially for
streamoff and close calls where inst lock
is released while driver is waiting for
stop_done and close_done responses from fw.
When inst lock is released, client can send
a new ioctl call and driver state machine
can get updated leading to unexpected behaviour.

Change-Id: Ibb62c3431c88e2f1d9088d54fe7c9e53b1c284fd
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-05-26 14:34:36 -07:00
qctecmdr
e95d1dcf89 Merge "video: driver: Create and use single spin lock for dma fence" 2022-05-26 09:47:25 -07:00