Commit Graph

194 Commits

Author SHA1 Message Date
Dikshita Agarwal
ea38b901b7 video: driver: update msm_media_info to use vidc colorformat
Update all functions in msm_media_info.h to use vidc color formats
instead of v4l2 color formats macros to restrict the usage of private
color format defines in only helper functions.

Change-Id: Ib308c76af7b16ddac93023202191a47b21d68f5c
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-07-27 15:40:05 +05:30
Deepa Guthyappa Madivalara
b4b05a5f97 video: driver: allow turbo for av1 and concurrent sessions
allow turbo clk for av1 session or concurrent session
otherwise limit to nominal always

Change-Id: If2280bb3756e99cda018c7ec1767aa1c32e36228
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2022-06-24 16:49:42 -07:00
qctecmdr
e90c0c454a Merge "video: driver: update bitstream buffer size calculation" 2022-06-20 16:50:00 -07:00
Deepa Guthyappa Madivalara
197328a67e video: driver: update bitstream buffer size calculation
calculate bitstream buffer size using firware macro

Change-Id: I1a06007ae8cd2852d70a426ba57119563813ebc5
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2022-06-15 11:52:56 -07:00
Mihir Ganu
78615ba9fc video: driver: Calculate AV1 VSP cycles using perf model
Calculate AV1 VSP cycles using calculations in Kalama perf model.
For legacy codecs, VSP cycles are still calculated using
legacy MB_CYCLES_VSP.

Change-Id: I2535924d650bffd4da32e187fe9e84a27d03ad37
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2022-06-10 13:10:08 -07:00
Mihir Ganu
ec484c856b video: driver: Optimize HEVC Bin buffer allocation
Optimize HEVC Bin buffer allocation by allocating 25% additional
bitstream buffer size for 10 bit HEVC usecase and avoiding the
extra memory allocation for 8 bit usecases.

Change-Id: Iebbedf43e80fad852807349cbe7f70cf7a632a73
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2022-06-02 10:59:49 -07:00
qctecmdr
12c5ef4768 Merge "video-driver: add to support DolbyVision metadata" 2022-06-01 23:48:24 -07:00
qctecmdr
395e8686ec Merge "video: driver: Use max bitrate depending upon session" 2022-06-01 21:40:44 -07:00
Deepa Guthyappa Madivalara
0160053f46 video: driver: Use max bitrate depending upon session
1. Host will use HQ quality mode for all INTRA encoding case
2. Cap bitarate and bit rate boost to max bitrate of current
   session config

Change-Id: I8e8d19998ebeff992c290fbd18c072b2b93ffef2
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2022-06-01 11:36:14 -07:00
Zhongbo Shi
f781c619a9 video-driver: add to support DolbyVision metadata
1. add DolbyVision metadata cap and V4L2 id;
2. Increase decoder persist buffer size;
3. Increase decoder output meta buffer size;
4. Increase encoder input meta buffer size;
5. Parse buffer overflow flag and set buffer flag
   accordingly;

Change-Id: I8fa5e89068dd479033d28f627e585edc3a1c58bb
Signed-off-by: Zhongbo Shi <quic_zhongbos@quicinc.com>
2022-06-01 16:29:30 +08:00
Mihir Ganu
444e7763ee video: driver: Optimize encoder bin buffer size
Reduce bin buffer size to detect buffer overflows in first
stage, which allows frame to be re-encoded with a different QP.

Change-Id: Ifaa5f744491ba35ceee164afeae7d9de90f81e18
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2022-05-25 16:30:18 -07:00
Vedang Nagar
dd262f5916 video: driver: Add Complexity vs. Operating Rate handling
For Quality mode decision, Complexity and Operating rate
are handled as below -
[1] If Complexity and operating rate both are set,
    then for NRT, complexity is honored, and operating
    rate can be adjusted. But for RT, Operating Rate is
    honored and complexity can be adjusted.
[2] If only Complexity is set, then complexity is honored.
[3] If only Operating rate set then Operating rate is honored
[4] If None set, then upto encoder to decide

