Commit Graph

1192 Commits

Author SHA1 Message Date
qctecmdr
99d3bd665c Merge "msm: vidc: enable DCVS for non realtime sessions" 2023-02-09 17:47:32 -08:00
qctecmdr
a7d368d03f Merge "video: driver: fix video node open before probe issue" 2023-02-09 17:47:32 -08:00
qctecmdr
ce5183ff21 Merge "video: driver: fix incorrect initialization of dmabuf" 2023-02-09 17:47:32 -08:00
qctecmdr
f251ef996d Merge "video: platform: taro: add default frame/operating rate" 2023-02-08 11:51:54 -08:00
Dikshita Agarwal
5cd85bc93c video: platform: taro: add default frame/operating rate
Add default values for frame rate and operating rate for
decoder.

Change-Id: I0c9ed12fafd4655043bc408d7cee976278412a8f
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2023-02-08 16:54:23 +05:30
Darshana Patil
f123b6eece video: driver: fix incorrect initialization of dmabuf
Reinitialize dmabuf pointer to NULL only after
dma_buf_put has been called on that buffer.

Change-Id: I05e8c1d0901438bc39a9bf9faeed11e228cd7675
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2023-02-07 12:07:33 -08:00
qctecmdr
ff5f9d8998 Merge "video: driver: state handling code movement" 2023-02-07 11:22:13 -08:00
Darshana Patil
ed80204a9e video: driver: add support to configure colorinfo via control
- introduce control to set colorspace. client will use this
  to set private color info.

Change-Id: I0099ef1525f4562d3be3a6e518d046fe5b9ef894
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2023-02-06 13:09:17 -08:00
qctecmdr
49f99eba76 Merge "video: driver: resolve subsystem restart failure" 2023-02-06 10:11:50 -08:00
Dikshita Agarwal
a4d2b2d178 video: driver: remove dynamic layers and bitrates support for taro
Remove support for dynamic layers and bitrates for taro similar
to other platforms.

Change-Id: Ic316d9d566507ae924cff7a1ded10bcdd1f115e4
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2023-02-06 17:37:01 +05:30
Manikanta Kanamarlapudi
454e91b014 msm: vidc: enable DCVS for non realtime sessions
- enable dcvs for non-realtime sessions (both encode/decode)
- enable input queuing rate power scaling for non-realtime encoder

Change-Id: Ie0fe2723837dbfc1cb63b693fc657f2d8df7c573
Signed-off-by: Manikanta Kanamarlapudi <quic_kmanikan@quicinc.com>
2023-02-06 10:06:54 +05:30
Govindaraj Rajagopal
e318864d75 video: driver: fix video node open before probe issue
[1] In upstream side, udev is attampting to open video
nodes(video32 & video33) immediately after creation.
But by that time probe might not completed and i.e
resulting to NULL ptr dereference during open() call.

[2] component_match_add_release() must be called only
for video subdevices(contextbanks), but due to OPP table
more entries getting added into component_match table.
So master device bind is never getting invoked and probe
sequence is never getting completed.

Uploaded change to address above mentioned issuses.

Change-Id: I8d2e8fb5644da7076f5f99feda9365629e9130fd
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2023-02-03 21:03:59 +05:30
tkashyap
faf2b173fe video: driver: disable devm_pm_opp_attach_genpd
Change-Id: Id09b49b3ff2b7b1c960314776dd91360913482d8
Signed-off-by: Tanya Kashyap <quic_tkashyap@quicinc.com>
2023-02-01 16:30:06 -08:00
Ankush Mitra
f1771aae41 video: driver: resolve subsystem restart failure
Allow streamoff from msm_vidc_vb2_queue_deinit after
errors to flush out the pending buffer in driver
in order to avoid v4l2 framework printing below warning.

videobuf2_common: driver bug: stop_streaming operation
is leaving buf in active state.

Call trace
__vb2_queue_cancel+0x214/0x288
vb2_core_queue_release+0x28/0x5c
vb2_queue_release+0x18/0x28
msm_vidc_vb2_queue_deinit+0x40/0x118 [msm_video]
msm_vidc_close+0x7c/0x144 [msm_video]
msm_v4l2_close+0x44/0x164 [msm_video]

There is a deadlock if driver acquires inst lock
in msm_vb2_stop_streaming, because this function
will be called from msm_vidc_close which already
acquired the inst lock. Hence, acquire inst lock
in msm_v4l2_stramoff instead of msm_vb2_stop_streaming.

Change-Id: Iec4c0e416a8a2705af28dbd5138f25d9f3016d12
Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
2023-02-01 12:18:42 +05:30
Govindaraj Rajagopal
c175e36454 video: driver: state handling code movement
state handling changes were spread across multiple files.
So re-arrange all state related handling changes into
msm_vidc_state.h/.c file.

