Commit Graph

1056 Commits

Author SHA1 Message Date
qctecmdr
7313e91c52 Merge "video: driver: misc changes to be inline with upstream" 2022-11-09 21:54:22 -08:00
qctecmdr
b33fc5110e Merge "video: driver: fix compilation issues with mainline kernel" 2022-11-09 21:54:22 -08:00
qctecmdr
643d2e2304 Merge "video: driver: Increase FW timeout to 4sec for debug logging" 2022-11-09 21:54:22 -08:00
Deepa Guthyappa Madivalara
9db29e4eda video: driver: add assert and deassert reset functions
- Add assert and deassert reset control functions to
  update power off sequence in pineapple chipset
- Rename clock names to match with clock macros

Change-Id: Ic6dc0daac8110597bfcb02cceba94d2b97548723
Signed-off-by: Maheshwar Ajja <quic_majja@quicinc.com>
2022-11-07 18:31:55 -08:00
Deepa Guthyappa Madivalara
9a591ca5af video: driver: update definition same as prototype
Update function definition to be same as prototype to
avoid compile error

Change-Id: I92be0d96ce1e95e858cca6e5cad8de0564a60e5b
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2022-11-07 14:32:28 -08:00
Ankush Mitra
b35fde25c4 Video Driver: fix frame freeze for HEVC 10bit all intra decoding
1. Allow turbo for HEVC 10bit all intra decoding;
2. Add 25 percent extra to VSP cycle for HEVC
   10bit all intra decoding;

Change-Id: I794b2a896f7e9444c8979abdb15b8e673a5270ee
Signed-off-by: Zhongbo Shi <quic_zhongbos@quicinc.com>
Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
2022-11-07 09:01:17 -08:00
Ankush Mitra
dc39a04e6e video: driver: follow vcodec power collapse seq for PC failure case
if PC fails for 10 times then video driver is treating that situation
as fatal and doing force core_deinit(), in this case firmware will not
follow vcodec power_collapse sequence and if there any pending
transaction from any session it will cause smmu_fault during next
firmware_boot sequence. Added change to perform vcodec power_collapse
from power_off_iris3_hardware() incase of core_deinit due to PC failure.

Change-Id: I45e32985d87b5cc882c4f96f77d1cabc796e6ba0
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
2022-11-07 07:59:33 -08:00
Ankush Mitra
78246c24fb video: driver: Enable CSD data in output meta data buffer
Currently not enabling CSD data in output meta data buffer,
due to invalid function invocation for conditional check.

Change-Id: I96a4462abebb257bfcd91af9c725d577c4046feb
Signed-off-by: Gaviraju Doddabettahalli Bettegowda <quic_gdoddabe@quicinc.com>
Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
2022-11-07 07:48:29 -08:00
Ankush Mitra
c1bb733a6b video: driver: Remove unused capabilities
Cleanup of unused capabilities from
platform caps list.

Change-Id: I98f4beb96f41d2b8a3b4342f7d453a6abc046e55
Signed-off-by: Vedang Nagar <quic_vnagar@quicinc.com>
Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
2022-11-07 21:08:52 +05:30
Govindaraj Rajagopal
1931acf675 video: driver: misc changes to be inline with upstream
- replace list_del() & list_add_tail() with list_move_tail().
- use sg_dma_address() macro at all possible places.

Change-Id: Ie754b5a75a48299fbe71e9ec0217b93d8524264f
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-11-07 20:16:43 +05:30
Govindaraj Rajagopal
9c5b7fe1c5 video: driver: power collapse for last session close
power_collpase thread will initiate suspend sequence
if no there is no transaction for 1.5 sec. So even
after all session closed, power collapse thread will
kick in only after 1.5 sec, which can be avoided.

with this change power_collpase sequence will be
initiated right after last session close.

Change-Id: I4da231fa4a3d65bebbd19725db2f11d1478490dd
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-11-07 18:24:36 +05:30
Dikshita Agarwal
1ac85a3237 video: driver: check for regulator support before initializing
Upstream doesn't support regulators, while downstream kernel does.
So add a condition to check for regulator support before init.

