Commit Graph

56 Commits

Author SHA1 Message Date
Dikshita Agarwal
69d0c83f55 video: driver: split control code
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>
2022-07-12 12:15:54 +05:30
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
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
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
Mahesh Kumar Sharma
508f4a0282 video: driver: inline preprocessing improvement
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>
2022-04-08 18:52:52 -07:00
Deepa Guthyappa Madivalara
fdef18ef50 video driver: remove session priority handling
1. Removes depenceny of priority from frame rate
    and operating rate.
2. Removes changing priority from s_param

Change-Id: Iec51173eab5a3d59b841315549d1420df422d37f
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2022-04-06 09:22:38 -07:00
Dikshita Agarwal
8f0e12cc93 video: driver: add support for cyclic intra refresh
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>
2022-04-01 11:08:19 +05:30
qctecmdr
812f40eff9 Merge "video: driver: use custom v4l2 ctrls in place of S/G_PARM on decoder" 2022-03-30 15:32:02 -07:00
Dikshita Agarwal
f60ff0d92c video: driver: use custom v4l2 ctrls in place of S/G_PARM on decoder
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>
2022-03-29 11:45:17 -07:00
Mahesh Kumar Sharma
5ae6ad83d2 video: driver: decouple min quality, CAC and quality boost
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>
2022-03-23 19:20:20 -07:00
Govindaraj Rajagopal
4f1180f1a6 video: driver: handle static and dynamic properties for decoder
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>
2022-03-08 19:46:05 +05:30
qctecmdr
37396addce Merge "video: driver: fix static and dynamic property setting sequence" 2022-02-23 19:58:51 -08:00
Akshata Sahukar
f9a844d745 video: driver: fix in header details
fix in header comment details.

Change-Id: I698b1ee9076a908a2b8f7b9c588c733567f9d8c9
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-02-23 18:08:48 -08:00
Govindaraj Rajagopal
0fde3a9aca video: driver: fix static and dynamic property setting sequence
Added changes to reuse caps_list for setting static properties
and also modified dynamic property setting sequence. Removed
redundant implementations.

Change-Id: I5829d3c98b0159916d7794f43e445a6191050182
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-02-18 18:20:39 +05:30
qctecmdr
c8b7a6830a Merge "video-driver: prepare conflict free dependency list" 2022-02-02 14:09:20 -08:00
Govindaraj Rajagopal
d9debeed9e video-driver: prepare conflict free dependency list
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>
2022-02-02 14:59:48 +05:30
Zhongbo Shi
afa424d529 video-driver: disable dynamic low latency
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>
2022-02-01 13:54:45 -08:00
Mahesh Kumar Sharma
d1351838e3 video: driver: CBR and Blur handling enhancements
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>
2022-01-13 19:51:47 -08:00
Dikshita Agarwal
8d0f720028 video: driver: fix usage of v4l2_fh
- 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>
2021-12-17 11:52:26 +05:30
Darshana Patil
fc6c35e8de video: driver: add all intra encoding support
add ALL_INTRA database entry and its dependencies.
implement adjust functions.

Change-Id: Ib4522666b6c2ef7dcb5adf9110a2fd5d2daf4654
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-10-04 10:40:32 -07:00
Akshata Sahukar
942f406c42 video: driver: Cap chroma qp offset value other than -12 as 0
Cap chroma qp offset value other than -12 as 0.

Change-Id: I0ca9c4844ab835a9365e695f38deff90768191aa
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-07-15 10:23:02 -07:00
Vikash Garodia
3b67d6b2f9 driver: video: Reset sequence change request property only during psc handling
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>
2021-07-01 16:54:30 +05:30
Darshana Patil
bd41af8c21 video: driver: handle dynamic qp setting
- 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>
2021-06-17 18:11:55 -07:00
Akshata Sahukar
36a4971392 video: driver: Add enc vbr min quality restrictions
Do not support vbr min quality with below configs:
- HEVC 10bit
- Bitstream fps > 60
- ROI enabled/support
- HP encoding
- External Blur
- Resolution beyond 1080P.

Change-Id: I5e4a420abdd0c6fee4342c3c097684ef69bb0597
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-06-15 18:23:36 -07:00
Darshana Patil
5b276d076e video: driver: encoder fix for frame qp and level
- 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>
2021-06-03 13:57:49 -07:00
Vikash Garodia
c1bf1d2bc9 video: driver: Set proper HFI during low latency for decoder
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>
2021-05-28 21:38:05 +05:30
Akshata Sahukar
6e9150c232 video: driver: Enable low latency mode for CBR rc type
Enable low latency mode for CBR rc type.

