Commit Graph

1270 Commits

Author SHA1 Message Date
qctecmdr
0e06b9af89 Merge "video: driver: Add debugfs support to disable synx v2 fence" 2023-03-20 14:37:04 -07:00
qctecmdr
4a2de2df11 Merge "video: driver: use devm for resource management" 2023-03-19 13:08:06 -07:00
Akshata Sahukar
625745bf00 video: driver: Add debugfs support to disable synx v2 fence
Add debugfs support to disable synx fence falling back
to dma sw fence via parameter "msm_vidc_disable_synx_fence"

Change-Id: I46b4833c2dfabec95f5ff34a0aef42043f8f6f5c
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2023-03-17 15:37:11 -07:00
Akshata Sahukar
eaf80f36cb video: driver: Add support to map synx fence registers
Add support to map below mentioned registers
required for synx v2 fence support
- FENCE
- QTMR0_F0V1_QTMR_V1_CNTPCT_LO
- QTMR0_F0V1_QTMR_V1_CNTPCT_HI

Change-Id: I43a80ca9be282eb4bbfc46a8d62d875478619516
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2023-03-17 15:35:51 -07:00
Akshata Sahukar
33d0b20141 video: driver: Add support for Synx V2 fences
Add Synx V2 fences support to improve latency
in video decode usecases.

Change-Id: If21f8b65895364a804f8e03580b09c44b377c199
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2023-03-17 13:59:37 -07:00
Deepa Guthyappa Madivalara
d2b9c98869 video: driver: replace V4l2 macros with availble upstream macros
- Replace prior macros from downstream driver as these are now
   defined in upstream V4l2 include files

Change-Id: I34dc063df0c2ca2194c115d310d7fe5026cd573e
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2023-03-17 11:57:07 -07:00
Govindaraj Rajagopal
6432572ed6 video: driver: use devm for resource management
use devm_add_action_or_reset() to register custom objects with devm.
This function wil invoke release callback during rmmod/remove sequence.

Change-Id: I87cf79741123bc3b1c624f8f44ba146deedaf32b
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2023-03-17 10:57:09 +05:30
qctecmdr
59a8ab6758 Merge "video: driver: replace V4l2 macros with availble upstream macros" 2023-03-16 10:56:49 -07:00
Akshata Sahukar
f00fe9f305 video: driver: fix LTR adjustment
LTR is not correctly getting adjusted due to incorrect
goto statement leading to failure in premerge with
test_AVC_NV12C_3LTR_4Layers_Adjutment_Encode testcase.
Fix this.

Change-Id: Ieda4f33d6679f645c2eb349e8ddf1015a3814711
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2023-03-14 12:13:29 -07:00
qctecmdr
ef309fc170 Merge "video: driver: resume video core before running ssr command" 2023-03-14 10:31:21 -07:00
qctecmdr
5952782968 Merge "Revert "video: driver: disable 5 LTR support"" 2023-03-13 17:28:11 -07:00
Deepa Guthyappa Madivalara
1cf504b165 video: driver: replace V4l2 macros with availble upstream macros
Replace prior macros from downstream driver as these are now
defined in upstream V4l2 include files

Change-Id: I7d1677cd7ef95c05219e043e0c78d29299036bed
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2023-03-13 16:18:38 -07:00
Akshata Sahukar
9019b6bc09 Revert "video: driver: disable 5 LTR support"
This reverts commit 8acf4313fc.

Change-Id: I5adc9e59b2b56a4616330bf7a2aec402ca827232
2023-03-13 10:52:43 -07:00
qctecmdr
5abbd7a8b2 Merge "video: driver: Change ARP buffer context bank" 2023-03-13 10:42:24 -07:00
qctecmdr
3923a9281b Merge "video: driver: Remove hard parent dependency" 2023-03-13 10:13:09 -07:00
Chinmay Sawarkar
a0798a6902 video: driver: Change ARP buffer context bank
In non secure case, ARP buffer will use CB0.

