Commit Graph

637 Commits

Author SHA1 Message Date
Vikash Garodia
f3ff48e82f video: driver: reset video_cc_mvs0_clk_src clock_rate
Reset video_cc_mvs0_clk_src value to resolve MMRM high video
clock projection issue.

Change-Id: I0c549d7537a82792e9de708c96c265f0dce5908d
Signed-off-by: Vikash Garodia <quic_vgarodia@quicinc.com>
2021-12-09 17:17:52 +05:30
Chinmay Sawarkar
1068661f6d video: driver: Fix dma_buf_vmap arguments
New dma_buf_vmap api takes dma_buf_map struct as argument,
instead of kvaddr.

Change-Id: I2843a28b2c0c2de2d9cd1bfa96fb1a86ffba6059
Signed-off-by: Chinmay Sawarkar <quic_chinmays@quicinc.com>
2021-12-06 09:47:16 -08:00
qctecmdr
2a0b3fe4cf Merge "video: driver: Add HFI changes for AV1 Decoder" 2021-12-03 14:19:13 -08:00
Mihir Ganu
1c5f469b71 video: driver: Add HFI changes for AV1 Decoder
Add the required codec properties and HFI definitions to enable AV1D.

Change-Id: Ib098ed17f8b8e1fe9403f966a2dab97a3c9f96de
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2021-12-02 12:44:12 -08:00
qctecmdr
330cdcb122 Merge "video: driver: enable mmrm query support" 2021-12-01 12:28:11 -08:00
Mahesh Kumar Sharma
2a7cf79509 video: driver: Add AV1 codec, profile and level in UAPI
Add AV1 codec, profile and level defintions and controls in UAPI.
Add these controls as private controls in video driver.

Change-Id: I58edec2d7fabceaa405708c99a75997c9f454022
Signed-off-by: Mahesh Kumar Sharma <quic_smahesh@quicinc.com>
2021-11-30 15:01:05 -08:00
Praveen Chavan
53d5efcd7c Merge branch 'video-kernel-waipio.lnx.1.0' into kailua_1.0 2021-11-29 13:38:02 -08:00
qctecmdr
526f8e8a47 Merge "video: driver: Add support for kalama/iris3 platform" 2021-11-19 16:09:36 -08:00
Mihir Ganu
9456cc40fb video: driver: Add support for kalama/iris3 platform
Add the required config and platform files to enable
kalama platform with iris3 VPU.

Change-Id: Ia65d2212b946d0d37fc99e30e25fe408882bdec3
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2021-11-18 22:56:07 -08:00
qctecmdr
f07dfda71d Merge "video: driver: Correct max mbps calc for slicing" 2021-11-18 08:32:39 -08:00
Priyanka Gujjula
6eacf50e78 video-driver: Fix compilation errors for parrot
Fix compilation errors on parrot which has a
different lunch combo other than taro/diwali.

Change-Id: I35aee69bc8e18d50395a01b97d282c21e75da193
Signed-off-by: Priyanka Gujjula <quic_pgujjula@quicinc.com>
2021-11-17 17:45:12 +05:30
qctecmdr
55da89b96e Merge "video: driver: diwali: read efuse from sw_range4" 2021-11-12 13:32:02 -08:00
Maheshwar Ajja
814107162d video: driver: check kernel version to differentiate api
dma_buf_vmap() api changed from kernel version 5.15 and hence
check kernel version to use the updated api.

Change-Id: I05b7c72199cedfe9c33a8888fffb5e38da875f7e
Signed-off-by: Maheshwar Ajja <majja@quicinc.com>
2021-11-11 12:21:38 -08:00
qctecmdr
ab6e36ed88 Merge "video: driver: reject any unknown buffer received from fw" 2021-11-10 13:22:35 -08:00
qctecmdr
7c3520c2b0 Merge "video-driver: check max mbpf" 2021-11-10 13:22:35 -08:00
Priyanka Gujjula
4b9c19e5e5 video: driver: diwali: read efuse from sw_range4
HLOS doesnot have access to raw region. Instead,
read from sw_range4 region which are sense
registers for raw region.