Change-Id: I80230e5d2acab94820b1401ffa6e6fe372398397
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-05-26 13:42:17 -07:00
Vikash Garodia
252625c6d0 driver: waipio: set static priority configuration to firmware
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>
2021-05-25 16:59:26 +05:30
Akshata Sahukar
945883602d video: driver: add support to set csc coefficients
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>
2021-05-19 17:17:01 -07:00
Vikash Garodia
90d7de5658 video: driver: define hfi setter for configuring pipe
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>
2021-05-14 23:48:15 +05:30
Vikash Garodia
75ecec1bb5 video: driver: Add support dynamic low latency for decoder
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>
2021-05-14 23:47:30 +05:30
qctecmdr
1ecbcd6110 Merge "video: driver: fix layer bitrate dynamic setting" 2021-05-04 11:30:31 -07:00
Akshata Sahukar
78bd0f54eb video: driver: fix layer bitrate dynamic setting
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>
2021-05-03 19:12:33 -07:00
Akshata Sahukar
ce09f77e44 video: driver: free children and firmware list memory
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>
2021-04-30 18:42:34 -07:00
Akshata Sahukar
1c5f23e13b video: driver: Add support to blur property
[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>
2021-04-28 16:29:12 -07:00
Mihir Ganu
cf3fd457b3 video: driver: Enable flip and rotation
Enable encoder flip and rotation preprocessing features.

Change-Id: Icb0448c2d09fbe9504e3f58701cd2653dc4559b0
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-04-23 16:44:42 -07:00
Darshana Patil
2c0cab5146 video: driver: add ROI metadata support
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>
2021-04-15 21:50:00 -07:00
Akshata Sahukar
5a2b2ee399 video: driver: Add support to adjust slice mode
Add support to adjust slice mode.

Change-Id: Id09e951b3085c55cc5bc6b15a2ce002645923435
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-04-13 17:12:27 -07:00
Akshata Sahukar
712640a1a8 video: driver: Modify decode order and some misc changes
- 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>
2021-04-02 14:24:46 -07:00
Vikash Garodia
0017afac21 video: driver: Add handling for session priority
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>
2021-03-29 22:47:28 +05:30
Akshata Sahukar
14efc2a0bc video: driver: Add support to advanced bitrate ctrls
Add support to below properties:
- HFI_PROP_BITRATE_BOOST
- HFI_PROP_CONTENT_ADAPTIVE_CODING
- HFI_PROP_MAINTAIN_MIN_QUALITY
- HFI_PROP_VBV_DELAY
- HFI_PROP_TOTAL_PEAK_BITRATE
- HFI_PROP_BITRATE_LAYERx.

Change-Id: I1072f97c7c202c7f4fc38c26e0ab9274ae06fce0
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-03-25 14:50:20 -07:00
Akshata Sahukar
98e799da29 video: driver: Add support to handle GOP and its dependencies
Add support to below mentioned properties:
- HFI_PROP_LAYER_ENCODING_TYPE
- HFI_PROP_LAYER_COUNT
- HFI_PROP_MAX_GOP_FRAMES
- HFI_PROP_MAX_B_FRAMES.

Change-Id: I3be975a48dc668d0ec83f6ff13837488fc570b78
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-03-19 12:33:27 -07:00
Govindaraj Rajagopal
a7670d7f42 video: driver: enable decoder batching support
Added change to enable decoder batching feature.

Batching willbe enabled only when below conditions were met.

[1] platform supports batching
[2] decode session
[3] realtime session
[4] non-thumbnail session
[5] non-heif session
[6] 2-stage decode only(low_latency not supported).

Change-Id: I54b601814c3b5fa2077dc41c5b0ac84964c2674a
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-03-04 09:38:55 +05:30
Akshata Sahukar
660008370e video: driver: Add NAL length based encoding
Add support to set HFI_PROP_NAL_LENGTH_FIELD property to
video firmware.

Change-Id: I20db36bad394fe0b5163a156199340836af3f740
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-03-03 11:43:00 -08:00
Darshana Patil
481a6117d8 video: driver: update license year
update license year to 2020-2021

Change-Id: I5a67bf49c386e86337bc7449ded08d186fc9a280
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-03-01 18:07:35 -08:00
Akshata Sahukar
17addfbc6d video: driver: add support to few properties
Add support to below properties
- HFI_PROP_MULTI_SLICE_BYTES_COUNT
- HFI_PROP_MULTI_SLICE_MB_COUNT
- HFI_PROP_CHROMA_QP_OFFSET
- HFI_PROP_REQUEST_SYNC_FRAME

Change-Id: I4cc62870756d058e7a7b15290f5d6797b3be243c
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-02-24 12:06:26 -08:00
Akshata Sahukar
691eb8dfa5 video: driver: Add support for CQ bitrate mode
Add CQ bitrate mode support. Also add related
constant quality control support.

Change-Id: I415423e76dc855a7a72e1b68062b9d49433f3ed3
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-02-09 13:55:19 -08:00
Akshata Sahukar
0b21038c27 video: driver: Add support to deduce min, max, frame qp values
Add support to deduce min, max, frame qp values from client set
controls and set the same to video firmware.

Change-Id: Id94e781cc0c8afdf0e9e00562bdaea32db04fd74
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-01-21 12:49:37 -08:00
Akshata Sahukar
92f04d7446 video: driver: Phase 2: Add support for advance controls
Add support for some advance controls to set adjusted
client set values to video fw. Mentioned below
are the properties added.
 - HFI_PROP_LTR_COUNT
 - HFI_PROP_LTR_USE
 - HFI_PROP_LTR_MARK
 - HFI_PROP_IR_RANDOM_PERIOD
 - HFI_PROP_AUD
 - HFI_PROP_TIME_DELTA_BASED_RATE_CONTROL
 - HFI_PROP_8X8_TRANSFORM
 - HFI_PROP_LTR_MARK_USE_DETAILS
 - HFI_PROP_DEBLOCKING_MODE

Change-Id: Id31e9774154556df7c66cda366913489815a2723
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-01-15 21:18:17 -08:00
Akshata Sahukar
c19f4aec51 video: driver: update basic functionality controls
- update basic functionality controls with their parents
  and children list.
- deprecate MPEG2 related code.
- rename driver internal color formats.

Change-Id: I918d6fd238486098f10c5b9ce40c895bcd9468e5
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2020-12-30 13:06:03 -08:00