Commit Graph

609 Commits

Author SHA1 Message Date
qctecmdr
c8b1d08726 Merge "msm: vidc: print inode and refcount for all dma_buffers" 2020-11-06 19:26:34 -08:00
qctecmdr
907f95adab Merge "msm: vidc: fix msm_vidc_err_recovery_disable for non_noc_err" 2020-11-06 16:58:39 -08:00
qctecmdr
110459ccf0 Merge "msm: vidc: fix format string mismatch" 2020-11-06 14:50:48 -08:00
Govindaraj Rajagopal
66e18fb51e msm: vidc: print inode and refcount for all dma_buffers
Print dma_buffer inode and file refcount details for all
dma buffers including dpb and driver internal buffers.

Change-Id: I3c22ccc1aaba555a3748d4607617737bd24adb12
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-11-06 02:53:56 -08:00
Govindaraj Rajagopal
f607704b44 msm: vidc: fix msm_vidc_err_recovery_disable for non_noc_err
disable error_recovery for non-NOC error if VIDC_DISABLE_NON_NOC_ERR_RECOV
is set. but error_recovery is getting disabled even for type NOC error
when VIDC_DISABLE_NON_NOC_ERR_RECOV is set.

[1] Only NOC error
    adb shell "echo 1 > /d/msm_vidc/disable_err_recovery"

[2] Only non-NOC error
    adb shell "echo 2 > /d/msm_vidc/disable_err_recovery"

[3] Both NOC & non-NOC error
    adb shell "echo 3 > /d/msm_vidc/disable_err_recovery"

Change-Id: Ia09ca23708d41a77f1d77cf6ed57506a16b32c73
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-11-06 12:52:00 +05:30
Govindaraj Rajagopal
fe6842e274 msm: vidc: fix format string mismatch
Some debug prints doesn't contain proper args.
So added proper args.

Change-Id: I36fe3e967b3bf600b3a948cb88f556a4d93c02d1
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-11-06 11:19:22 +05:30
qctecmdr
0e572d9975 Merge "msm: vidc: Enable Average QP extradata" 2020-11-05 21:15:22 -08:00
Uma Mehta
9e9322b41d msm: vidc: Enable Average QP extradata
Enabling Average QP extradata

Change-Id: I94edb55f57ee0c88554a98688665bf2eb805045e
Signed-off-by: Uma Mehta <umamehta@codeaurora.org>
2020-11-05 04:45:18 -08:00
qctecmdr
34fa9710d1 Merge "msm: vidc: fix ctrl limits update for MENU type" 2020-11-05 01:43:05 -08:00
Vikash Garodia
cc97f61b4b msm: venc: add support for boost for holi
For holi, boost is set as 15%. With the change,
a level of 15% can be set to video firmware.
Also ensure that the boost is set only when client
has set the boost control.

CRs-Fixed: 2810440
Change-Id: Ib4e4c5511c57daa78b405f8a92c2ee924b1cc1bd
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2020-11-04 17:49:31 +05:30
Qiwei Liu
92828b48ee msm: vidc: fix ctrl limits update for MENU type
When update limits for MENU type controls, should keep
original menu_skip_mask, shouldn't replace it with step_size.

Change-Id: I9706f139fd299f7ca931d812e1a95017606a2267
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
2020-11-03 21:56:29 -08:00
Qiwei Liu
af73385543 msm: vidc: fix BW overvote due to wrong worst_cf in fbd
For worst complexity factor received in fbd, also need
to divide it by frame_size, otherwise will cause
bus BW overvote.

Change-Id: Ibb20103c4ab8e3830eea8cf8a04b32f421b60362
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
2020-11-03 13:31:15 +08:00
qctecmdr
a9c461984c Merge "msm: vidc: resolve use-after-free problem" 2020-10-30 16:47:10 -07:00
qctecmdr
101705d250 Merge "msm: vidc: Handle race condition for accessing session head" 2020-10-30 14:19:53 -07:00
Govindaraj Rajagopal
459ecf6ee6 msm: vidc: tune dynamic framerate logic
Some vp9 clips contains alt-ref frames(decode only) at
periodic intervals and that particular frames buffer ts
delta is very low(as low as 1 ms). So dynamic framerate
calculation in driver is going for a toss.

To mitigate above problem, taking avg framerate instead
of max value.

Change-Id: I0f320c6a24199efe28d357d53c7cc9ddf6fc3062
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-10-29 14:41:33 +05:30
Govindaraj Rajagopal
34f376ccdc msm: vidc: Handle race condition for accessing session head
Currently session_end() accesses &dev->sess_head without device->lock.
So there are high chances of use-after-free in &dev->sess_head.

Change-Id: I34593e6507da9bad13c6d92faf40c4d790825d39
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-10-28 13:02:06 +05:30
Govindaraj Rajagopal
4b02c344e1 msm: vidc: resolve use-after-free problem
msm_vidc_open() failure is freeing the inst structure which might have
been under use by other threads and hence use kref_put instead of kfree
instance in msm_vidc_open() to resolve use-after-free problem.

