Commit Graph

925 Commits

Author SHA1 Message Date
Akshata Sahukar
5713e9a303 video: driver: fix slice mode support
Allow client to set slice mode control to slice off for
HEIC codec.

Change-Id: Iffc8be23990a5dad451550cccb8236cc32951b2a
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-05-31 14:36:04 -07:00
Darshana Patil
e39962d028 video: driver: introduce lock for set & get volatile controls
Acquire client and inst lock for s_ctrl and g_volatile_ctrl

Change-Id: I97341b69ea5390133c46711c38be51326c80b224
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-05-31 11:20:03 -07:00
Akshata Sahukar
93742170e9 video: driver: fix incorrect crop resolution
Store unaligned resolution in driver inst formats
to avoid crop resolution getting updated to aligned
resolution whenever client did g_fmt and s_fmt again
after setting raw input resolution.

Change-Id: Ic2b6cf6e7d418d2bf0c35270199b914648e933d4
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-05-27 16:44:02 -07:00
qctecmdr
5dc3050cce Merge "video-driver: Add support for subframe_input" 2022-05-27 13:07:50 -07:00
qctecmdr
80ff8d2af2 Merge "video: driver: enable transcode stat for decoder" 2022-05-27 00:44:21 -07:00
qctecmdr
ccb76eb0e9 Merge "video: driver: Use vzalloc instead of kzalloc" 2022-05-26 19:19:15 -07:00
qctecmdr
5689776c4e Merge "video: driver: introduce client lock" 2022-05-26 18:57:44 -07:00
qctecmdr
ae681247a3 Merge "driver: video: Remove calls to power features during priority handling" 2022-05-26 16:19:46 -07:00
Deepa Guthyappa Madivalara
13d203ba7f video: driver: Use vzalloc instead of kzalloc
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>
2022-05-26 15:25:26 -07:00
Darshana Patil
2a687b2750 video: driver: introduce client lock
Acquire client lock for every entry point
in driver. This is needed especially for
streamoff and close calls where inst lock
is released while driver is waiting for
stop_done and close_done responses from fw.
When inst lock is released, client can send
a new ioctl call and driver state machine
can get updated leading to unexpected behaviour.

Change-Id: Ibb62c3431c88e2f1d9088d54fe7c9e53b1c284fd
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-05-26 14:34:36 -07:00
qctecmdr
e95d1dcf89 Merge "video: driver: Create and use single spin lock for dma fence" 2022-05-26 09:47:25 -07:00
Vedang Nagar
078aebf73a video-driver: Add support for subframe_input
Add support for 'HFI_PROP_SUBFRAME_INPUT'.
Payload '1' indicates that input buffer is
processed. However, FW expects more inputs
to construct a full YUV output buffer.
Overloading 'MSM_VIDC_BUF_FLAG_ERROR' code to
ensure HAL work completion

Change-Id: I05b24a50e587dfd96457af508267843ac3840fbf
Signed-off-by: Vedang Nagar <quic_vnagar@quicinc.com>
2022-05-26 20:36:45 +05:30
qctecmdr
d62a682a12 Merge "video: driver: Fix realtime load calculation" 2022-05-25 20:43:58 -07:00
Vikash Garodia
5589b67cb5 driver: video: Remove calls to power features during priority handling
While priority interface is set by V4L2 clients, tuning power features
is not needed. The same is done when stream on is called.

Change-Id: I931bbf72e5234ca552cdef984f05a2942ebc3442
Signed-off-by: Vikash Garodia <quic_vgarodia@quicinc.com>
2022-05-23 09:44:20 -07:00
Deepa Guthyappa Madivalara
e6a87ed4fe video: driver: Fix realtime load calculation
Use instanace instead of inst to resolve the load calculation error

Change-Id: Id346b6222f7c00e741ba8bfecf7100cfb4a90041
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2022-05-22 12:07:29 -07:00
Mahesh Kumar Sharma
8d0a217984 video: driver: enable transcode stat for decoder
Subscribe and enable HFI_PROP_TRANSCODING_STAT_INFO property
in order to enable transcoding stat for decoder.
This stat is used further by encoder to improve encoder quality
decision for transcode case.
Ideally we want to avoid CAC-BRS multiple times for same encoded bitstream.

