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>
update copyright markings to 2023 in all files.
Change-Id: I6842d56c4a8fff6a7a93d0c1d4bc049041297b02
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
Move adjust/set control functions to common/platform.c as part of
upstream effort.
This is part 1 of the change.
Change-Id: I8c440740fe785b5b052c4d44963ea34c21419fa4
Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
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>
- do not use vidc_v4l2_extensions.h for upstream driver compilation.
- resolve compilation issues in upstream and downstream driver due
to above change.
- add volatile flag in the database.
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
Change-Id: I1985cae29a459af2250f7044d85c5cd22cdd68f7
Added new capabilty changes to support slice based decoding.
This feature basically enables to decode the given input in terms of
slices and deliver single output to the higher layers when all slices
decoded in a frame.
When HW receives the slices then it will start decoding the slices,
instead of waiting for all the slices belongs to same frame.
So this will help to achieve lower decode latency.
Change-Id: Id107b34baba6d7b4a88238e232e8bf4a0fd6e58e
Signed-off-by: Gaviraju Doddabettahalli Bettegowda <quic_gdoddabe@quicinc.com>
Add vui timing info control with default
value as disabled in driver.
Change-Id: Ibaa45303fe389a0120d487fe3b6ff336e721f359
Signed-off-by: Manikanta Kanamarlapudi <quic_kmanikan@quicinc.com>
Split control code into msm_vidc_control.c and
msm_vidc_control_ext.c files.
Change-Id: I95f13d66f33fb75da4ebaa08e24bf31fe5de55b4
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
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>
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>
- 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>
For VPSS, FW requests more bandwidth from HW.
In order to support inline processing, FW introduced
request preprcess property.
Enble this property only when following conditions are met:
- CAC-BRS is required
- don't have EVA stats.
- Upto 4k@60 fps, max( frame rate, operating rate) <= 60
Change-Id: I3cf83483d9320e5dfe20617b37a54b9d5fbcffd8
Signed-off-by: Mahesh Kumar Sharma <quic_smahesh@quicinc.com>
Currently driver supports only random intra refresh, extend
it to support cyclic intra refresh too.
Cyclic intra refresh is supported dynamically as well.
- If intra refresh type is set and num of LCU’s to be refreshed
are non-zero before session start, intra refresh will be enabled
throughout the session.
Any further dynamic settings in the number of LCU’s including 0
will be honored accordingly.
- If intra refresh type is set and num of LCU’s to be refreshed are zero
before session start, intra refresh will be disabled.
When client sets it to non-zero value dynamically, driver will set
HFI_PROP_REQUEST_SYNC_FRAME with
HFI_SYNC_FRAME_REQUEST_WITH_PREFIX_SEQ_HDR.
Driver needs to send HFI_PROP_REQUEST_SYNC_FRAME only at time of
CIR Enable, no need to send at time of disable/enable again.
Change-Id: I10a2fb22d131353721ee658213ed807ce0794009
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
Introduce new v4l2 controls to set frame rate and operating rate
on decoder as VIDIOC_S/G_PARM is not allowed on decoder.
fix: v4l2-compliance:S/G_PARM
Change-Id: I6c090c0ae541a086c73bb79564dd29ed4aa755b3
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
Signed-off-by: Maheshwar Ajja <quic_majja@quicinc.com>
Remove dependency between min quality, CAC and quality boost.
Accept quality boost value from client and if client did not
set then enable max quality boost upto 4k@60fps and disable after that.
Change-Id: I0685065b8dee8754aff2cf5f176a2f40e9e080dd
Signed-off-by: Mahesh Kumar Sharma <quic_smahesh@quicinc.com>
Added change at decoder side to use adjust/set functions for
static(streamon) and dynamic(s_ctrl) cases.
Change-Id: I3d8c32baaf2fa2c3a077cc936a8ff2159ababfe3
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
Convert multi-parent, multi-child based dependency tree
into flattened list. It is organized in such a way that
all parents willbe present before self or any child node.
For some caps, adjust sequence is called without preparing
parent nodes. So that is leading to undefined behaviour.
Added change to address these problems.
Change-Id: Ib28cae8a4ed7e019c80ecfc06519ef78ffa4dc08
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
Dynamic low latency causes decoder input PSC triggered
for every IDR frame, leading to clock increasing.
And this also causes power higher
for VT call. Thus, need the following changes:
1. Disable dynamic low latency when low latency mode
is enabled;
2. DO NOT allow config low latency mode after
stream on.
Change-Id: Ia57f4c75617214b0352b263425ad9b445ff95524
Signed-off-by: Zhongbo Shi <quic_zhongbos@quicinc.com>
This change is made to support 100ms VBV delay for
aggressive rate control in iris3 hw.
Video buffer verifer helps to ensure that encoded stream
doesn't overflow or underflow the decoder's buffer.
iris3 hw is capable to decode data in 100ms VBV buffer window.
Adaptive Blur (Internal encoder feature): This is other enhancement
which supports adaptive blur feature on iris3 for CBR_VFR
(Constant bit rate_Variable frame rate)/CBR_CFR
(Constant bit rate_Constant frame rate) rc types apart from
already supported VBR_CFR. Unlike iris2, there is no need to enable CAC.
Below are the listed scenarios when it is enabled/disabled on iris3-
- Supported only for 8 bits encoding (H.264 & H.265).
- By default enabled for VBR_CFR/CBR_VFR/CBR_CFR RC without CAC enabled.
- No dependency on CAC to be enabled.
- Adaptive Blur is disabled if minquality_VBR is enabled
- Adaptive Blur is supported for 3 RC types: VBR_CFR, CBR_VFR & CBR_CFR
- If any one of the features (scalar/external blur) enabled, encoder
disables adaptive-blur.
- Static property available to disable adaptive blur feature
Below are the listed scenarios when it is enabled/disabled on iris2-
- Supported only for 8 bits encoding (H.264 & H.265).
- By default enabled for VBR_CFR RC type with CAC enabled.
- Dependency on CAC to be enabled.
- Adaptive Blur is disabled if CAC is disabled
- Adaptive Blur is disabled if minquality_VBR is enabled
- Adaptive Blur is not supported for any other RC types except: VBR_CFR
- If any one of the features (scalar/external blur) enabled, encoder
disables adaptive-blur.
- Static property available to disable adaptive blur feature
For backward compatibilty:
- Removed CAC as parent from msm_vidc_kalama.c.
- Removed cac query from msm_vidc_adjust_blur_type in msm_vidc_control.c.
- Moved legacy code to newly created function msm_vidc_adjust_blur_type_iris2().
- Added msm_vidc_adjust_blur_type_iris2 in BLUR_TYPES in msm_vidc_waipio.c
Change-Id: I49dec7e2574496d1b32babde55c0187866ca21d2
Signed-off-by: Mahesh Kumar Sharma <quic_smahesh@quicinc.com>
- Do not clear V4L2_FL_USES_V4L2_FH flag because this
flag indicates that file->private_data points to
&struct v4l2_fh.
- Initialize v4l2 ctrl handler with driver ctrl handler.
- Add ctrl ops for g_volatile_ctrl to return updated
value of volatile ctrls from driver.
Fixes: v4l2-compliance:
testPrio (VIDIOC_G/S_PRIORITY).
testQueryControls (VIDIOC_QUERYCTRL).
Change-Id: Ibe4b6fa67d2c02a5afeb627f2060e4761c5ef717
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
Cap chroma qp offset value other than -12 as 0.
Change-Id: I0ca9c4844ab835a9365e695f38deff90768191aa
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
Sequence change property would configure firmware to generate psc at every
key frame. This property is configured based on low latency settings from
the client.
For cases, when client sets low latency from 1 to 0, the hardware would
continue to run in direct mode (low latency mode). Since the sequence
change property gets disabled, there would not be psc from firmware to
change the mode to 2 stage. Hence the sequence change property to be reset
only during psc handling.
Change-Id: Ie8e17e44c921f036763f6f390397d4d812120e23
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
- make B and P frame QP controls as dynamic.
- enable I/P/B QP to fw as and when these
controls are set to the driver.
- remove HEIC qp support.
Change-Id: I7f45ab0bda75df8128bbbdfcebe66c2cae208b06
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
- misc fix for setting frame qp, min qp, max qp.
- seperate LEVEL database entry for encoder and
decoder as max level supported by encoder is 6_0,
but decoder supports upto 6_2.
Change-Id: Ia0a0a717e73e55a8b6933421e3eb55c3831524b2
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
Decoder supports dynamic low latency. When client configures the
video session in low latency mode, driver would configure the
firmware such that HFI_CMD_SETTINGS_CHANGE is triggerred on
sync frame boundary.
Change-Id: Ie70eaaeb8ad420db926f0d99f77723476deee400
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
Existing video driver expects session priority to be set
explicitly during static configuration. CAP_ROOT is not
enabled for decoders, hence explicit setting is needed.
Change-Id: Id754b38f15e9e045d31797557a4a7aa7a296346e
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
Add support to honor client enablement of csc custom
matrix and set csc coeff to video firmware.
Change-Id: I14d702eb7033541aa439bebe11df7fc4aa49ffdb
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
Deprecate custom pipe setting and use the hfi setter
to configure it alongwith other configurations.
Change-Id: Iffbd25df89f43cf77c1fa85ffa97601a31998410
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
Latency property is set to firmware during streamon output port,
if set as part of initial configuration by client.
During runtime, the property is set as and when configured by
client.
1. Make the latency property dynamic for decoder.
2. For encoder, the same gets set to firmware with regular
v4l2 set properties.
3. For decoder, set the property explicitly during streamon
output port.
Change-Id: I35990614b95e57f113ddacfc2272cad6ae0dde82
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
Fix the issue where bitrate cap database value is
incorrectly updated to dynamically client set layer bitrate
value when layer bitarte is not set.
Change-Id: I0f66c056c8ea0d053f8347dd003b61193258687e
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
To avoid memory leakage, clean children and firmware lists
at session close, error cases, and at the end of each usage.
Change-Id: I1eadbf81da207bd987c50428c0c7cf4967a8885f
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
[1] Add support to adjust and set blur type and blur
resolution.
[2] Modify flip to not allow dynamic flip enablement
when external blur is enabled.
Change-Id: I730f452c143ba8c8e15402d1c1ec3a0617bd583c
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
add extra size for input meta buffer
when ROI metadata is enabled.
add dependency of rate control and
color format.
Change-Id: Icefd3f9e319d596f88090cee331417c0b2946180
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
- Account for V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY
ctrl value to decide HFI_PROP_DECODE_ORDER_OUTPUT property value.
- Set encoder run time properties on raw port
- Some logging changes.
Change-Id: I5eef81b484e81b69031854a3a8665de4be7f98f9
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
Following changes are added with this:
1. Handle and adjust session priority.
2. Session addmission based on priority.
3. Power (clock and bus) scaling based on priority.
4. Handle s_parm influence on priority.
Change-Id: I12dec5fb03d733f07b0b0a24b4d74d1ccd4bf791
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>