Change-Id: Icab8aec20796546a33ac571963f871d146970002
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-11-07 16:51:12 +05:30
Dikshita Agarwal
166330d8a9 video: driver: fix compilation issues with mainline kernel
- Remove non-standard and unused header files.
- Use proper format specifier for debug prints.

Change-Id: I52927f635d7d0145404e41acf0dc351f2c44e7fe
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-11-04 14:55:40 +05:30
Vedang Nagar
bf9dd01f97 video: driver: Increase FW timeout to 4sec for debug logging
Enabling debug logs in kernel driver can result in Linux
kernel thread scheduling issues which causes unpredictable
behavior. Therefore increased Hardware timeouts to 4sec
if debug logs are enabled i.e. logs are more than default
logs.

Change-Id: Ic0d04bc0a740c8b11c77574ad3252ca2fa0696bb
Signed-off-by: Vedang Nagar <quic_vnagar@quicinc.com>
2022-10-28 08:46:12 -07:00
Ankush Mitra
6b0dcb4a4f video: driver: code re-structure memory ops support
Re-structure the memory_ops code so that
upstream driver use mem_ops defined on
msm_vidc_memory.c and downstream driver
use mem_ops defined on msm_vidc_memory_ext.c.
It helps to modularize the code even further.

Change-Id: Id00b0872d7a902a8540500df5efb5f546a9dbe41
Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
2022-10-28 00:06:28 +05:30
Darshana Patil
4250372925 video: driver: add memory ops support
add memory ops support so that different
implementations can exist for memory_alloc,
memory_free, memory_map and memory_unmap,
dma buf attach, detach, map, unmap and
get buffer region in upstream and downstream
drivers.

Change-Id: Ifabc34e7a8b0284579c1bc4a8f477fe558d068f4
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-10-21 16:35:22 -07:00
qctecmdr
02ed467c8a Merge "video: driver: remove unused files" 2022-10-21 12:28:34 -07:00
qctecmdr
3ff4a9b78e Merge "video: driver: remove skip delayed unmap functionality" 2022-10-21 10:31:53 -07:00
qctecmdr
ea09956891 Merge "video: driver: Always Set COMV bufcount to FW" 2022-10-21 10:31:52 -07:00
Darshana Patil
3362c70642 video: driver: remove skip delayed unmap functionality
Change-Id: Ibc3e8d565010aa5ac608aa648c533057c51f4bf4
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-10-20 12:08:03 -07:00
Govindaraj Rajagopal
0e56253be6 video: driver: remove unused files
msm_vidc_dt functionalities were distributed to
other files and most of the dt parsing code was
removed already. So added change to cleanup
unused files.

Change-Id: I3362c6cfa3f493b965167b9aeb0f5cf3ac8c2711
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-10-20 15:45:42 +05:30
Govindaraj Rajagopal
3560442234 video: driver: add resource ops macro support
Added call_res_op() macro and used at all possible
places to avoid invalid pointer dereference issue.

Also added changes to cleanup unused functions.

Change-Id: Id77711ad9eaf7b407208567b0fde1f2693588641
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-10-20 12:18:25 +05:30
Govindaraj Rajagopal
ca9cc59d28 video: driver: add additional platform_data support
Add additional platform_data support for waipio,
pineapple, kalama, anorak targets.

Change-Id: I2def953c88eb4ba41de270bf208da112d4e547bf
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-10-18 00:13:22 +05:30
Govindaraj Rajagopal
21eb38981e video: driver: reduce device_tree dependency for video
Only keep minimal entries in dtsi, which is essential for
other drivers usage. Move remaining all data into platform
resource file.

Remove device_tree dependency and maintain platform_data
to initialize resources like regulators, interconnects,
clocks, reset_clocks, subcaches and context_banks.

Read static data like freq_table, firmware_name, pas_id
also from platform_data instead of from dtsi.