Change-Id: Id7bb33906d374f230b2054455e6efdc41e710abe
Signed-off-by: Chinmay Sawarkar <quic_chinmays@quicinc.com>
2023-03-09 12:47:23 -08:00
qctecmdr
b14510daa2 Merge "video: driver: encoder delay start: superframe" 2023-03-09 09:46:19 -08:00
Ankush Mitra
964752c27c video: driver: Remove hard parent dependency
Remove hard parent dependency
adjust it accordingly.

Change-Id: I8d5de2ba4199570f366745b980b451099467ebaa
Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
2023-03-09 12:05:19 +05:30
Ankush Mitra
a27c15b1c5 video: driver: resume video core before running ssr command
Resume video hardware if it is already power collapse
to SSR command else SSR command will not take effect.

Change-Id: I74def614a5a5174c052d14f47cecd1f1a619529e
Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
2023-03-09 11:17:20 +05:30
Darshana Patil
441d4be45e video: driver: encoder delay start: superframe
make superframe control as dynamic.

Change-Id: I54525aa1e31b3078e13e77c59474bf6b7298cf0d
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2023-03-08 16:03:37 -08:00
Ashish Patil
dde3e01a63 video: driver: enabling new power calculation changes
Change-Id: I9ea52a2f766921f8012a951f5e07a2d18d5d7e55
Signed-off-by: Ashish Patil <quic_ashpat@quicinc.com>
2023-03-08 11:52:02 -08:00
Ashish Patil
dd0e6d5f70 video: driver: update power calculations
Update power calculation to avoid low framerate or
frame drop issues

Change-Id: Ice306a44d4ea8242d965c0e5d03edffc0f5e0f8b
Signed-off-by: Ashish Patil <quic_ashpat@quicinc.com>
2023-03-08 11:15:05 -08:00
qctecmdr
c0d457f55a Merge "video: driver: encoder delay start: CSC" 2023-03-08 09:34:56 -08:00
Akshata Sahukar
9a5fea8ef3 video: driver: Add support to enable enc ring buffer
Add support to enable ring buffer for enc intermediate
bin buffer to improve encoding performance.

Change-Id: Ifbf50cb48278c62c09a20bc7626a3b6288813830
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2023-03-07 17:14:30 -08:00
Akshata Sahukar
fb2e2c5715 video: driver: Align hfi files to pick ring buffer changes
Align hfi property and memory file to pick interface changes
for encoder ring buffer support

Change-Id: Icde4cdffe5275d416c51c36e562bb832027b0fa1
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2023-03-07 17:13:09 -08:00
Darshana Patil
552670ad6b video: driver: encoder delay start: CSC
Introduce a control for client to enable or disable
csc. Disable csc for 10-bit encoding based on color format.

Change-Id: Ia49324332ce9b05b6f1a1283fa758638a8cc3ab8
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2023-03-07 15:12:53 -08:00
qctecmdr
5dcf0adb92 Merge "video: driver: move DPB_TAG_LIST to input meta port" 2023-03-07 13:42:19 -08:00
Zhongbo Shi
33ec7e400e video: driver: move DPB_TAG_LIST to input meta port
1. Move DPB_TAG_LIST from ouput meta port to
input meta port;
2. Remove meta_max_reorder_num_frame;

Change-Id: I1783ee9cdb1092f90706dc485d247c51f36a9a65
Signed-off-by: Zhongbo Shi <quic_zhongbos@quicinc.com>
2023-03-06 23:26:00 -08:00
Zhongbo Shi
133bfb56ea video: driver: move DPB_LIST to input port
1. Move DPB_LIST subscription on input
port instead of output port.

2. Move decoder port PSC and properties
to platform data.

Change-Id: I5711e0ba915ebe4136f64d1440ae331b787f4d61
Signed-off-by: Zhongbo Shi <quic_zhongbos@quicinc.com>
2023-03-07 15:23:23 +08:00
qctecmdr
56057e9964 Merge "video: driver: Take avg bitrate for clk scaling" 2023-03-06 20:16:33 -08:00
Akshata Sahukar
2b974f7ad0 video: driver: Align hfi files to pick synx fence changes
Align hfi property and registers file with to pick synx fence
related interface changes