Change-Id: I611aa6347da6c884345890153c7f7e4525a4307c
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-10-27 19:04:54 +05:30
Mihir Ganu
50adf52c82 msm: vidc: Increase vpp cycles for 960fps use case
Increase vpp cycles to bump frequency to 366MHz
for encoder 960fps use case.

Change-Id: If0f9d0f084dfcefa9f8614ec6774588dec6b7007
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2020-10-26 09:28:06 -07:00
qctecmdr
c41612ec9d Merge "msm: vidc: tune input buffer size based on buffer_size_limit" 2020-10-22 05:52:31 -07:00
qctecmdr
82bdad8d21 Merge "msm: vidc: Avoid dma_buf memory leak under memory pressure" 2020-10-21 23:54:35 -07:00
qctecmdr
5de76995c3 Merge "msm: vidc: allocate max input buffer size for specific video hardware" 2020-10-21 04:41:56 -07:00
Govindaraj Rajagopal
2c0ee3a2b6 msm: vidc: tune input buffer size based on buffer_size_limit
Codec2 HAL sets V4L2_CID_MPEG_VIDC_VIDEO_BUFFER_SIZE_LIMIT for all
session and it is very low value. So decoder input buffer size is
always limited by buffer_size_limit. Memory budget estimation is
going for toss in msm_comm_check_memory_supported. So video driver
started allowing all sessions during concurrency run without any
restriction. Added change to use correct buffer size during
memory estimation.

Change-Id: Ic7c5e51a91615fdba8965b3a359c2d3a37c9a14b
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-10-20 13:57:32 +05:30
Malathi Gottam
cb41662921 msm: vidc: allocate max input buffer size for specific video hardware
For certain video hardware which doesn't support higher resolutions
like 4k or above, allocate maximum input buffer size

Change-Id: I30a908573cf4d0dce8bcbaeb813913130f051884
Signed-off-by: Malathi Gottam <mgottam@codeaurora.org>
2020-10-20 11:37:02 +05:30
qctecmdr
671ed1c5f6 Merge "msm: vidc: fix ts reorder for heif" 2020-10-19 22:10:07 -07:00
Govindaraj Rajagopal
8a3082af38 msm: vidc: raise interrupt for encode batching usecase
HFR recording usecases, batch mode is enabled by default.
Currently no interrupt is raised to firmware for ETB write
on command queue. So firmware was not reading the queue,
though there are lot of pending messages in the command
queue, So complete encoder pipeline is getting stalled
after encoding couple of frames.

To avoid above problem, raising interrupt to firmware
every time(Only for last ETB in the batch).

Change-Id: If584a8175bfa54402087d1888dd032d08e1f3c15
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-10-19 16:17:54 +05:30
qctecmdr
3e834c7a00 Merge "msm: vidc: Update enc scratch2 buffer size calc" 2020-10-16 21:16:50 -07:00
Brijesh Patel
cbbf49a6e1 msm: vidc: Avoid dma_buf memory leak under memory pressure
dma_buf_put does not happen in case of failure while mapping dma_buf.
This leads to ion_dma_buf leak as refcount is 1 even after session
close. In memory pressure scenario while running concurrency usecase
such scenario can occur.

Change-Id: I2084538162b54d87acd6fa57bb5cc5bd2096c08d
Signed-off-by: Brijesh Patel <pbrijesh@codeaurora.org>
2020-10-16 22:09:27 +05:30
Chandrakant I Viraktamath
e2f86b092a msm: vidc: fix ts reorder for heif
Fix logic for ts reorder in heif decoder
since default value of disable timestamp
reorder control is 0.

Change-Id: I56cb8c40d99c3a3de867da659005faebd201be80
Signed-off-by: Chandrakant I Viraktamath <civirakt@codeaurora.org>
2020-10-16 17:40:29 +05:30
Shi Zhongbo
6090ef6b02 msm: venc: distinguish client frame rate handling from auto detection of frame rate
By default, encoder needs to enable VUI timing info.
Frame rate change triggers new header and timing info.
Hence, we need to distinguish client trigger fps change
vs auto detection of fps change.
Introduced new HFI for setting auto detection of fps.
In auto fps case, VUI timing is not re-generated.

Change-Id: I6b579d1e6ef0c49a849b7b7e0383f593a949bab3
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
2020-10-15 16:11:18 -07:00
Priyanka Gujjula
cbfcd83f51 msm: vidc: Update enc scratch2 buffer size calc
Consider downscaling buffer size with unrotated
wxh when rotation or flip is enabled along with
downscaling. Also correct wxh to all buffer calc
if rotation is enabled.

Change-Id: I5b89a5206057c4bbfed793b439aa2fb2c5d2601e
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
2020-10-15 22:11:35 +05:30
qctecmdr
c643318569 Merge "msm: venc: fix the VUI timing info" 2020-10-12 15:49:56 -07:00
Vikash Garodia
48957371a4 msm: venc: fix the VUI timing info
The timing info should represent the number of time
units in one seconds, as per the timescale and time
units per tick. Update the same while setting the HFI
to video firmware.

