Commit Graph

81 Commits

Author SHA1 Message Date
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
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
Govindaraj Rajagopal
c148cf0bb5 video: driver: add heic 10bit image encoding support
- fix 10bit internal buffer allocation handling
- profile: MAIN_10
- pixfmt: linear 10bit(MSM_VIDC_FMT_P010).

Change-Id: I49ffd221927e5eb59915405ff62c038ae05b84f3
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-03-23 14:00:00 +05:30
Govindaraj Rajagopal
d238d03c1b video: driver: refine image session handling
Amended below logics for image session.

- set constant quality
- set tier: V4L2_MPEG_VIDEO_HEVC_TIER_MAIN
- frame_rate: 1
- enable subframe metadata
- stage:
	- image encode: 2 stage
	- image decode: 1 stage
- pipe: 4(work_route)
- power mode: max_quality.

Change-Id: I67acd5284910e7cbe26446b5dfc526d002b98981
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-03-22 12:26:54 +05:30
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
Akshata Sahukar
479023c98c video: driver: Align buffer macros file with hfi file CI: 29354708
Align hfi_buffer_iris2.h file with hfi interface file
hfi_lx_mem_v1.0_doc.h.

Change-Id: Ie3811f58a94798d135ccfa1cb15d24900c2629d3
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-03-17 11:09:39 -07:00
Govindaraj Rajagopal
f4045ecbd6 video: driver: enable image encode and decode support
Added change to enable image encode and decode support.

Decoder:
    - codec: hevc
    - input buffer size: yuv size
    - run as turbo session
    - all intra session
    - disable dcvs & batching
    - ignore admission control(skip mbps, mbpf check)

Encoder:
    - codec: hevc
    - rc mode: CQ
    - profile: MainStillPic
    - all intra session
    - output buffer size: 2 * yuv size
    - output dimension: 512 x 512
    - disable dcvs & batching
    - ignore admission control(skip mbps, mbpf check)
    - skip scaling check
    - hfi: set grid enable & disable time_delta based rc.

Change-Id: I0af47de1406a53d8d8bf1969a65b3a390b0aacb5
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-03-13 18:44:11 +05:30
Govindaraj Rajagopal
6d97dd3795 video: driver: refine queue work functionality
[1] remove unwanted switch cases to reduce code complexity
[2] refine queue_response_work functionality.

Change-Id: I91aabb2eb4c64caea09a26895358544972a7d427
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-03-09 23:41:35 +05:30
qctecmdr
67ac13840f Merge "video: driver: align buffer hfi interface file with CI: 29135164" 2021-03-04 15:25:10 -08:00
Akshata Sahukar
11642f3144 video: driver: align buffer hfi interface file with CI: 29135164
Align hfi_buffer_iris2.h file with corresponding hfi
interface file.

Change-Id: I2af476ad71e4aa99c93492be7d358087a38c79ce
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-03-04 10:33:31 -08: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
Darshana Patil
596ca194de video: driver: add thumbnail and priority support
- add thumbnail mode and priority in database.
- modify output min count for thumbnail session
- deprecate is_turbo_session.
- deprecate flags variable in instance structure and
  use database entries.

Change-Id: I04a3386f1e2eb9fb97bd550d6f169f9510f462c8
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-03-03 18:13:09 -08:00
Maheshwar Ajja
b297e04dee video: driver: initialize subscribe parameters
Initialize subscribe parameters before input port settings
change event from firmware to avoid uninitialized subscribe
params usage in video driver.

Change-Id: I39a1e6646a845836a406193ace7a5fb71edee192
Depends-On: I07c7c8b4faaccc896249b2da84148ec05c2047da
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2021-03-02 17:04:40 -08:00
Maheshwar Ajja
395d4a9ff5 video: driver: amend interlace detection logic
As per HFI_PROP_CODED_FRAMES details, 0x0 is field interlace,
0x1 is progressive and 0x2 is adaptive frame field bitstream.
Treat 0x1 as progressive and both 0x0 and 0x2 as interlace in
driver.

Change-Id: I07c7c8b4faaccc896249b2da84148ec05c2047da
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2021-03-02 09:44:17 -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