Change-Id: I73a1df10b92c55e55b23e538aea62598a7250ab4
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-10-18 00:10:19 +05:30
qctecmdr
c7b90ad604 Merge "video: driver: Handle mem corruption while parsing dpb list prop" 2022-10-10 23:01:41 -07:00
qctecmdr
756d3edfcc Merge "video: driver: fix compilation issue with format specifier" 2022-10-10 23:01:41 -07:00
qctecmdr
8b501d3034 Merge "video: driver: remove non-standard header file of_common.h" 2022-10-10 23:01:41 -07:00
Vedang Nagar
efa48a607a video: driver: Handle mem corruption while parsing dpb list prop
While parsing dpb_list_property packet, memcpy happens from
hfi_packet to inst->dpb_list_payload which is being allocated
with max size of 256 Bytes. If dpb_list_prop packet size is
greater than 256Bytes, then driver will change the state to
ERROR state but still memcpy will happen shich will read
and write memory greater than allocated hence corrupting
the memory. Added fix by returning error.

Change-Id: I81617c88c68194fbd442059c63fa702d1e839478
Signed-off-by: Vedang Nagar <quic_vnagar@quicinc.com>
2022-10-07 23:28:58 -07:00
Dikshita Agarwal
4a24729ad9 video: driver: fix compilation issue with format specifier
Fix compilation issues due to wrong format specifiers being
used for printing device address.

Change-Id: Ic8ee8e9cdb563ea3efea9fa2e713befad74447cb
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-10-07 16:05:55 +05:30
qctecmdr
6bf23cf65c Merge "video: driver: release buffer fix" 2022-10-06 16:43:43 -07:00
Darshana Patil
1245e16555 Revert "video: driver: remove usage of DMA_ATTR_DELAYED_UNMAP"
This reverts commit fbd52e8f19.

DMA_ATTR_DELAYED_UNMAP attribute is required to have dma driver
maintain one map reference if we have client recycling more than
VIDEO_MAX_FRAME(32) buffers.

Change-Id: I7005f874e387ce111082821c2af2226417766622
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-10-06 14:14:23 -07:00
Darshana Patil
a99d47f6a3 video: driver: release buffer fix
when a buffer is asked for release and if the same buffer
is queued again before release done is received, then
second time the FTB should be queued without RO flag

Change-Id: I11c4494471129c5bb3ff4401ccfbd25c702c699d
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-10-06 13:11:51 -07:00
qctecmdr
a29437458a Merge "video: driver: enable best fit algo" 2022-10-05 09:30:56 -07:00
Darshana Patil
fbd52e8f19 video: driver: remove usage of DMA_ATTR_DELAYED_UNMAP
Change-Id: I8757a89c4c645059ac343b4147bf3c44c3ebe91b
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-10-04 11:05:55 -07:00
Darshana Patil
5b4ced6c7b video: driver: enable best fit algo
Change-Id: If13536330b0a7c3c37768dc85d9198c3e1e9630d
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-10-04 11:04:49 -07:00
Dikshita Agarwal
4c09a936f9 video: driver: include mmrm headers if CONFIG_MSM_MMRM enabled
Include mmrm headers if CONFIG_MSM_MMRM enabled.

Change-Id: I1841125b7584e562b67b0fa7f6d464bfbc7ed267
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-09-30 13:46:23 +05:30
Darshana Patil
1ef323df29 video: driver: buffer flow changes
When client queued a buffer, v4l2 framework
compares the client Dmabuf with the existing
dmabuf in the bufs array at the same index.
If the dmabuf is different then v4l2 framework
would call unmap_dmabuf, detach_dmabuf callbacks
for the old buffer and then calls attach_dmabuf,
map_dmabuf callbacks for the new buffer before
qbuf callback is made to driver. If the dmabuf
is same then qbuf callback will be made directly.

V4l2 framework expects that clients recycles the
same buffers in the same indices so that when
v4l2 framework compares dmabuf it won't unmap
or map buffers.

If client recycle the buffers in different indices
still usecase works but there will be unnecessary
unmap, map overhead will be incurred.