Change-Id: I662266b6557756d9bf6ef687f81b7869a792e7f7
Signed-off-by: Priyanka Gujjula <quic_pgujjula@quicinc.com>
2021-11-10 14:24:28 +05:30
Priyanka Gujjula
cf52dc1e6c video: driver: Correct max mbps calc for slicing
Max mbps has to be calculated using max fps.

Change-Id: Ic0e3b337c7327e9a9bd4ada6b2008ccb6fa1be04
Signed-off-by: Priyanka Gujjula <quic_pgujjula@quicinc.com>
2021-11-10 12:06:08 +05:30
Akshata Sahukar
721d946ded video: driver: reject any unknown buffer received from fw
Reject any unknown buffer received from fw.

Change-Id: Icfc639cce364566a5479f5c12e13f7cb4fc06b00
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-11-05 13:15:06 -07:00
Manikanta Kanamarlapudi
f84053a13b video-driver: check max mbpf
check max mbpf as well while allowing
the real time session.

Change-Id: I1091582a02e01a4daa9c58ec5b50400b7d856610
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
2021-11-04 21:46:37 -07:00
Mahesh Kumar Sharma
767c8ad13d video: driver: Fix dlkm compilation
1.) New dma_buf_vmap() returns SUCCESS or FAIL unlike legacy dma_buf_vmap()
    which return type is vmap address. dma_buf_vmap() takes two arguments now.
    Now it returns vmap address in pointer passed as second argument.
2.) If defined, use V4L2_CTRL_CLASS_CODEC else use V4L2_CTRL_CLASS_MPEG.
3.) iommu_dma_enable_best_fit_algo is commented temporary.
4.) remove subsystem_resart.h

Change-Id: I73c6a840fa6028f021debff33b88178ac74dcef9
Signed-off-by: Mahesh Kumar Sharma <smahesh@codeaurora.org>
2021-11-03 16:32:50 -07:00
Priyanka Gujjula
043ab4c9f7 video: driver: diwali: Add SKU clock data
Add clock corners for diwali v1 and v2
variants.

Change-Id: I1322dada7dafed10cb17b9ab4bcef45f102d371c
Signed-off-by: Priyanka Gujjula <quic_pgujjula@quicinc.com>
2021-11-03 15:50:32 +05:30
Priyanka Gujjula
f352311f44 video: driver: Add diwali SKU's
Add support for diwali AA/AB(v1) & AC(v2) SKU.

Change-Id: I8afdf0529016e9cdbe72da8e57d7f35194cf9026
Signed-off-by: Priyanka Gujjula <quic_pgujjula@quicinc.com>
2021-11-03 15:47:21 +05:30
Priyanka Gujjula
e710c6f974 video: driver: diwali: Configure hbb value
Configure hbb value as '14' for lp4
ddr variant.

Change-Id: Id3fa3028f38dabb81d1b1fc5b117c6d10e4d45b5
Signed-off-by: Priyanka Gujjula <quic_pgujjula@quicinc.com>
2021-11-03 15:44:48 +05:30
Priyanka Gujjula
c3440c6ade video: driver: Add support for diwali variant
Add support for diwali variants.

Change-Id: Idf322e674818642a9c886fe8707e5ff8f64c4db5
Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
Signed-off-by: Priyanka Gujjula <quic_pgujjula@quicinc.com>
2021-11-03 07:39:48 +05:30
qctecmdr
7ac58c383b Merge "video: driver: Use max fps from inst caps" 2021-10-31 10:34:02 -07:00
Priyanka Gujjula
cad2ed9de0 video: driver: enable mmrm query support
Enable MMRM query support from mmrm driver
API along with internal core caps.

Change-Id: I997e8005e31a1bc3a8223de8cecc45fcaffdeeca
Signed-off-by: Priyanka Gujjula <quic_pgujjula@quicinc.com>
2021-10-27 08:36:28 +05:30
qctecmdr
07ede771b0 Merge "video: driver: update decoder load calculation" 2021-10-25 09:48:15 -07:00
Priyanka Gujjula
e786da48eb video: driver: Use max fps from inst caps
Use maximum framerate from published
instance caps to make it platform
agnostic.