When user does recording (1st encode), So we have CAC enabled bitstream.
Now, if user wants to send it via some app.
So, it will be decode -> (optional GPU) -> (2nd) encode

For 2nd encode -> we would like to not apply same CAC. It needs either tuning.
But we don't have a way from bitstream to know whether it went via CAC.

This feature enables to use the stat info received from decoder to fine tune encoding.

Change-Id: Iaf640878f5554b16aad3314ba4e26f99638c43af
Signed-off-by: Mahesh Kumar Sharma <quic_smahesh@quicinc.com>
2022-05-18 19:27:42 -07:00
Akshata Sahukar
3964fa9159 video: driver: Create and use single spin lock for dma fence
Create and use single spin lock per session (per fence context)
rather than creating spin locks per dma fence to possibly
resolve flickering in video playback.

Change-Id: I01286ae375dfedc0da26a1be4ded1bd1e02767ba
Signed-off-by: Akshata Sahukar <asahukar@quicinc.com>
2022-05-18 14:23:17 -07:00
qctecmdr
5b6a6bc3c8 Merge "video: driver: Subscribe to color info for AV1" 2022-05-17 16:39:56 -07:00
qctecmdr
91781e4fa0 Merge "video: driver: keep default complexity as 50" 2022-05-14 23:23:29 -07:00
Mihir Ganu
888ecb9f1b video: driver: Subscribe to color info for AV1
Subscribe to HFI_PROP_SIGNAL_COLOR_INFO to receive
color info from bitstream AV1 bitstreams.

Change-Id: I3c76bc651160b701078bd73725f7060388ad9125
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2022-05-13 08:00:01 -07:00
Vikash Garodia
5a7898589e video: driver: keep default complexity as 50
Complexity parameter defines the encoding tools used
during an encode session. Higher the complexity implies
more quality with advance encoding tools used.
Keeping the default value as moderate or acceptable
range.

Change-Id: I3ee66d3a6612d5d60cd63a0698a4248f48ee8e2d
Signed-off-by: Vikash Garodia <quic_vgarodia@quicinc.com>
2022-05-13 09:55:40 +05:30
Akshata Sahukar
96a1693ba4 video: driver: Acquire lock for fence fd creation
Acquire lock for fence fd creation to avoid sync_file_poll
race conditions in fence enabled case.

Change-Id: Icb45550cd6d2018112e99d886aedd98ac3922a2c
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-05-12 15:34:28 -07:00
Darshana Patil
2f361417ab video: driver: input metadata buffer size changes
use default 16kb as input metadata buffer size.
Amend buffer size if ROi metadata is enabled.

Change-Id: I7b07c432dcf27f83096f07be03537f02db9114dd
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-05-11 12:39:22 -07:00
Deepa Guthyappa Madivalara
0b5a5e71fc video: driver: fix uinitalized variables
Intitalize variables to address warnings

Change-Id: Id211e49e5055839b34950f6075e034aa74f4ae0c
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2022-05-09 14:57:16 -07:00
Govindaraj Rajagopal
701b2a4c58 video: driver: fix fd leak issue
if msm_vidc_memory_map() call fails then, we are not
decrementing dma_buf refcount immediately and entry
still stays in mappings list. So backed fd willnot be
reusable for the entire session and gets cleaned up
only during msm_vidc_close(). This issue mostly occur
for encode session. Added change to cleanup dma_buf
refcount immediately at the time of issue.

Change-Id: I48b4ffaa9d329ef14ef59c5c016a6dd04f705b7a
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-05-04 18:14:40 +05:30
Mihir Ganu
2de81c4c69 video: driver: Configure UBWC stride/scanlines for AV1D
Set stride/scanline (in bytes) for UBWC color formats.
This is required to keep fixed stride/scanline during
in-sequence frame resolution changes in AV1 bitstreams.
Driver sets this property before resume/start.

