Commit Graph

115 Commits

Author SHA1 Message Date
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
Mihir Ganu
9456cc40fb video: driver: Add support for kalama/iris3 platform
Add the required config and platform files to enable
kalama platform with iris3 VPU.

Change-Id: Ia65d2212b946d0d37fc99e30e25fe408882bdec3
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2021-11-18 22:56:07 -08:00
Priyanka Gujjula
e786da48eb video: driver: Use max fps from inst caps
Use maximum framerate from published
instance caps to make it platform
agnostic.

Change-Id: I319768e722774969287abb9e782ddbece7593ff9
Signed-off-by: Priyanka Gujjula <quic_pgujjula@quicinc.com>
2021-10-25 21:38:58 +05:30
qctecmdr
4d51b2ba26 Merge "video: driver: bump clockrate and bandwidth for 960FPS" 2021-09-30 18:43:44 -07:00
Darshana Patil
9f22d1b8bc video: driver: bump clockrate and bandwidth for 960FPS
increase clockrate and bandwidth by 25percent for
960fps decode session and disable dcvs.

Change-Id: I40aef0a9b8f0950b559ee301549869e20e881a40
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-09-29 15:00:20 -07:00
Govindaraj Rajagopal
caeaca6ccd video: driver: disable and unprepare clock source to update MMRM count
[1] Currently enable/disable clock(video_cc_mvs0_clk_src) not called. So
updating clock reset value to MMRM is getting skipped. So MMRM has high
projection
[2] __scale_clocks() api is not considering scaling factor, while
setting clock rate.

Added change to address above 2 issues.

Change-Id: I4e96556f9b9d659c436e77d03f8d0dd471a50226
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-09-28 19:06:14 +05:30
Govindaraj Rajagopal
03471f2f11 video: driver: set clk_rate to zero before clk_disable
Video driver clk scaling is through mmrm. So without informing
to mmrm if we disable_clk, then mmrm will hold stale peak_current
values and that will lead to incorrect calculations at mmrm side.
So always request to set lowest clk corner to mmrm before calling
clk_disable_unprepare() api.

Change-Id: I3e54249430ec4e886afb42f5af6863c7e40686c4
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-09-06 18:10:01 +05:30
qctecmdr
e902db01fa Merge "video: driver: improve error handling on read_register" 2021-08-19 18:32:27 -07:00
Darshana Patil
ec7093a322 video: driver: return bootup timeout error
return bootup timeout error

Change-Id: I0123bdd8c9f23b4d680085c1bb8dd2620312c60f
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-08-18 11:03:58 -07:00
Govindaraj Rajagopal
3d9556402b video: driver: improve error handling on read_register
Currently video driver ignoring error value returned by
__read_register() api. So added changes to improve error
handling.

Change-Id: Ia3968f0f900915b46b96c5e790af9be02389e841
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-08-18 08:38:32 +05:30
Govindaraj Rajagopal
10a6e51ef2 video: driver: use readl_relaxed_poll_timeout instead of register_read
Upstream recommends to use readl_relaxed_poll_timeout instead of reading
register in a loop with sleep. So replaced with readl_relaxed_poll_timeout
in all possible places.

Change-Id: Ide1758314128751a6876678d4265bb77c52de25f
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-08-13 14:04:51 +05:30
Akshata Sahukar
fdf0894ad1 video: driver: Align buffer macro file with CL: 32091493
Align driver buffer macro file with fw file of CL: 32091493
to pick HFI_BUFFER_NON_COMV_ENC buffer optimization changes.

Change-Id: If312f3c97708f32b890fd14bcd8b461bb39083d5
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-07-29 10:29:37 -07:00
qctecmdr
c0c23916cc Merge "msm: vidc: Force nominal for high bitrate decode usecases" 2021-07-02 16:24:53 -07:00
Govindaraj Rajagopal
48dff0980d driver: video: disable dynamic fps detection logic for image session
Image session should run as fast as possible mode and dynamic
framerate detection is not applicable for image session. So
added change to disable that feature for image decode session.

Change-Id: Ifcfeb24d1f70009ba48e9ade77bd765c1b0e8fd7
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-07-02 21:05:52 +05:30
Priyanka Gujjula
e186efc310 msm: vidc: Force nominal for high bitrate decode usecases
Force the clocks to NOM if bitrate nears or exceeds maximum
supported for VP9 usecases.