Change-Id: Ib8008551d5ee7a9506f4d1586ed7a3ae967ac54b
Signed-off-by: Vedang Nagar <quic_vnagar@quicinc.com>
2022-05-19 23:02:11 +05:30
Mihir Ganu
094b4c057c video: driver: Increase vpp cycles for specific AV1 content
AV1 bitstreams can be encoded with non-recommended tile settings
which reduce pipe efficiency when 128x128 superblocks are used.
Increase vpp cycles when 128x128 superblocks are detected.

Change-Id: I14b42363fe36116144e2a2a4bbf67cd9cc26632b
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2022-05-18 10:33:28 -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
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
Mahesh Kumar Sharma
e323f28384 video: driver: set Max QB to 25 upto 4k@60 fps
Set max QB to 25 upto 4k@60 fps.

Change-Id: Iad23e86c5b67323cde691db8523a2a99500ace3c
Signed-off-by: Mahesh Kumar Sharma <quic_smahesh@quicinc.com>
2022-04-21 14:56:10 -07:00
Akshata Sahukar
ae362a4130 video: driver: Set 1 stage for Byte based Slice mode
Set 1 stage for Byte based Slice mode.

Change-Id: I9924535234e202e83d6f33b03ebc7de578e7aa48
Signed-off-by: Akshata Sahukar <asahukar@quicinc.com>
2022-04-08 22:02:14 -07:00
qctecmdr
f1918f5314 Merge "video driver: calculate power based on max rate" 2022-03-31 07:49:35 -07:00
qctecmdr
c97bbb1e57 Merge "video: driver: update quality mode w.r.t complexity configuration" 2022-03-30 18:38:09 -07:00
Deepa Guthyappa Madivalara
ab684e15f6 video driver: calculate power based on max rate
1. Remove load based admission control for decoder.
2. For decoder, use max of frame rate, operating rate,
    timestamp rate and input rate for power calculations.
3. For encoder, use max of frame rate and operating rate
    for power calculations.

Change-Id: Ibdb2d4b29438d7f656a27771953d10e0a0e72edd
2022-03-30 13:03:24 -07:00
qctecmdr
8c00483b2c Merge "video: driver: decouple min quality, CAC and quality boost" 2022-03-30 10:28:20 -07:00
Vikash Garodia
f9c0bfcb9b video: driver: update quality mode w.r.t complexity configuration
Existing video driver allows complexity configuration to update
quality mode only for non realtime sessions.

Change-Id: Ic4eb5b1c8904fffe2baa1606db37285f53e918b3
Signed-off-by: Vikash Garodia <quic_vgarodia@quicinc.com>
2022-03-28 11:51:05 +05:30
Mihir Ganu
0acf5e0082 video: driver: Increase persist buffer size for AV1 metadata
Increase AV1 persist buffer size to accommodate AV1 HDR and
other metadata.

Change-Id: Ib29ed9eb18e39e6f711c5bed7a67366161bf053b
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2022-03-24 08:04:25 -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
qctecmdr
2e1a127d25 Merge "video driver: calculate power based on input queuing rate" 2022-03-22 19:08:47 -07:00
Deepa Guthyappa Madivalara
dc38176276 video driver: calculate power based on input queuing rate
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>
2022-03-22 14:21:35 -07:00
Mihir Ganu
96358cee7d video: driver: Add support for AV1D IBC feature
Add support for AV1D Intra-Block Copy (IBC) feature. This requires a
dedicated internal buffer (HFI_BUFFER_IBC_AV1D), which was previously
part of LINE buffer. A new internal buffer type called
HFI_BUFFER_PARTIAL_DATA is introduced, and this buffer type holds
HFI_BUFFER_IBC_AV1D for AV1D. HFI_BUFFER_PARTIAL_DATA is mapped to
NON_SECURE_PIXEL context bank for non-secure and to SECURE_PIXEL
context bank for secure use case.

