Commit Graph

259 次程式碼提交

作者 SHA1 備註 提交日期
Akshata Sahukar
907ea75504 video: driver: Add support to enable output tx sw fence by default
As part of default enablement of output tx type sw fence,
add this support in driver to disable fence based on
below conditions for INPUT_PSC propertities:
- If session is interlace type
- If OUTPUT_ORDER is 0 and HFI_PROP_MAX_NUM_REORDER_FRAMES > 0

Change-Id: If861129ba96329c0277a9c9698f67baf25e5d82e
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2023-06-15 16:11:58 -07:00
Ankush Mitra
e1cb32c5de video: driver: resolve some checker err
Resolve some static checker err.

Change-Id: I0aa1d8c905ac7fd1defa16dd28d4386465f09ff3
Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
2023-06-06 11:57:20 +05:30
Ankush Mitra
400a782851 video: driver: add space and move "{" to previous line
This change will fix some checker err.

Change-Id: I93da24e9b54bb1d5f6145b438858a977b06ca09c
Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
2023-06-04 21:08:33 +05:30
qctecmdr
4ff57f3faf Merge "video: driver: Add support to 1kx1k tile for HEIC encoding" 2023-04-29 10:04:29 -07:00
Akshata Sahukar
982e626d00 video: driver: Add support to 1kx1k tile for HEIC encoding
- Introduce new control to set HEIC encoder tile size from HAL
- Support 1k x 1k tile encoding along with existing 512 x 512
  tiling

Change-Id: Iaeffe421f8311d818695c3ae9af7cabcc8892043
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2023-04-28 10:07:48 -07:00
Vedang Nagar
b4a1aefdd1 msm: vidc: Fix race condition between s_fmt & query_ctrl
- In s_fmt, there might be a codec change and here we are
  free the ctrl handler, at the same time client may call
  query ctrl and this will lead to null pointer access.
- To resolve null pointer access, do not free ctrl handler
  and add new codec controls to the same ctrl handler.

Change-Id: Iee87d5cb4d65e31d405cb1fc9f82bebab696d027
Signed-off-by: Vedang Nagar <quic_vnagar@quicinc.com>
2023-04-28 17:27:27 +05:30
qctecmdr
b6f94c9ee6 Merge "video: driver: adding average banwidth in stats logs" 2023-04-25 18:48:57 -07:00
Ashish Patil
2160e99d3d video: driver: adding average banwidth in stats logs
average calculation for llcc and ddr bandwidth for 2 seconds window
is printed in stats logs

Change-Id: I3507a0117c65b723644d00c89c7d466130d4a467
Signed-off-by: Ashish Patil <quic_ashpat@quicinc.com>
2023-04-24 15:56:18 -07:00
Darshana Patil
3e0952dacc video: driver: fix release issue for superbuffer
In VP9 superframe usecase one ETB has multiple FBDs,
and the EBD is after the first FBD.When driver receives
first FBD that is not in DPB_LIST, it releases this buffer.
Later on when the EBD arrives with dpb list property and
it turns out that first FBD for which release was sent is
actually in DPB_LIST, causing FW assertion.

To fix this issue, in the reverse path, when handling
dpb list property, mark those read only buffers which
are not in dpb list as release eligible. Later, in the
qbuf path for output buffers, send release for all those
buffers which were earlier marked as release eligible.

Change-Id: I5d6035b808653478311f41ebe53f60e728c7dd2a
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2023-04-24 14:06:35 -07:00
Govindaraj Rajagopal
c4f5dc6069 video: driver: fix queuing too many output buffers to firmware
Client is setting NV12 fmt as OP format before initial reconfig
So during input port stream_on, subscribe_input_property is
failing due to ubwc check(NV12 fmt), so DPB_LIST cap is getting
disabled, but later client is setting NV12C during reconfig.

So msm_vdec_release_nonref_buffers() during qbuf is bypassed and
release cmd is never sent to fw for pending ro buffers. Infact
entire RO handling at driver side is disabled.

Looks like due to some reason client was not requeueing same
buffers at same slot, So eventually number of pending RO buffers
increasing over the time. Once count shoots more than 256 fw
assertion happens and i.e leading to system error.

Remove UBWC check while subscribing input port properties, so
DPB_LIST willbe subscribed always and avoids above mentioned
issues.

Change-Id: I57ea0ea637ae3a57fcad430b212dcdb10f8e6d0f
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2023-04-18 16:32:10 +05:30
Ashish Patil
0b7870402e video: driver: Add info for uniform AV1 tile handling
read the av1 uniform tile handling propert from fw
and display it. Required in debugging av1 usecases for
power calculation

Change-Id: I443e5afd591a8131c667c64cebb417fc022693ac
Signed-off-by: Ashish Patil <quic_ashpat@quicinc.com>
2023-04-12 14:18:20 -07:00
qctecmdr
6a9848a4ad Merge "video: driver: Move private color definitions from UAPI" 2023-04-06 22:12:09 -07:00
Ashish Patil
cb18a42fa6 video: driver: added support for av1 uniform tile handling for power calculations
If the av1 tile rows and columns are greater than recommended decoder
av1 settings,vote for higher frequency.

Change-Id: Iea9f542e0b925a9ecb063c11b1827f31164f5a7b
Signed-off-by: Ashish Patil <quic_ashpat@quicinc.com>
2023-04-06 14:17:21 -07:00
Mihir Ganu
b803968cf6 video: driver: Move private color definitions from UAPI
Move private color definitions from UAPI to driver internal header
file to reduce UAPI dependencies.