Change-Id: I3826daa678d1e2b5ce7e74380d465e70b1b824c6
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2023-01-30 10:57:22 +05:30
qctecmdr
0884f5a04a Merge "video: driver: restructure video state machine" 2023-01-28 00:56:41 -08:00
qctecmdr
54c8d7570d Merge "video: driver: add power domain and opp table support for video" 2023-01-28 00:56:41 -08:00
qctecmdr
f71e472d68 Merge "video: driver:remove support for dynamic layers and bitrates" 2023-01-27 11:25:17 -08:00
qctecmdr
fd07f2cafd Merge "video: driver: fix array out of bounds exception" 2023-01-27 11:25:16 -08:00
Govindaraj Rajagopal
7c365bdb94 video: driver: restructure video state machine
Re-structure video driver statemachine to use
event handler. Added event handler support for
event states.

Added change to handle event depending on the
underlying state implementation.

Change-Id: Ib55c12c6cadc4d780797a5aee75d5ea61e95c94f
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2023-01-27 16:31:23 +05:30
Snehal Bhamare
a8dce0e07e video: driver: fix array out of bounds exception
Check array bounds before writing to array to resolve
array bounds exceeded issue.

Change-Id: If3bf593b7126b2e4d567d35dc08e4598e80900fe
Signed-off-by: Snehal Bhamare <quic_sbhamare@quicinc.com>
2023-01-24 15:26:08 -08:00
Darshana Patil
68df0645ec video: driver: add support to send aon region via HFI_MMAP_ADDR
- add support to intialise device region by reading data from
  platform to resources.
- add support for iommu_map and iommu_unmap apis.
- allocate a 4K page and send this address through
  HFI_MMAP_ADDR register.
- map AON region, send virtual address and size as payload.

Change-Id: I5aa26593309a220c5de62836e432c1bd5a63ba1d
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2023-01-20 10:49:32 -08:00
Ashish Patil
bf33925fa3 video: driver:remove support for dynamic layers and bitrates
- remove support of dynamic layer change for CBR
 - remove support of layerwise bitrate
 - any dynamic layer change request ignored without error for CBR_*FR cases
 - layerwise bitrate is mapped to cumulative bitrate

Change-Id: I96c70fabd3c2bf94ce989b9e94620c166892b8e6
Signed-off-by: Ashish Patil <quic_ashpat@quicinc.com>
2023-01-19 09:07:22 -08:00
qctecmdr
576e231f23 Merge "video: driver: Update non_comv_h265e buffer size" 2023-01-18 13:36:09 -08:00
qctecmdr
954b0ff6f5 Merge "video: driver: add support for pineapple V2 devices" 2023-01-18 13:36:08 -08:00
qctecmdr
60fee2a157 Merge "msm: vidc: Increase min o/p buffer count for AV1" 2023-01-18 13:36:08 -08:00
qctecmdr
9f3da9e6d4 Merge "video: driver: introduce macros from hfi_registers.h" 2023-01-18 13:36:08 -08:00
qctecmdr
db62f9374a Merge "video: driver: Modify buffer_stats logic" 2023-01-18 13:36:08 -08:00
Govindaraj Rajagopal
ab9b1a112b video: driver: add power domain and opp table support for video
Added changes to support generic power domain and opp table.
This is an alternative for downstream regulator framework.

power domain can be enabled using below dtsi entries.

power-domains =
    <&videocc MVS0C_GDSC>,
	<&videocc MVS0_GDSC>,
	<&rpmhpd SM8450_MXC>,
	<&rpmhpd SM8450_MMCX>
power-domain-names =
    "iris-ctl", "vcodec", "mx", "mmcx";

Power domain handles willbe parsed at driver side using below api's.
   - dev_pm_domain_attach_by_name()
   - devm_pm_opp_attach_genpd()

devm_pm_opp_attach_genpd() provides consumer virtual device handles
and i.e linked to core->dev using device_link_add().

MXC, MMCX rails wilbe powered up by scaling desired rate using
dev_pm_opp_set_rate().

Change-Id: I3d73434cb772078f031aec7cadc2d42ab930edd0
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2023-01-18 16:44:23 +05:30
Maheshwar Ajja
f150010edb video: driver: use reset control api with kernel version 6
Use reset control acquire/release api's with kernel version >= 6
as they were not exposed in previous kernels.

Change-Id: I2968fc50d77948c7f1a6f55be31360ad03971415
Signed-off-by: Maheshwar Ajja <quic_majja@quicinc.com>
2023-01-17 11:50:14 -08:00
Deepa Guthyappa Madivalara
d8f253e2c0 video: driver: add support for pineapple V2 devices
Adding support for pineapple V2 devices

Change-Id: I9088895ff92ca34ee3b46bd99e0d068b478e083d
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2023-01-13 16:40:26 -08:00
Chinmay Sawarkar
7ea481092e video: driver: Update non_comv_h265e buffer size
HFI_BUFFER_NON_COMV_H265E updated to incorporate
multi-tile single slice change.