Change-Id: I40526793cee36ad110f40e6ce110cda8070864d7
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2022-05-03 13:48:45 -07:00
Vikash Garodia
e3da5c43e2 driver: video: Add critical priority and reserve duration
Critical priority - A video session which is prioritized above
all concurrent sessions. Such sessions have low latencies and
at the same time they cannot be rejected due to overload.
Reserve duration - Duration by which a session reserves the
video hardware for processing frames from that session.
Both the above aspects are implemented with these changes.

Change-Id: I58aef5f239e5ee106201d6819d2228784f0f0ad0
Signed-off-by: Vikash Garodia <quic_vgarodia@quicinc.com>
2022-05-02 11:17:18 +05:30
Akshata Sahukar
91f3bc9ab7 video: driver: fix invalid output buffer tag receipt in fence usecase
When fence is enabled, output buffer tag is sent to fw via
output metadata buffer. Since fw relies on bytesused field of
output metadata buffer to invalidate cache and perform read operation,
output metadata buffer's filled length cannot be zero.
Hence set valid size for bytesused field to fix this issue.

Change-Id: I7bd87ec49508402d2d654095f06e75992771c39d
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-04-29 20:00:28 -07:00
qctecmdr
57b55c5c22 Merge "video: driver: Add support for slice encode delivery" 2022-04-29 15:44:27 -07:00
qctecmdr
cf5a48074b Merge "video: driver: introduce metadata size macro" 2022-04-29 13:19:19 -07:00
Chandrakant I Viraktamath
308499361d video: driver: Add support for slice encode delivery
Add support to enable slice encode delivery for
HEVC and AVC codec. Basically in this mode, each
encoded slice is given as a separate FBD to the client.

Change-Id: Ia30fde9abaf2b38fb486113807fbb7f19110225c
Signed-off-by: Chandrakant I Viraktamath <quic_civirakt@quicinc.com>
2022-04-29 22:18:06 +05:30
Mahesh Kumar Sharma
a079cc43f3 video: driver: preprocessing pass required additional cycles and bw
Encoder preprocessing feature requires additional cycles
and bw to support this feature if it is enabled.

Change-Id: I46de42dd0cb0d5a7cd9fdf00beeaefd50e40798e
Signed-off-by: Mahesh Kumar Sharma <quic_smahesh@quicinc.com>
2022-04-28 17:02:55 -07:00
Darshana Patil
808cebd0b4 video: driver: introduce metadata size macro
introduce encode input and output metadata
size macro in the interface file.

Change-Id: I40776018c5c3278d40a426c2afde4d56e90066e2
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-04-28 14:36:19 -07:00
qctecmdr
c39eec6e2e Merge "video: driver: superframe metabuffer fix" 2022-04-28 10:01:42 -07:00
Govindaraj Rajagopal
31272040c3 video: driver: fix dmabuf leak issue in queue init sequence
In __interface_queues_init() api somtimes map() call is failing.
Map failure scenario we were not freeing allocated memory. So
added change to cleanup allocated memory incase of map failure
scenario.

Change-Id: I04b196e55a5f080a4ec973aa166f7e1b6525a58c
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-04-27 16:35:44 +05:30
Darshana Patil
ef97be4b75 video: driver: superframe metabuffer fix
with request api, c2 hal sets 2MB as
input metadata buffer size for encoder.
Hence amend superframe meta buffer size
sanity condition.

Change-Id: I6c837bb85471b5e4be25811922081d1160761464
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-04-26 22:34:32 -07:00
Akshata Sahukar
047ed11bf7 video: driver: add restrictions for dec fence enablement
- Allow dec sw fence enablement only if decode order is set and
 non interlace type session.
- Enable low latency mode if sw fence is enabled.
- Signal fence if FBD length > 0.