Change-Id: If7ae22495f9981f275d54acc342c25ccdfc0c7b9
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2022-03-16 16:48:08 -07:00
Mahesh Kumar Sharma
e3f2139586 video: driver: decrease heap usage for 24 session support on IRIS3
Originally h26xd and vp9 display buffer was allocated from FW heap.
In order to decrease heap usage for 24 session support on IRIS3,
FW has moved display buffer from FW heap to persist buffer.
Adding this support in driver.

Change-Id: If865748e7c0df5fecd26905f7ef343f465f69967
Signed-off-by: Mahesh Kumar Sharma <quic_smahesh@quicinc.com>
2022-02-28 10:37:41 -08:00
Chinmay Sawarkar
48f1d09c2f video: driver: AV1 power changes
AV1 power changes.

Change-Id: If05c52cb6f30152b773389cc4127bf2514765170
Signed-off-by: Chinmay Sawarkar <quic_chinmays@quicinc.com>
2022-02-17 17:15:37 -08:00
Chinmay Sawarkar
776fb518c8 video: driver: update iris3 power collapse sequence
1. Set Iris CPU NoC to Low power
2. Remove Debug bridge Low power
3. Reset MVP QNS4PDXFIFO
4. Remove Disable GCC_VIDEO_AXI0_CLK clock

Change-Id: I4a88589cacc894dc5717e8ccb5f731f62e82202d
Signed-off-by: Chinmay Sawarkar <quic_chinmays@quicinc.com>
2022-02-07 18:32:39 -08:00
Chinmay Sawarkar
f7c4e2fe65 video: driver: Update power down sequence
Copy fixes in power down sequence from Iris2 to Iris3.

Change-Id: I0ec94dbe064e10b6c4172b206561d8951c00a26b
Signed-off-by: Chinmay Sawarkar <quic_chinmays@quicinc.com>
2022-02-04 15:53:23 -08:00
Chinmay Sawarkar
784cc63c21 video: driver: reset video_cc_mvs0_clk_src clock_rate
Reset video_cc_mvs0_clk_src value to resolve MMRM high video
clock projection issue.

Change-Id: Ieb937dfdc7d48e1a95a0052a32189d00eeac70cf
Signed-off-by: Chinmay Sawarkar <quic_chinmays@quicinc.com>
2022-02-04 15:39:48 -08:00
Chinmay Sawarkar
000a10db56 video: driver: Port fixes from iris2 to iris3
1. Change format specifier and API clean-up
2. Remove HEIC from Lossless Encoding
3. add support for timestamp reorder
4. alter bitrate_mode child adjust sequence
5. disable dynamic low latency

Change-Id: I57d8150bac123cdfd8a0d14a2422246b87b4abfa
Signed-off-by: Chinmay Sawarkar <quic_chinmays@quicinc.com>
2022-02-03 16:02:23 -08:00
Mihir Ganu
4a74cbd8bd video: driver: Update IRIS3 HFI buffer macros
Update HFI buffer macros to avoid declaring variables
after statements.

Change-Id: If7584d14e426be1a2f681dae36334d4913b06a90
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2022-02-03 13:01:47 -08:00
Mihir Ganu
9bacc5d124 video: driver: Add HFI and internal buffer changes for AV1 DRAP
Add changes for AV1 DRAP (Delayed Random Access Point) handling:
1) Add config in kalama database to control DRAP and the HFI property
to set DRAP config.
2) Update buffer calculations:
- When DRAP is disabled, COMV buffer must be allocated
and PERSIST buffer must be allocated with total_ref_count = 0
- When DRAP is enabled, COMV buffer must not be allocated -
it is part of PERSIST buffer. Persist buffer must be allocated with
the max_width, max_height and total_ref_count configured for DRAP.

Change-Id: I2d2e8fd3f63ea8f9fc2845acd0b4e16ba4776a6b
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2022-02-01 15:32:01 -08:00
qctecmdr
960ac904d2 Merge "video: driver: Add support for AV1 film grain" 2022-01-19 18:38:07 -08:00
Mihir Ganu
85730716a8 video: driver: Add support for AV1 film grain
Add support to handle AV1 bitstreams with flim grain
for both UBWC and linear colorformats.