Change-Id: I917b0f6c624837403fd9f1499a68812acb00b568
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
2021-07-02 11:20:59 +05:30
Priyanka Gujjula
d388f8b5cd msm: vidc: Increase vpp cycles for 960fps use case
Increase vpp cycles to bump frequency to 366MHz
for encoder 960fps use case.

Change-Id: If0f9d0f084dfcefa9f8614ec6774588dec6b7007
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
2021-07-01 09:17:42 +05:30
Priyanka Gujjula
892f8c6647 msm: vidc: update iris2 clock calculation
As per vperf sheet, VSP FW Overhead factor(1.05) needs
to be applied to both entropy mode CABAC & CAVLC.

Change-Id: I93dc00137e0633ac2a79862c58970ba43b515ad6
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
2021-07-01 09:11:31 +05:30
Darshana Patil
c80c5b8bbb video: driver: update cycle count requirement of B frames
Decoder base cycle requirement of B frames has increased to 80.
Also, updated cycle count requirement for Encoder HIER B usecase.

Pulled from CL: 3302650.

Change-Id: I0f56166b7261e161630feeb8793473491dacccd7
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-06-29 13:51:26 -07:00
Maheshwar Ajja
2fc3c64665 video: driver: remove noc error log registers reading
Accessing vcodec subsystem registers without video core clock enabled
will result in register access errors. Core clock might have been
already disabled by video firmware as part of inter frame power collapse.
So do not read vcodec noc error log registers from video driver.

Change-Id: I19a32c377c661aa848fbd463ae59159cca4cfe04
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2021-06-18 16:19:49 -07:00
Priyanka Gujjula
e61b55879b video: driver: Add support for enc auto framerate
1. Calculate framerate based on buffer timestamp
2. If framerate changed and stable for 2 frames,
   update it to firmware and in driver internally.

Change-Id: I7feda86dec8fcfc1dff6defac8c15a97c1b8393e
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
2021-06-17 22:54:34 +05:30
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
qctecmdr
71bb59790c Merge "video: driver: Add encoder complexity to decide power mode" 2021-06-11 01:21:50 -07:00
Akshata Sahukar
973d1f0b38 video: driver: allow adaptive/external blur along with rotation/flip
[1] Allow adaptive/external blur along with rotation/flip.
[2] Update HFI_BUFFER_VPSS_ENC macro to align with CL: 30984523.

Change-Id: Ibca9f273da4a8204f586e952aeb9b2e78b5ff941
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-06-10 11:58:05 -07:00
Vikash Garodia
72699f7278 video: driver: Add encoder complexity to decide power mode
Client can choose to run an encode session to acheive maximum
performance rather than maximum quality.
Add the handling to configure video core accordingly for the
configured video session.
Such configuration is only applicable for non-realtime session.

Change-Id: Ife290b377c844e5b1d3be93b2509c787f8e05c59
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2021-06-10 05:43:00 -07:00
Maheshwar Ajja
c2b39b9056 video: driver: amend power on and power off sequences
Amend power on and off sequences for iris2 video hardware.

Change-Id: Icada0b95ba5990a6911803ee9fa650a296c357db
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2021-06-09 16:42:48 -07:00
qctecmdr
c67713f34e Merge "video: driver: Update session admission and work modes" 2021-06-05 11:13:10 -07:00
Linux Build Service Account
420c0336e4 Merge "video: driver: print more info on debug logs" into video-kernel-waipio.lnx.1.0 2021-06-04 18:19:00 -07:00
Mihir Ganu
3a7632ca4d video: driver: Update session admission and work modes
- To determine if session is admissible, check only the
  decoder input width/height and encoder crop width/height.
- Update session MBPF Calculations.
- Amend work mode setting to consider decoder input width,
  height and GOP size.

Change-Id: If4053c222de2a55ad5b85a8ab96c12c47b145aa3
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2021-06-04 17:08:23 -07:00
Vikash Garodia
e923948da6 msm: vidc: Fix priority level determination
Priority level was not determined at few sequences.
Determine the priority level and set to firmware, if
there is a change in driver and firmware priority.

Change-Id: I97861fd4ce8cfb7cf828a8da9a5ce8ba900280ef
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2021-06-04 21:04:58 +05:30
Govindaraj Rajagopal
1f46168b9f video: driver: print more info on debug logs
Currently driver prints hex values for codec type, pixel
format and port number. So added change to print strings
instead of hex values.

Removed unnecessary logs to avoid overlogging timeout
issues.

Change-Id: Ia44401990797dc20eae0a35631e9ed6a0b094c20
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-06-04 19:26:34 +05:30