提交線圖

66 次程式碼提交

作者 SHA1 備註 日期
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
Darshana Patil
7affdd1031 video: driver: adjust properties during reqbufs
- Adjust v4l2 properties during reqbufs of
  master port. Set properties to firmware
  during streamon of master port.
- Calculate buffer size and buffer counts
  during reqbufs call of each port.
- This is done to recalculate buffer sizes
  and counts after client has configured
  all the controls and updated size and
  count can be returned to client before
  streamon.

Change-Id: Ifc7ee36456d5d4e1c862952de581af3d7ae126b0
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2023-04-03 10:09:31 -07:00
Ankush Mitra
964752c27c video: driver: Remove hard parent dependency
Remove hard parent dependency
adjust it accordingly.

Change-Id: I8d5de2ba4199570f366745b980b451099467ebaa
Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
2023-03-09 12:05:19 +05:30
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
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
Ankush Mitra
1df215f203 video: driver: Move adjust/set control functions to common/platform.c
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>
2022-11-22 23:01:17 +05:30
Govindaraj Rajagopal
3560442234 video: driver: add resource ops macro support
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>
2022-10-20 12:18:25 +05:30
Darshana Patil
c4beadb5d2 video: driver: fixes for upstream/downstream driver compilation
- 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
2022-08-22 16:51:31 -07:00
Gaviraju Doddabettahalli Bettegowda
9789b56a49 video: driver: add change to support slice mode decode
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>
2022-08-01 17:53:54 -07:00
Manikanta Kanamarlapudi
2e52eecb78 video: driver: add vui timing info control
Add vui timing info control with default
value as disabled in driver.

Change-Id: Ibaa45303fe389a0120d487fe3b6ff336e721f359
Signed-off-by: Manikanta Kanamarlapudi <quic_kmanikan@quicinc.com>
2022-08-01 17:21:57 -07:00
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