Change-Id: I19e5cce4d67f2f1eeacf917f9e688d2bb20f6585
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2023-03-03 16:59:49 -08:00
qctecmdr
c8feb57898 Merge "video: driver: handle uninitialized variables in open" 2023-03-03 10:14:49 -08:00
qctecmdr
8cf45cdbc1 Merge "video: driver: resolve skip unmap in system error cases" 2023-03-03 10:14:49 -08:00
Govindaraj Rajagopal
db80783d41 video: driver: handle uninitialized variables in open
In msm_vidc_open() create_singlethread_workqueue() is failing,
so msm_vidc_close() is called and i.e attempting to de-initialize
some uninitialized structures and resulting into stability issues.

So handle msm_vidc_open() failure with in same api, instead of
calling msm_vidc_close() and re-organize deinit sequence.

Change-Id: I843cf07eaf18f4ea764842fd1c87b78d115580d3
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2023-03-03 16:47:01 +05:30
Ankush Mitra
f90831dc93 video: driver: Take avg bitrate for clk scaling
In case of decode batch IDR frame can impact
the bitrate based clk scaling.
To tackle this use avg filled len in case
of decode batching.

Change-Id: I1b2701857118bfa1f1a4fd0c0498ee016c02e8d5
Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
2023-03-03 16:09:35 +05:30
qctecmdr
936f37d8ba Merge "video: driver: Move adjust/set control_ext API's to common/platform_ext.h/.c" 2023-03-01 16:35:56 -08:00
Maheshwar Ajja
28c761d7bf video: driver: resolve skip unmap in system error cases
If there is any system error from firmware then driver will
remove instance from core->instances.list.
msm_vb2_detach(unmap)_dmabuf() returning failure because
get_inst_ref() returning NULL as the instance was removed from
in core->instances.list, but instance is still alive and buffers
can still be detached(unmapped). Skipping detach(unmap)
buffers resulting in below warning when the buffer's final
dma reference is removed by v4l2 framework (dma_buf_put(fd))
after msm_vb2_detach(unmap)_dmabuf() functions.

msm_dma_buf_freed: DMA buffer ffffff8884ebe600 destroyed with
                   outstanding iommu mappings
Call trace:
    msm_dma_buf_freed+0x130/0x334 [msm_dma_iommu_mapping]
    qcom_sg_release+0x30/0x50 [qcom_dma_heaps]
    dma_buf_release+0x48/0xa8
    __dentry_kill+0x178/0x268
    dentry_kill+0xc4/0x110
    dput+0xa4/0x110
    __fput+0x170/0x260
    ____fput+0x18/0x28
    task_work_run+0xc0/0xe8

Eventually when client closed the session, driver will try to
cleanup the missing buffers and hence driver calls unmap buffers
which is resulting in below list_del corruption issue as dma_buf
including sg_list was already removed for it

msm_dma_unmap_sg_attrs: (ffffff8916a92c00) was never mapped
WARNING: CPU: 2 PID: 2258 at drivers/iommu/msm_dma_iommu_mapping.c:377
         msm_dma_unmap_sg_attrs+0x9c/0x1e4 [msm_dma_iommu_mapping]
Call trace:
    msm_dma_unmap_sg_attrs+0x9c/0x1e4 [msm_dma_iommu_mapping]
    qcom_sg_unmap_dma_buf+0xc0/0xf0 [qcom_dma_heaps]
    dma_buf_unmap_attachment+0x48/0xa0
    msm_vidc_dma_buf_unmap_attachment+0x2c/0x80 [msm_video]
    msm_vidc_destroy_buffers+0x510/0xb74 [msm_video]
    put_inst+0x158/0x3fc [msm_video]
    msm_vidc_close+0xe4/0x16c [msm_video]
    v4l2_release+0x7c/0x108
    __fput+0xe4/0x260
    ____fput+0x18/0x28
    task_work_run+0xc0/0xe8