If client does not recycle the buffers at all,
meaning every time client queues new buffers
then special handling is required for decoder
output buffers which are used for reference by
video hardware.If any buffers are used by video
hardware as reference buffers then firmware returns
those buffers with READ_ONLY flag and they are kept
in read_only list and when read_only grows beyond
some limit then driver would ask firmware to release
those READ_ONLY buffers and when firmware responds
driver would delete these READ_ONLY buffers.

Change-Id: I8a0b11c986dd0b9464895498efd8c1831a754198
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-09-26 17:24:30 -07:00
Mihir Ganu
7dd8b6d186 video: driver: Always Set COMV bufcount to FW
Always set COMV bufcount to FW, even if COMV buffer can be
reused. Otherwise, there may be a mismatch in COM bufcount
between host and firmware.

Change-Id: I10d54818a4478e8b0a9e9577c6c8684ad52f5de8
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2022-09-23 16:16:08 -07:00
qctecmdr
08b36416ce Merge "video: driver: modify slice delivery control as boolean control" 2022-09-22 17:43:50 -07:00
qctecmdr
8244c81132 Merge "video: driver: remove input meta via request support" 2022-09-22 17:43:50 -07:00
qctecmdr
786981d774 Merge "video: driver: fix AV1D fence timing failures during flush sequence" 2022-09-21 09:54:45 -07:00
Akshata Sahukar
85d79a7a23 video: driver: remove input meta via request support
remove input meta via request support

Change-Id: If2a504455e1899c4cefb2a9142f7a92db02a45f2
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-09-20 11:07:39 -07:00
Deepa Guthyappa Madivalara
a6337c1460 video: driver: update platform_get_resource to platform_get_irq
Use platform_get_irq api instead of platform_get_resource for Lanai

Change-Id: Ia06e7d5c890f6c7344b53a9f15c0b68b26bcc53e
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2022-09-19 18:24:32 -07:00
Akshata Sahukar
7818456489 video: driver: fix AV1D fence timing failures during flush sequence
Flushed out buffers by driver retain filled length field same
as it was while queued to driver. This is incorrect as it
gives an impression to the client that some data has been
written by driver/firmware. Hence, reset this to 0 while
dequeuing to fix the issue.

Change-Id: Ia2bb86a3462255991d45a1f77cab39a4a0eafd23
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-09-16 12:59:36 -07:00
qctecmdr
b48e799508 Merge "video: driver: Introduce SUPPORTS_REQUESTS cap" 2022-09-16 10:47:04 -07:00
Akshata Sahukar
b1dfbad4a4 video: driver: Introduce SUPPORTS_REQUESTS cap
Introduce SUPPORTS_REQUESTS cap to have different caps support
for upstream and downstream driver.

Change-Id: Ib8bae21ba3fa6d65236954e0728fa30e20d7b375
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-09-13 14:29:18 -07:00
Dikshita Agarwal
9b32ff0498 video: driver: modify slice delivery control as boolean control
Update definition of slice delivery control in v4l2_vidc_extensions.h
to make it a boolean control instead of menu control and use it
accordingly.

Change-Id: I8ad5f5b7088bc01b78560cb40eae7c7d677ce7ce
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-09-12 14:11:16 +05:30
Ashish Patil
03606a7c77 video-driver: dma_buf_vmap() usage changes
Earlier Kernel Version were using struct dma_buf_map 
and latest Kernel using struct iosys_map and 
MODULE_IMPORT_NS(DMA_BUF) to import dma buf namespace

Change-Id: Ida6535fb2e3426b10264efe01e3a343fd3a1e127
Signed-off-by: Ashish Patil <quic_ashpat@quicinc.com>
2022-09-09 15:52:12 -07:00
qctecmdr
e072a88b28 Merge "video: driver: Introduce CAP_FLAG_META flag for metadata caps" 2022-09-08 18:36:14 -07:00
Akshata Sahukar
6b5c62db0c video: driver: Introduce DEVICE_CAPS cap in core database
Introduce DEVICE_CAPS capability to have different caps support
for upstream and downstream driver.

Change-Id: Ife73ab8c3b6ef9b47ef844883d9fa18e469d9188
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-09-08 16:02:13 -07:00