Change-Id: I319768e722774969287abb9e782ddbece7593ff9
Signed-off-by: Priyanka Gujjula <quic_pgujjula@quicinc.com>
2021-10-25 21:38:58 +05:30
qctecmdr
4f953651a9 Merge "video-driver: add mmrm query support" 2021-10-22 14:37:00 -07:00
qctecmdr
1dafcfd11a Merge "video: driver: fix enable_bugon debugfs property for WD timeout" 2021-10-22 14:37:00 -07:00
Maheshwar Ajja
5ec009352f video: driver: update decoder load calculation
Calculate video decoder load based on max of crop and
input port resolution as few clients might not set
resolution on input port in which case load is not
proper before streaming started.

Change-Id: Id95d42e4cb3d992f759ce3388a8aeb55fadf16d7
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2021-10-22 12:45:32 -07:00
qctecmdr
ae93550604 Merge "video: driver: add dpb buffer handling for b2b ipsc cases" 2021-10-22 12:42:52 -07:00
qctecmdr
554cadb057 Merge "video: driver: Cancel batch work in case of pm_suspend" 2021-10-21 17:23:51 -07:00
Darshana Patil
f257df52e0 video: driver: update resolution check for max session support
Treat resolutions above (4K + half 4k) as 8k session instead of
simply treating above 4k resolutions as 8k sessions. Similar update
for 1080p and 720p resolutions as well.Based on above conditions,
support or reject a session.

Change-Id: I7be70b4c2b6e96ced6da2443f85e440c45fb616c
Signed-off-by: Darshana Patil <darshana@quicinc.com>
2021-10-21 10:59:18 -07:00
Priyanka Gujjula
4970193ad1 video-driver: add mmrm query support
[1] Disable MMRM if platform feature
    does not support.
[2] Query for scaling support from
    mmrm driver and enable/disable
    based on queried support
    accordingly.

Change-Id: I34cf9a9e150b0823828507e3f5d680aae6eb14d4
Signed-off-by: Priyanka Gujjula <quic_pgujjula@quicinc.com>
2021-10-21 23:16:13 +05:30
Govindaraj Rajagopal
1de4ced523 video: driver: fix enable_bugon debugfs property for WD timeout
Currently enable_bugon debugfs feature not working for WD timeout
cases. So added change to support that usecase.

Change-Id: I0cb3e6ed34d58c7969c727dea77f4fa695923c25
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-10-21 19:05:32 +05:30
Priyanka Gujjula
0a135fec38 video: driver: Cancel batch work in case of pm_suspend
Cancel batch work when core is suspended due to
pm suspend.

Change-Id: I5c6e4f0eb0883a9c3cd2711f65e0d74a6cced310
Signed-off-by: Priyanka Gujjula <quic_pgujjula@quicinc.com>
2021-10-21 14:37:00 +05:30
Govindaraj Rajagopal
839a329864 video: driver: add dpb buffer handling for b2b ipsc cases
Currently MSM_VIDC_BUF_DPB buffer allocated and queued to firmware
as part of output port streamon. Sometimes firmware raises b2b ipsc
with only change in fw_min_count. So client will not follow port
reconfig sequence and calls directly HFI_CMD_RESUME on output port.
So firmware holds only prev set of DPB buffers, which is not sufficient
and it continues to wait for further DPB buffers and that is leading
to stall and testcase fails. So added change to requeue new set of
DPB buffers, incase of b2b ipsc(with only change in count).

Change-Id: I213c752be4ca9dc16f838ab2990c996c4d78e95f
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-10-21 14:16:57 +05:30
qctecmdr
376bf106de Merge "video: driver: acquire and release wakelock during fw_load" 2021-10-19 15:11:41 -07:00
Darshana Patil
784a4c9280 video: driver: add power suspend and resume
add power suspend and resume implementations.