Change-Id: Ica07853d992c566c3471dc007ad8c22aba796dd4
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2022-01-18 12:43:59 -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
Govindaraj Rajagopal
dd64dc7cd3 video-driver: Update BW calc for diwali
Update BSE TLB read calculation for
H264 decoder.

Change-Id: I7fa715329927ec1c2b43d71d2492a643f26183af
Signed-off-by: Priyanka Gujjula <quic_pgujjula@quicinc.com>
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-01-13 17:29:22 +05:30
Govindaraj Rajagopal
aeabb39378 video: driver: Change format specifier and API clean-up
-Removed unwanted functions
-Removed unwanted part of code from function definitions
-Added proper format specifier according to the data type.

Change-Id: I700202f1cf588506b329d202ce3e2729c027dcae
Signed-off-by: Gaviraju Doddabettahalli Bettegowda <quic_gdoddabe@quicinc.com>
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-01-13 17:29:22 +05:30
Mihir Ganu
e8a948045a video: driver: Update AV1D Line buffer calculation
For legacy codecs, the line buffers are calculated by assuming
OPB size (worst-case). However, for AV1D, the line buffer size
can be smaller than required if OPB is assumed. Hence, add an
exception for AV1D.

Change-Id: I25b6ae630994e8c4c216499c10d7c217ad550d2b
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2022-01-12 11:11:43 -08:00
qctecmdr
1829bfb9a4 Merge "video: driver: Add changes to enable AV1 Decoder" 2021-12-10 17:09:19 -08:00
Mihir Ganu
04304a466f video: driver: Add changes to enable AV1 Decoder
Add definitions, controls and codec-specific handling
to enable AV1 Decoder.

Change-Id: Ica2f4e298e43aa713188d3374f8705688d0ed912
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2021-12-09 16:59:23 -08:00
Vikash Garodia
f3ff48e82f video: driver: reset video_cc_mvs0_clk_src clock_rate
Reset video_cc_mvs0_clk_src value to resolve MMRM high video
clock projection issue.

Change-Id: I0c549d7537a82792e9de708c96c265f0dce5908d
Signed-off-by: Vikash Garodia <quic_vgarodia@quicinc.com>
2021-12-09 17:17:52 +05:30
Vikash Garodia
3693d8b27c video: driver: skip prepare/unprepare for video_cc_mvs0_clk_src
The clock video_cc_mvs0_clk_src will be automatically prepared and
unprepared when video core cpu clock is prepared and unprepared. So
skip explicit prepare/unprepare video_cc_mvs0_clk_src from video driver.

Change-Id: Ibe41b0b4ecfce27959c29d8024c91af8c1162aa7
Signed-off-by: Vikash Garodia <quic_vgarodia@quicinc.com>
2021-12-09 17:14:27 +05:30
Vikash Garodia
ad2c274bbe video: driver: update power collapse sequence
Following changes are done in power collapse sequence
1. AXI2AHB bridge is reset during power collapse.
2. controller regulator is disabled after disabling the
   clocks.
3. disable core clock before axi clock.

Change-Id: I8be672728f349620deea22950597ca7766078697
Signed-off-by: Vikash Garodia <quic_vgarodia@quicinc.com>
2021-12-09 17:05:50 +05:30
Mihir Ganu
1c5f469b71 video: driver: Add HFI changes for AV1 Decoder
Add the required codec properties and HFI definitions to enable AV1D.

Change-Id: Ib098ed17f8b8e1fe9403f966a2dab97a3c9f96de
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2021-12-02 12:44:12 -08:00
Mihir Ganu
3c17bb9c3d video: driver: Use correct macros for fps calculations
Use correct macros and values for fps calculations
in kalama platform files.

Change-Id: Ib58903228032b1107363a98ce21b3bcb95aca0f5
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2021-12-01 10:01:28 -08:00
Praveen Chavan
53d5efcd7c Merge branch 'video-kernel-waipio.lnx.1.0' into kailua_1.0 2021-11-29 13:38:02 -08:00