Add Synx V2 fences support to improve latency
in video decode usecases.
Change-Id: If21f8b65895364a804f8e03580b09c44b377c199
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
- 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>
update copyright markings to 2023 in all files.
Change-Id: I6842d56c4a8fff6a7a93d0c1d4bc049041297b02
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
- 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>
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>
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>
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>
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>
Added change to print etb, ebd, ftb, fbd,
(ebd-etb), (fbd - etb), (etb-ftb) wallclock
time in ms.
It will help to debug perf issues.
Change-Id: Ideaecb2d51763711d6628729aa0f9056d05f0d51
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
kzalloc might fail to allocate physically contiguous
memory which may not be available always and hence use
vzalloc to allocate virtually contiguous memory
Change-Id: I8ad89ef107da301217f3d1ec307b9b27b4edd2de
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
Use client input buffer queuing rate for power
calculations for non-realtime sessions
Change-Id: I498422ba1ae9ae96b782a2096dc0cd0aa7b05798
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
packetize dynamic controls set via request api along
with corresponding input buffer under the same hfi header
and queue to FW.
Change-Id: I8bf82f7ccb1ab16c42ce02189a208f5f7cb8dc70
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
[1] Remove CAP_FLAG_ROOT flag. Root willbe identified
with has_parents() api.
[2] Replace field(struct msm_vidc_inst_cap) cap -> cap_id.
[3] Rename below pool apis.
msm_memory_alloc -> msm_memory_pool_alloc
msm_memory_free -> msm_memory_pool_free
[4] Remove struct msm_vidc_inst_cap_entry usage in inst.
inst->firmware.list -> inst->firmware_list
inst->children.list -> inst->children_list
[5] Organize msm_vidc_inst_capability_type enums in such
a way that all parents placed first then children. It
will save CPU cycles while preparing caps_list.
Change-Id: I376f4e6ddec37ce326c393fba133e19ba70bab09
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
Added change to avoid unnecessary list iteration during
msm_memory_free also added logic to catch double free
request.
Change-Id: Ie3fb8019fd039e95ea75ba8f3fbd266af515e5cd
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Track dmabuf refcount during dma_buf_get() and dma_buf_put().
So if any dmabuf present with non-zero refcount during close,
then i.e a dmabuf leak. So during session close print error
and call dma_buf_put_refcount_completely() api to recursively
reduce the count to zero and will call dma_buf_put() to avoid
dmabuf leak from video driver side.
Change-Id: I2028c18ca067977eac3cdf0ce7d6cc4200739408
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
- Maintain free & busy pool to track buffers separately
- track double-free cases during msm_memory_free()
- track memory leak, by checking busy pool buffer count.
it is expected to be zero at the end of a session.
- maintain common api's to init, alloc, free, destroy
for all below buffer types.
- struct msm_vidc_buffer
- struct msm_vidc_alloc
- struct msm_vidc_map
- struct msm_vidc_timestamp.
Change-Id: Ib8655047c3883ea6601344661058d7a629ffd5bd
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
- add support to skip lazy unmapping for decoder
output buffers only. Map twice for these buffers.
- v4l2 client owned RO SMMU mapped buffers are
maintained separately in read_only list.
- For FBD with RO flag from fw, add buffer to read_only
list. Else remove from this list.
- During FTB, if buffer present in read_only list,
add RO flag to hfi buffer and queue to fw.
- During streamoff output, unmap all buffers except
those present in read_only list.
- During close, unmap completely and clean up read_only
list, output list.
Change-Id: Iacee7d298dfbff0b9cb6f17dff27ad98574b489b
Signed-off-by: Darshana Patil <darshana@codeaurora.org>