Change-Id: I785b5b05f37ed5ed656d2cbc04f5d429ff543260
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-10-18 12:27:48 -07:00
qctecmdr
2f0f48f55e Merge "video: driver: fix race issues with msm_vidc_stats_handler api" 2021-10-17 23:23:27 -07:00
Govindaraj Rajagopal
38da39c7ee video: driver: acquire and release wakelock during fw_load
Acquire wakelock to prevent system suspend during firmware load
sequence to avoid firmware load request failure.

Change-Id: I320db4a02b310acf5b5d9dd9a4f304b94e1c2f5b
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-10-14 11:00:20 +05:30
Govindaraj Rajagopal
d11e238157 video: driver: alter stage, pipe setting sequence to avoid vcodec hung
Currently stage and pipe is configured from output port start/resume
sequence. During VSP processing FW has no clue about stage, so default
it picked 2 stage. Later host sets 1(due to < 720p) stage at output
port. VSP is already started operating on input frames. So this
mismatch in stage settings was leading to vcodec HW hung issues.

Setting STAGE, PIPE settings at input port start/resume to avoid
above mentioned issues.

Change-Id: I7febe46d45c8e30a29b58d725d5298220fdbd8b2
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-10-12 18:54:36 +05:30
Govindaraj Rajagopal
2eb5672463 video: driver: fix race issues with msm_vidc_stats_handler api
There are 2 possible race issues with msm_vidc_stats_handler.

[1] msm_vidc_close acquired inst->lock and called cancel_delayed_work,
by that time stats_handler already fired and incremented inst->kref
via get_inst_ref. Close sequence releases the lock and called
put_inst().
So now inst strong ref is held by stats_handler, which will acquire
inst->lock and schedules new stats_work and does put_inst. inst->kref
count reaches zero and it will free inst struct(using close_helper).
So that will lead to use-after-free crash at core kernel side.

[2] msm_vidc_close acquired inst->lock and called cancel_delayed_work,
by that time stats_handler is scheduled. So process_one_work() from
workqueue is ready to call stats_handler api. But before it invokes
stats handler(context switch), msm_vidc_close sequence continued to
run and completed the close sequence and called put_inst. So inst
struct got freed up(because inst->kref count reached to zero). Now if
core kernel(workqueue) attempts to invoke stats_handler by calling
worker->current_func(work), will lead to again use-after-free crash.

Added changes to avoid above mentioned issues.

Change-Id: I55bc33a753f4dbae4a8cdc6373b5465d183da3bc
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-10-12 17:31:39 +05:30
qctecmdr
b1c38f2133 Merge "video: driver: add all intra encoding support" 2021-10-06 13:26:49 -07:00
qctecmdr
7a9bf3b45c Merge "video: driver: modify FW i/p o/p buffers starve condition" 2021-10-06 11:34:52 -07:00
qctecmdr
0dfacae794 Merge "video: driver: add error handling in print_vidc_buffer api" 2021-10-06 11:34:52 -07:00
qctecmdr
3fd62947ac Merge "video: driver: enable lossless encoding via debuf fs property" 2021-10-06 09:20:20 -07:00
Gaviraju Doddabettahalli Bettegowda
10990e39f9 video: driver: add error handling in print_vidc_buffer api
Possiblity of invalid ptr dereference in release_buffer_done
sequence. So added changes to handle this scenario.

Change-Id: I0f45e07d709d0fd300a172b564031e40eb07ff00
Signed-off-by: Gaviraju Doddabettahalli Bettegowda <gdoddabe@codeaurora.org>
2021-10-06 21:27:21 +05:30
Akshata Sahukar
f6a9744ff2 video: driver: modify FW i/p o/p buffers starve condition
Host needs to ensure FW atleast have 2 buffers available always,
one for HW processing and another for fw processing in parallel
to avoid FW starving for buffers.

Change-Id: I244e0170944b0b7ec342aa9b1b141b30af5bf606
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-10-05 13:14:01 -07:00