Change-Id: Ib59c2de51f621b796e68fe2aba68d9fca3ff4272
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-04-26 13:28:13 -07:00
qctecmdr
3cbfc66709 Merge "video: driver: fix decoder output port crop info" 2022-04-25 21:43:18 -07:00
qctecmdr
e115a1410e Merge "video-driver: Add Null Pointer check for response_workq" 2022-04-25 16:34:33 -07:00
Darshana Patil
bb8c08f6cd video: driver: fix decoder output port crop info
crop width and height should be calculated using
left and top as references.

Change-Id: I463cdc9557dab3ae7200cb6aaf60fce399571d30
Signed-off-by: Darshana Patil <darshana@quicinc.com>
2022-04-25 13:53:00 -07:00
Roopangkumar Patel
0f28bde3c5 video: driver: Change to support ROI with CBR
- Enable ROI for VBR, CBR_CFR, CBR_CFR bitrate modes.
 - Disable ROI feature, when rotation, downscaling/scaling
   enable,
 - Disable adaptive blur, when ROI feature is enable.

Change-Id: If645a255bca93b90fe5cee5a735d7ffcd2a6bc5c
Signed-off-by: Roopangkumar Patel <quic_rooppate@quicinc.com>
2022-04-24 21:56:05 -07:00
Vedang Nagar
30cee602ed video-driver: Add Null Pointer check for response_workq
Add Null Pointer check for response_workq inside
cancel_response_work_sync function.

Change-Id: I574034b8937ade601cb9cda3f91c3c3bcf2c3e1e
Signed-off-by: Vedang Nagar <quic_vnagar@quicinc.com>
2022-04-24 21:06:06 -07:00
Deepa Guthyappa Madivalara
59b8019b9d video: driver: amend priorities to allow more sessions
1. adjust client set non-realtime priroty with NRT_PRIORITY_OFFSET (2)
2. if total mbps is more than max_mbps
    a. allow encode session by reducing decoder sessions priority by 1
    b. allow decode session by moving it to non-realtime session
        in order to not disturb the ongoing sessions

Change-Id: I96fd2ac75c123d681982fb9a2c06ac51d15bd59a
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2022-04-22 11:55:29 -07:00
Deepa Guthyappa Madivalara
8a1d57af0e video: driver: add comments for kernel space logs
adding comments to avoid changes in kernel space
logs that are used by post processing scripts

Change-Id: I66ee9743866d12c740c3791b92534eaf7601436d
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2022-04-15 17:35:09 -07:00
qctecmdr
e7a0e95217 Merge "video: driver: add macros for kernel space logs" 2022-04-14 18:23:36 -07:00
Deepa Guthyappa Madivalara
7e9d5106f6 video: driver: add macros for kernel space logs
adding kernel space logs used by post processing
scripts as macros to avoid changes in them.

Change-Id: Iea0fb0514c134767f063902ff98fd756898ef7c4
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2022-04-14 15:06:12 -07:00
qctecmdr
524675dc5e Merge "video: driver: createbufs and controls v4l2-compliance fixes" 2022-04-13 16:45:34 -07:00
Govindaraj Rajagopal
f47f897e4a video: driver: split platform database entries into 2 parts
Divided database entries into 2 parts

[1] struct msm_platform_inst_capability -> it tracks cap_id,
domain, codec, min, max, step, default, v4l2_id, hfi_id, flags.
[2] struct msm_platform_inst_cap_dependency -> this will track
cap_id, domain, codec, parents, childrens, adjust and set
callbacks.

It will help to reduce number of database entries.

Change-Id: I692968b0f6804b45371e8cf4af6407e57df54bb9
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-04-12 15:25:59 +05:30
Darshana Patil
0602d95bd9 video: driver: createbufs and controls v4l2-compliance fixes
when create_bufs ioctl is called for meta port, v4l2
framework calls queue_setup with num_planes as 1.
fixed the num_planes condition by updating it for only
input and output ports.
removed a condition to check if client has set unsupported
bits for metadata controls.

Change-Id: I0faf2cfc2827af7d3992bda63a04d4203f13c9e1
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-04-11 17:33:36 -07:00
qctecmdr
6b08ced7fe Merge "video: driver: fix corner cases in caps_list preparation" 2022-04-11 16:58:20 -07:00