Commit Graph

194 Commits

Author SHA1 Message Date
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
Mihir Ganu
6b548ba181 video: driver: Update VP9 Line buffer size for QP metadata
Update VP9 decoder Line buffer size by considering VP9 frame
QP Metadadta.

Change-Id: I9b7b5ed32378af19fa3dd1106515b05974ab1a83
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2021-06-03 10:29:41 -07:00
Govindaraj Rajagopal
a33041f799 video: driver: add scaling checks for encode session
Encoder supports downscale with scaling ratio upto 1/8 of width
and 1/8 of height. So added necessary scaling checks at streamon.

Change-Id: I3a29b43c79cf4e693ba2c0d9f98ec24410d50fbd
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-06-02 11:26:12 +05:30
Govindaraj Rajagopal
8d81cd480b video: driver: tune clock and bus vote calculation
Use bitstream fps in clock and bus vote calculation, if
bitstream detected fps is higher than client set rate.

Change-Id: I58fa1a8725086c112796b3ce5172a39f322e178e
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-05-27 14:32: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
Darshana Patil
e5ec6843e8 video: driver: modify max mapped output count
adjust MAX_MAP_OUTPUT_COUNT based on resolution
to enhance performance and reduce memory pressure.
- For 8K session: count = 20
- For 4K session: count = 32
- For 1080p session: count = 48
- For all remaining sessions: count = 64

reduce MAX_DPB_COUNT to 32.
reduce DEFAULT_MAX_HOST_BUF_COUNT to 64.

Change-Id: I0e6d25121947524b843e9cce96b75871aba174af
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-05-24 16:58:19 -07:00
Akshata Sahukar
e54ba4a130 video: driver: Align hfi buffer macro file with CL: 30790445
Remove SE stats Buffer calculation to align hfi buffer macro file
with CL: 30790445.

Change-Id: Ia5db786e5ba1fddafe6c25555b3f45ea915b389e
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-05-21 16:18:45 -07:00
qctecmdr
a4038a8565 Merge "video: driver: fix core lock acquire and release sequence" 2021-05-20 18:12:48 -07:00
Govindaraj Rajagopal
53578c8ec2 video: driver: fix core lock acquire and release sequence
[1] Added return type to strict_check() api and bail out if
    strict_check fails.
[2] Fix all the failures with #1.
[3] Added WARN_ON() for strict_check failure.
[4] Ensured &core->lock is acquired before calling below api's.
    - __write_register
    - __write_register_masked
    - __iface_cmdq_write_relaxed
    - __suspend
    - __resume
    - venus_hfi_core_init
    - venus_hfi_core_deinit.

Change-Id: I7f0a3ca6c2aec2758220c90bff9260367f10820b
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-05-20 14:34:11 +05:30
Vikash Garodia
cc037ae3de waipio: driver: Fix decoder log during low latency
In low latency mode, for a decode session, low latency
is being configured properly. But the log still indicates
that low latency is not enabled. The change fixes the same.

Change-Id: I65a88fb6dff639dd78522316e839fc05d43ec39c
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2021-05-20 10:08:50 +05:30
qctecmdr
288887b59d Merge "video: driver: hb layer buf count and hfi buffer macro CL:30683524 changes" 2021-05-15 14:39:13 -07:00
Akshata Sahukar
724e5f525e video: driver: hb layer buf count and hfi buffer macro CL:30683524 changes
[1] Update enc input min count buffers count when HB layer encoding
    is enabled.
[2] Also align hfi buffer macro file with CL: 30683524.
[3] This change also fixes VPSS buffer size mismatch issue.

Change-Id: I63d91ff204f1e11e71e3c0633b582c47c5e9b102
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-05-14 21:40:28 -07:00
Govindaraj Rajagopal
003d8a79fa msm: vidc: Add support of timestamps based frame rate
Add timestamp based frame rate detection.

Change-Id: Id0c522e01769ea6cf214c7b84c11faae6049e2ef
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-05-12 21:50:05 +05:30
Akshata Sahukar
6ec3f9e960 video: driver: Align buffer interface file with CL: 30395412
Align driver buffer macro interface file with firmware file.

Change-Id: I5f3d2a581150452f9becb2dec871040ced6803c5
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-04-29 11:51:49 -07:00
Govindaraj Rajagopal
e0637a30b8 video: driver: refine power settings
Added change to address below 2 issues.

[1] buffer_counter is not getting incremented for batching usecase,
it always runs with max clk and bus votes. So moved buffer_counter
increment logic to msm_vidc_queue_buffer, so that it will be used
for all usecases.

[2] iris2 clock calculations were using core->capabilities but all
needed infos were present in inst->capabilities. So junk values from
core->capabilities was used in clock calculations and values always
shooting to highest corner.

Change-Id: I0927899244b5de2bd46d238100fdaecd78c6fe28
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-04-27 18:58:51 +05:30
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
Govindaraj Rajagopal
b1fbc46396 video: driver: select target and vpu variant based on dtsi
- enable conditional compilation based on defconfig
- compile only needed files based target & vpu variant
- enabled stubs to avoid compilation issues, for all
  target variant and vpu types
- add support for qcv(same lunch combo) for different
  PT & VT chipsets.

Change-Id: Ic446349fd1532885d7a2e94895d807c62f1ab6e4
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-04-15 20:14:04 +05:30
Govindaraj Rajagopal
d6890cd14a video: driver: print buffer_name instead of hex value
Handled below items as part of this change.

- print buffer_name instead of hex value.
- enable dcvs only for realtime sessions.
- enhanced max_input_data_size handling at
  msm_vidc_scale_power.

Change-Id: If5ac810f4e020bee54364161596c5547af94161a
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-04-03 00:43:18 +05:30
Mihir Ganu
6368b78d5f video: driver: Align buffer macros with HFI file CI: 29670767
Align hfi_buffer_iris2.h file with hfi interface file
hfi_lx_mem_v1.0_doc.h.

Change-Id: Ie44ee4be1ae5df440906411c7cdfa4b8a8a01194
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2021-03-30 13:37:56 -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
Govindaraj Rajagopal
1524ddc445 video: driver: remove smmu_fault_work_handler
Remove separate fault_work_handler and print all needed
debug info as part of smmu_fault_handler callback itself,
to avoid race between fault handler invocation and core
deinit sequence.

Change-Id: Ib47e3d457a5a3e33497c71d5920382cb43baed79
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-03-26 16:37:52 +05:30
Govindaraj Rajagopal
a7bdc410ef video: driver: add support to print noc error log registers
Added support to print noc error log registers at below places.

- smmu_fault_handler path
- handle_system_error path.

Change-Id: I9e195bd82a2058f533df8713368e61f57b537b87
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-03-25 16:10:49 +05:30