Change-Id: Ia1f48cc1680a411b107c1ee95377d493cb682739
Signed-off-by: Chinmay Sawarkar <quic_chinmays@quicinc.com>
2023-01-13 16:25:44 -08:00
Darshana Patil
ea34534af0 video: driver: update copyright markings to 2023
update copyright markings to 2023 in all files.

Change-Id: I6842d56c4a8fff6a7a93d0c1d4bc049041297b02
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2023-01-13 14:58:17 -08:00
Darshana Patil
cfe3869048 video: driver: introduce macros from hfi_registers.h
Introduce macros defined in hfi_registers.h interface file
and cleanup unused macros.

Change-Id: Icf05f2ca2fb69556a1c8d076c87af687fd98ed87
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2023-01-12 11:28:44 -08:00
qctecmdr
a83f8b5c38 Merge "video: driver: Enable power collapse" 2023-01-12 09:50:35 -08:00
qctecmdr
bc0e8274bf Merge "video: driver: add clock residency calculation support" 2023-01-06 10:25:30 -08:00
Mihir Ganu
88612676b6 video: driver: Enable power collapse
Enable software power collapse.

Change-Id: Ie542587465a1688e7bd0a7669b93b64620b2e356
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2023-01-05 10:39:34 -08:00
Darshana Patil
a0082a4c81 video: driver: amend xo reset clock as shared resource
Use devm_reset_control_get_exclusive_released() instead of
devm_reset_control_get() to get the reset control of video_xo_reset
clock as it is shared reset clock between eva and video drivers.
Use reset_control_acquire() before assert and reset_control_release()
after de-assert video_xo_reset clock to avoid eva driver operating on
it in parallel.

Change-Id: I4936ed7a4556bb56d4b28546084fc877080308ef
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2023-01-05 09:58:30 -08:00
Megha Byahatti
1ce3863b21 video: driver: add database file for upstream taro
Add database file for taro prepared based on upstream.
This file won't be compiled for Android builds.

Change-Id: I6804654b0574f4cc42d90278e4a022482c27ce99
Signed-off-by: Megha Byahatti <quic_mbyahatt@quicinc.com>
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2023-01-04 00:07:33 +05:30
Govindaraj Rajagopal
e15f3afabd video: driver: add clock residency calculation support
Add logic to derive clock residency values for each
frequency levels.

Change-Id: Iadad29d2733cb083fce627999a31dd96475b73c1
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-12-30 23:42:16 +05:30
qctecmdr
4f297753f7 Merge "video: driver: implement memory_ops for upstream" 2022-12-27 10:58:45 -08:00
qctecmdr
d52a0b7f71 Merge "video: driver: Use iommu.h instead of dma-iommu.h" 2022-12-22 11:18:57 -08:00
qctecmdr
9b51939152 Merge "video: driver: set force mem and pheripheral on flags" 2022-12-22 11:18:57 -08:00
qctecmdr
2d442bba69 Merge "video: iris33: ensure AON spare register to become zero" 2022-12-22 11:18:56 -08:00
qctecmdr
075e5e2eab Merge "video: driver: refine core state machine" 2022-12-22 11:18:56 -08:00
tkashyap
bbcd8f6db3 video: driver: Use iommu.h instead of dma-iommu.h
Change-Id: If8e6e192e3320c36484e8348f3cb4215618867fb
2022-12-21 16:19:14 -08:00
Manikanta Kanamarlapudi
4f8d8b7f33 msm: vidc: Increase min o/p buffer count for AV1
Increase minumim output buffer count from 9 to 11
for AV1 decoder.

Change-Id: I22c7d03c5ed0e3eba159c9009f4e313fe7b4b5cb
Signed-off-by: Manikanta Kanamarlapudi <quic_kmanikan@quicinc.com>
2022-12-21 16:07:33 +05:30
Ankush Mitra
9e8ced68f3 video: driver: Pineapple CAP Database fix
Fix the issue in pineapple CAP Database for
SLICE_DECODE.

Change-Id: I1b4dc51bbb23634aa372eba35b18ca9b6caada2d
Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
2022-12-21 12:57:04 +05:30
Maheshwar Ajja
4716d7bc72 video: driver: set force mem and pheripheral on flags
Set mvs0c clock flags (force mem and pheripheral on).

Change-Id: I52380a30a4c74d9658f989377b5c77209cd8a33e
Signed-off-by: Maheshwar Ajja <quic_majja@quicinc.com>
2022-12-19 14:58:23 -08:00
Dikshita Agarwal
d7e518a85c video: driver: implement memory_ops for upstream
- Implement upstream specific memory_alloc/map and
  memory_unmap/free API based on standard dma_alloc_attr()
  and dma_free_attr() APIs which allocates and map dma buffer.
- Combine alloc and map, unmap and free.

Change-Id: Ie85914beb72c3976febdc9e6a11c9199f2ea4192
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-12-15 11:23:20 +05:30