Commit Graph

60 Commits

Author SHA1 Message Date
Stanimir Varbanov
21974f4a60 video-driver: Move register manipulation functions
Move register manipulation functions in a common variant
file (msm_vidc_variant).

Change-Id: Ic92a264b47b4d90efcfb4389e30d2749a23f792b
Signed-off-by: Stanimir Varbanov <quic_c_svarba@quicinc.com>
2022-08-26 09:42:41 -07:00
Stanimir Varbanov
8b003fb153 video-driver: Abstract platform resources
Move clocks, gdsc, bandwidth resources out of venus_hfi and
use the ops in variant and venus_hfi code.

Change-Id: I1be77c9d384f4eef2cb8085b75c39dc3fd3eeb86
Signed-off-by: Stanimir Varbanov <quic_c_svarba@quicinc.com>
2022-08-25 19:26:32 -07:00
Stanimir Varbanov
a558b04808 video-driver: Delete not used clock_config_on_enable op
The operation is not used anywhere, delete it.

Change-Id: I4fe7cd41d63ea1b1e0792de6b3e98757860629d8
Signed-off-by: Stanimir Varbanov <quic_c_svarba@quicinc.com>
2022-08-25 14:06:52 -07:00
Stanimir Varbanov
b52b9fd3c1 video-driver: Drop init_interrupt op
The init_interrupt op is not used out of variant, lets
remove the op and used the functions directly.

Change-Id: I8f97cf503503b7f30e824843a5bd9d93c702241a
Signed-off-by: Stanimir Varbanov <quic_c_svarba@quicinc.com>
2022-08-25 14:06:31 -07:00
Stanimir Varbanov
cca051abf4 video-driver: Setup ucregion from boot_firmware op
On all places ucregion setup is done just before calling
boot_firmware, move setup in boot_firmware op and remove
ucregion_setup op.

Change-Id: I91a9a72d3b88eef91e82e19b9d8629e9731211f5
Signed-off-by: Stanimir Varbanov <quic_c_svarba@quicinc.com>
2022-08-25 14:06:03 -07:00
Mahesh Kumar Sharma
7d00efc5dc video: driver: fix encoder output buffer size requirement
For some resolutions memory requirement was coming as 4 * yuv_size
and for CQ/RC_OFF it was 8 * yuv_size. With this fix it will be 
max 2 * yuv_size (+ 25% for 10 bit). Fix typo in 720P resolution check.

Change-Id: Ib5908f1eef8dca92dac46c5c195cd47ba28a4df4
Signed-off-by: Mahesh Kumar Sharma <quic_smahesh@quicinc.com>
2022-08-22 16:00:50 -07:00
qctecmdr
1ee1d9c8e5 Merge "video: driver: define slice delivery as boolean control." 2022-08-03 10:39:31 -07:00
Dikshita Agarwal
f1a32f5a86 video: driver: define slice delivery as boolean control.
Make slice delivery a boolean control instead of menu.

Change-Id: Iedf8e0df882d61e82661c7f557473d3f7b49215a
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-08-02 12:28:44 +05:30
Mihir Ganu
ce4198e97f video: driver: Update IRIS3 DDR line buffer BW calculation
Remove the temporary 2-pipe condition for DDR line buffer
write calculation for BW.

Change-Id: I75dba3106f0af9f7a6eb43036f86209202e22d5d
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2022-08-01 17:55:20 -07:00
Mihir Ganu
525f1f5071 video: driver: Adjust bandwidth calculations for AV1
Consider AV1 LCU sizes and add AV1 considerations
while calculating bandwidth votes.

Change-Id: I0a6bff1bb142fb0eed44d4c3c458a916d11d6f57
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2022-08-01 17:55:12 -07:00
Akshata Sahukar
c5d589a044 Revert "video: driver: 5 percent increase for vsp and vpp cycles"
This reverts commit 4fa2fc8142ee7aa9da4bf2da7bb6ab52d634ab17.

Change-Id: Iaa0156c0442fdbf928ba03aa2b833340601ff395
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-08-01 17:54:43 -07:00
Vikash Garodia
9f34254da3 video: iris3: Fix the issue in power collapsing video hardware
During power collapse, video driver would power collapse video
hardware followed by video controller.
While power collapsing video hardware, it may happen that video
firmware has already power collapsed the video hardware, since
it is hardware controlled. For certain cases, like XS WD, it
may happen that video hardware may not be power collapsed by
video firmware. In such scenario, skipping power collapse sequence
of video hardware would lead to unhandled transactions from video
hardware.
There is a power status register which can clearly suggest if the
video hardware is power down or not. Added a check to confirm the
power status of video hardware before skipping or executing the
power collapse sequence for video hardware.

Change-Id: Ibd9cd708a259897262fcc6cab27b26aaf37f1b13
Signed-off-by: Vikash Garodia <quic_vgarodia@quicinc.com>
2022-08-01 17:22:18 -07:00
Akshata Sahukar
089b0f125b video: driver: 5 percent increase for vsp and vpp cycles
8k@30 fps encode has a very low margin for sw/fw at 338MHz.
Hence, increase core clock little bit(5%) to move to the next
corner i.e., 366MHz.

Change-Id: Idebde3c726086ec49d1fb0ca4525953dd3a30ba9
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-08-01 17:20:33 -07:00
Mihir Ganu
1e87ceec2b video: driver: Introduce a property to set COMV bufcount
Certain codecs/use cases require larger COMV buffer sizes to achieve
performance. Introduce a property to set COMV bufcount and calculate
COMV buffer size based on the bufcount.

Change-Id: Ib0ed8afe77708dc453cbcc121bcd8606db637152
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2022-08-01 17:19:20 -07:00
Sachu George
b79ec844f2 video-driver: Updating H264 Decoder CMD_BUF size calculation.
Internal Buffer(CMD_BUF) size calculation is changed from (3 * 4) to 48
in firmware for H264 decoder. Aligning with same calculation in driver.

Change-Id: I974bca7d2e128cee24bf237b6f9ea606f386031d
2022-08-01 16:23:49 -07:00
Dikshita Agarwal
7d1fbd07cf video: driver: redefine private v4l2 macros in common file
Define vidc macros corresponding to private v4l2 macros
defined in v4l2_vidc_extensions.h file in msm_vidc_internal.h
and use the same wherever applicable for successful
compilation of upstream driver.

Change-Id: I2c7b3741d29996beb35b08b9c6dbd88876bb6ca6
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-08-01 17:59:08 +05:30
Dikshita Agarwal
88dc4a0593 video: driver: handle private codecs defines
Move the usage of v4l2 macros in helper functions to
avoid compilation issues on upstream kernel with private
codec defines.
Use vidc macros defines in code instead of v4l2 defines
wherever applicable.

Change-Id: I43d7deb4f84c502689ceaec3273803444f30f379
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-07-29 12:37:03 +05:30
Dikshita Agarwal
c5c78e3ba2 video: driver: move v4l2 to vidc mappings to target specific file
Move mapping of v4l2 to vidc macros for codec, color format,
color primaries etc to target specific file to restirct the
usage of private v4l2 defines to target specific file.

Change-Id: Ie83968cb944c756e55b6514c496c0b23c5d16413
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-07-29 12:30:10 +05:30
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