Change-Id: I667c3efc965fdc7b7dc1ad52e1b0bcf0c964e979
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2023-04-05 10:51:34 -07:00
Akshata Sahukar
203f619b7f video: driver: Add support to handle synx fence related hfi props/info
Add support to handle synx v2 fence related hfi properties and
infos mentioned below:
- HFI_PROP_FENCE_CLIENT_DATA
- HFI_PROP_FENCE_TYPE
- HFI_PROP_FENCE_DIRECTION
- HFI_PROP_FENCE_ERROR_DATA_CORRUPT
- HFI_INFO_FENCE_SIGNAL_ERROR

Change-Id: Ifac0230dbeb0da80c104860c0e115167e82e85c6
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2023-03-28 18:11:45 -07:00
qctecmdr
1fdfa4758c Merge "video: driver: add driver version" 2023-03-22 14:08:07 -07:00
Darshana Patil
fc6a238b09 video: driver: enable dynamic metadata
- enable Eva stats, hdr10/10+ as dynamic metadata.
- Make eva stats dependent on bitrate mode.
  Also remove preprocess and layer count as
  child of Eva stats.
- Make Hdr10/10+ dependent on profile.
- Adjust transcoding stats metadata based on
  bitrate mode, fps and resolution.

Change-Id: I7b110962e29db50cb321d69a0fb301950436da6f
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2023-03-21 11:53:10 -07:00
Maheshwar Ajja
ed089ff4e5 video: driver: add driver version
Add driver version for clients to query and manage
accordginly.

Change-Id: I5e8c51a4f18c28c0ed4d5a8bdaf0660d175c420a
Signed-off-by: Maheshwar Ajja <quic_majja@quicinc.com>
2023-03-20 11:01:58 -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
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
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
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
f0b5f5dd65 Merge "video: driver: disable 5 LTR support" 2023-02-11 12:13:30 -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
Akshata Sahukar
654e6bb55d video: driver: Add support to allow 5 LTR count
Add support to allow 5 LTR count as per new
requirement.

Change-Id: Ic839ea61ae8dfe21bd8891f0f0dbaf26506d84ec
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2023-01-30 13:08:35 -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
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
qctecmdr
db62f9374a Merge "video: driver: Modify buffer_stats logic" 2023-01-18 13:36:08 -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
qctecmdr
4f297753f7 Merge "video: driver: implement memory_ops for upstream" 2022-12-27 10:58:45 -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
Govindaraj Rajagopal
c4982fbf1a video: driver: refine core state machine
introduced core error state and added changes
to refine core state machine.

Change-Id: Ib3b94fd3798e902b7a6cfc5de45820558c89806e
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-12-15 07:59:45 +05:30
Vedang Nagar
b3f107df87 video: driver: Modify buffer_stats logic
For super buffer usecase, All the ETB's gets queued with updated
timestamp in hfi_buffer, therefore all the fbd's being recieved
are of different timestamp. And only the last EBD is considered
for dequeued flag and hence for remove_buffer_stat.

Therefore when first FBD arrives which has the matched TS to
the stat's TS will get skipped since last EBD in the batch has
not arrived yet and rest all FBDs are with updated TS, hence
the buffer stat doesn't get's removed from the list.

Modified the logic to add stats during hfi_buffer queue and
add stats for all sub-frames in super buffer usecase.
Modified the logic for Multi-In single-Out usecase as well.

Change-Id: I0643e6f64bdfc3cbfa67baeb1cf9157de92ce569
Signed-off-by: Vedang Nagar <quic_vnagar@quicinc.com>
2022-12-14 23:10:54 +05:30
Ankush Mitra
bd1cd4368b video: driver: Prepare dependency list without parent
This is change 2 of the Prepare dependency list without
parent change.
In this change we remove all parent information from
the CAP database.

Change-Id: Ie0b878050ae2d24e3c1a41cbd579ef0f19d42250
Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
2022-12-13 19:10:18 +05:30
Ankush Mitra
2c39d5b91b video: driver: prepare dependency list without parent
Prepare dependency list only using children.

Change-Id: Id79487825fed1f121821126589594b64820c85d3
Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
2022-12-13 18:50:13 +05:30
Govindaraj Rajagopal
9b0140cf03 video: driver: add core sub_state support
Introduce core->sub_state similar to inst->sub_state.

[1] pm_suspended - moved to this substate in case of PM suspend
[2] handoff - moved to this state after successful
    handoff_regulator call.
[3] fw_power_control - moved to this state in case of IFPC.
[4] power_enable - will track core power_on/power_off status.
[5] page_fault - used to rate_limit fault logs.
[6] cpu_wd - indicates hw fired wd interrupt.
[7] video_unresponsive - moved to this state if sync cmd fails.

Change-Id: Iceb65cf404fd93aff7846860b0276307e4eab570
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-11-23 10:53:11 +05:30
Govindaraj Rajagopal
2eda86592a video: driver: use macros to prepare enums & string arrays
video driver is maintaining multiple tables based on enum
name pair. So this mapping might go wrong if new entry is
inserted in different position.

So added logic to prepare enums & static const char* arrays
using macros. So compiler will take care of creation and
maintaining order.

Change-Id: Id3669cf3ce150b3ababb84dce18326220f41d88d
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-11-17 21:35:27 +05:30
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
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
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
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
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
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
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
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
Akshata Sahukar
f37cc5fe6c video: driver: Introduce CAP_FLAG_META flag for metadata caps
Introduce CAP_FLAG_META flag to differentiate metadata caps
from non metadata caps.

Change-Id: I7a3d2c5fb952e5d829002a04d11fa7b05b2c9297
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-09-06 13:42:20 -07:00