Change-Id: Ifb6bc34ad295e472715fb72813a236c851d4480f
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2020-10-09 13:20:03 +05:30
Govindaraj Rajagopal
63b9cfe02d msm: vidc: enable mark_target and mark_data
Currently firmware populates tag_data and produces
FBD for all ETB's only if mark_target and mark_data
is enabled. So sending dummy value as a WA.

Change-Id: I93a80d59e4f0f52eac94391ff86afc341468677f
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-10-09 11:38:34 +05:30
qctecmdr
fa7e892e79 Merge "msm-vidc: fix final BW voting to ICC" 2020-10-07 16:15:38 -07:00
qctecmdr
f153ecfe10 Merge "msm: vidc: Add support for hw stability test" 2020-10-05 12:26:08 -07:00
qctecmdr
a6485e3cb3 Merge "msm: vidc: Add fn pointer for ar50lt bw calc" 2020-10-05 12:26:08 -07:00
Priyanka Gujjula
cb18964770 msm: vidc: Add support for hw stability test
Add support for noc error and vcodec hung HFI
to test hardware stability via ssr_type and
to input the sub client id and test address
accordingly.

<test_addr><subclient_id><ssr_type>
ssr_type: 0-3 bits
sub_client_id: 4-7 bits
reserved: 8-31 bits
test_addr: 32-63 bits

Change-Id: I05970d3dc3e54da50688319eabccd5d11f8f55e2
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org
2020-10-02 11:31:04 -07:00
Dikshita Agarwal
f033016e9e msm-vidc: fix final BW voting to ICC
Currently, Required BW is calculated in bytes per second but
when setting it to ICC, kbps_to_icc macro is applied to
calculated BW which again divides the value by 8 and resulting
into less final vote to icc.

Change-Id: I7a645478d05909308edea2170d7c5cb911cbf6f0
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
2020-10-01 16:32:22 +05:30
qctecmdr
fbff1f488b Merge "msm: vidc: always use HQ for HEIC and lossless encoder" 2020-09-30 12:59:24 -07:00
qctecmdr
7b9be557d2 Merge "msm: vidc: reduce shima max spec" 2020-09-30 12:59:24 -07:00
Priyanka Gujjula
7c4bb220ce msm: vidc: Add fn pointer for ar50lt bw calc
Add ar50lt bw calc function pointer in
core ops.

Change-Id: I83cb81dde373a14b5b07594ca5af286bc01eefd1
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
2020-09-29 17:57:13 +05:30
qctecmdr
e93fd8adfa Merge "msm: vidc: Add control to handle timestamp reorder" 2020-09-28 09:55:29 -07:00
qctecmdr
0fb5c58c90 Merge "msm: vidc: Force nominal for high bitrate decode usecases" 2020-09-28 09:55:29 -07:00
qctecmdr
e53fcca85f Merge "msm: vdec: Do not consider 10bit size for specific video hardware" 2020-09-28 09:55:29 -07:00
qctecmdr
6e6740b2e5 Merge "msm: venc: reject unsupported sessions with VPSS enabled" 2020-09-28 09:55:29 -07:00
Govindaraj Rajagopal
5d0c3973bc msm: vidc: reduce shima max spec
Update max-hw-load to be inline with shima
pro-sku spec.

Change-Id: I98aaa4d870156812a240fecdf31feaa242aca4a8
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-09-28 11:32:34 +05:30
Qiwei Liu
3486a7e10a msm: vidc: always use HQ for HEIC and lossless encoder
Always use HQ mode for HEIC and lossless encoder.
Refine FW version retrieve to support version
string start with lower case v.

Change-Id: I092956b34250da55a4cfc2c7b88815c05a64375f
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
2020-09-26 11:46:47 +08:00
Priyanka Gujjula
173068c67f msm: vidc: Add max-image-load caps to holi and shima
Add max-image-load caps as 8k for holi and
16k for shima for all variants.

Change-Id: I5d1483c0e2dc06af61eca4944bc269e36baa6d73
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
2020-09-23 21:38:09 +05:30
Shi Zhongbo
7377b0c454 msm: venc: reject unsupported sessions with VPSS enabled
Reject any sessions with non-multiple 8 of resolution and
rotation/flip is enabled.

Change-Id: Ifac0cc8884461fe8d2502e92481643d9443aa527
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
2020-09-21 23:03:41 -07:00
Chandrakant I Viraktamath
70a2ee6e3c msm: vidc: Add control to handle timestamp reorder
Add control to enable/disable timestamp reordering
in driver.

Change-Id: I50c3f60bb8af053881073b40c6df0c74f3f0aafb
Signed-off-by: Chandrakant I Viraktamath <civirakt@codeaurora.org>
2020-09-21 19:24:02 +05:30