list_del corruption. prev->next should be ffffff8891db3c90,
          but was ffffff8916a92c10. (prev=ffffff8916a92c10)

As we know instance will always be alive in
msm_vb2_detach(unmap)_dmabuf() function, we can safely
remove get_inst_ref() to avoid skipping detach(unmap)
calls to avoid list_del corruption issues.

Change-Id: If292a39ab1cde17da3cbb634370b6ff6692e496a
Signed-off-by: Maheshwar Ajja <quic_majja@quicinc.com>
2023-02-28 23:37:39 -08:00
Vedang Nagar
17bc01b78f video: driver: Move clk/qcom.h to external reseource file
Move qcom.h header file from resources.h to resources_ext file.

Change-Id: I81735461f093fe724a51d66538be1cc562fc0e24
Signed-off-by: Vedang Nagar <quic_vnagar@quicinc.com>
2023-02-26 22:26:16 +05:30
qctecmdr
a7db37426e Merge "video: driver: Add new hfi buffer flags" 2023-02-24 21:15:31 -08:00
Megha Byahatti
4a578d26fd video: driver: Move adjust/set control_ext API's to common/platform_ext.h/.c
Remove msm_vidc_control_ext.h/.c

Change-Id: I5636705b38b7c5613baf8761953ae31963e6ffd3
Signed-off-by: Megha Byahatti <quic_mbyahatt@quicinc.com>
2023-02-24 15:37:21 +05:30
Ashish Patil
e28d357256 video: driver: lanai power calculations
New bandwidth and frequency calculation functions
for lanai.

Change-Id: I0ec4a74bc24598628fe94a6ebbe9df5e3cb71a9c
Signed-off-by: Ashish Patil <quic_ashpat@quicinc.com>
2023-02-23 18:29:45 -08:00
qctecmdr
95eccc81e8 Merge "video: driver: add stop cmd allow checks inside state handler" 2023-02-23 18:24:11 -08:00
Chinmay Sawarkar
ed46ad9aec video: driver: Add new hfi buffer flags
New hfi buffer flags to send memory region information to firmware.

Change-Id: I3a320622d0ed01a5e583dbeceb2648a57f618a66
Signed-off-by: Chinmay Sawarkar <quic_chinmays@quicinc.com>
2023-02-23 12:01:25 -08:00
qctecmdr
8df204443f Merge "video: driver: remove config dependencies" 2023-02-23 08:10:06 -08:00
qctecmdr
e613fa6855 Merge "video: driver: set PM_SUSPEND in power collapsed state" 2023-02-22 18:33:42 -08:00
qctecmdr
37f24ba2cc Merge "video: driver: Revise encoder port configs" 2023-02-22 13:29:31 -08:00
Govindaraj Rajagopal
ab6770c11f video: driver: add stop cmd allow checks inside state handler
use state specific checks inside state_handler instead of
relying global msm_vidc_allow_stop function.

Change-Id: I83d81aa0f840412a4c61f15673a6246f0f84be7f
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2023-02-22 21:05:18 +05:30
Govindaraj Rajagopal
a6e521d629 video: driver: add start cmd allow checks inside state handler
use state specific checks inside state_handler instead of
relying global msm_vidc_allow_start function.

Change-Id: I04182ee3b63fa9044acf4f40adc47ea97eaa7538
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2023-02-22 20:52:07 +05:30
Govindaraj Rajagopal
4afdecc4fd video: driver: add streamon allow checks inside state handler
use state specific checks inside state_handler instead of
relying global msm_vidc_allow_streamon function.

Change-Id: I67948831612ebb33cdd12a2e9f8561b6095e9433
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2023-02-22 20:03:52 +05:30
Govindaraj Rajagopal
3ba2cb9ed1 video: driver: add reqbuf allow checks inside state handler
use state specific checks inside state_handler instead of
relying global msm_vidc_allow_reqbufs function.

Change-Id: Iaf7f23e4e2ef9b714e3d4c2900c2753d74150fd1
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2023-02-22 20:01:03 +05:30