In certain scenarios, y_bw_no_ubwc_10bpp and y_bw_10bpp_p010
will be used with unitialized and incorrect values.
CRs-Fixed: 2487664
Change-Id: I292ed33b60c3994886bb3756babc8ab706ceab8b
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
Use max layers allowed in a session to calculate min GOP size
instead of variable number of layers enabled during each frame
encode to avoid GOP size not being multiple of sub-GOP size issue.
Change-Id: I3bb6e5320385acea9cb892c04b586ac3ca8c753f
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
Client expects all the buffers to be returned in certain scenarios
but driver does not return due to decode batching feature. Add
delayed_work functionality to queue batched buffers to video hardware
upon timeout, so that all the buffers will be returned to client.
Change-Id: I926de1da93d941ff2a64bfec1bbd351de2f3a601
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Calculate DDR and LLCC bw simulteneously to avoid
redundant calculations. This reduces number of calculations
required by 50% and hence reduces cpu load.
CRs-Fixed: 2487664
Change-Id: I6e1768cd63d9b6651fbaf4a8ed8d5706929d7743
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
MESE BW vote is not applicable for Kona. We can reduce overall BW
requirement by removing this vote.
CRs-Fixed: 2487664
Change-Id: I7cd6e3937e8884a2e4790a49713bd33aaab9c4bf
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
Ensure the available data size with in the packet before type
casting from a smaller data type to larger data type in order
to avoid information leak or packet out of boundary access.
Change-Id: I8614a8b3f930c87af8aa49f77ea9d768a73ea203
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
If client doesn't request hybrid hierp or sets zero as max
enhancement layer count, then, hybrid hierp is not enabled.
Change-Id: I4284fd5c25d4dc812dac3e134ab5dfc53833bfbf
Signed-off-by: Amit Shekhar <ashekhar@codeaurora.org>
Set single stage work mode for HEIC sessions. Currently, with two
stages, encoded tiles are missing at random.
Change-Id: Iadb59102447e1873e99ae1fd03a1d7b6ce3cba1a
Signed-off-by: Amit Shekhar <ashekhar@codeaurora.org>
Scaling capability are defined in Q16 format. Existing
capability indicates that the capability is 16 times i.e
output dimension can be scaled to 1/16th of input dimension.
As per specification, the achievable ratio is 8.
Change-Id: Ib9e005a055e604d3173dd8cd376d3b6666f2c12c
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
Convert validate_pkt_size macro to an inline function
as this macro definition always returns true.
Change-Id: I9e7eadfe82c041721565c880eca3a46e4e3e98d9
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
Defined a common macro for disable slice boundary
deblocking mode.
Change-Id: Ie163b1268a91f278e8ed6821c88ebff32e80d9cd
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
Use trusted packet size on the received packet and check for
the size of the data received against the expected size before
accessing the packet.
Change-Id: I1bd6008249a0bf4edeec711ec8d23cf7b8dac1f1
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
v4l2_ctrl_get_name may return NULL that leads to NULL
ptr dereference. So added necessay check to avoid ptr
dereferencing if it is NULL.
Change-Id: If1a4ee8fe22e240b278f31888637d22b81b334e1
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Update scaling capability for decoder to reject the
usecase where o/p resolution is less than i/p resolution.
Change-Id: I7cf85db78d51f8dd43da8d4312c92ea982054cb1
Updated encoder scratch1 buffer size macro to
match HFICCB changes. This fixes mismatch in
driver and HFI macro scratch1 buffer sizes.
Change-Id: Ie61058f243dc1895e0af00b78118bbe9dbc54a98
Client is not supposed to queue buffer while driver
is in flush. Return error if client queue buffer
in flush to avoid possible deadlock issues in driver
due to release buffer reference event processing.
Change-Id: Ica2ff40e428f82b9f6d3aa1314f7bf7d322375bd
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
This smoothens the buffer flow and takes care of random
frame drops due to jitter.
CRs-Fixed: 2478892
Change-Id: I27ecb686e3982152b18f3a2fc207ecf59f928dff
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
Tracing all the buffer transactions give clear picture of
session behaviour and is helpful in performance analysis.
CRs-Fixed: 2478892
Change-Id: Ibab23a187af77434e20ce0b1c51de29b9d1731f9
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
When MB_MODE slice is enabled, should use output
width/height to calculate the allowed slice size.
Fix warning log for NV21 format.
Change-Id: I97441cef36484ac6e82ba78b816f96d4b5bf2ab4
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
Possibility of dereferencing userspace ptr in kernel for
invalid cmd. So added check to return error if unsupported
cmd is given as input to ioctl.
Change-Id: I3466fbd06e5b600f748824b9e16bcfdb4438bdef
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Based on session configuration parameters estimate
required cycles and set clock rate and bus bandwidth
to cvp session.
Change-Id: Iba07b304b4258e817d2404e272eb2b52891f9994
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
[1] Some unsupported clip resolution like 1600x1200, firmware rejects
the session during load resources.
[2] Allow interlaced clip playback only if below conditions were met
- resolution <= 1920x1920
- max_mbs_per_frame <= (1920x1088)/256
Change-Id: I67fd5377603c9c9ca577369c18ca6133190dc386
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Remove msm_vidc_calculate_output_buffer_count function
calls while g_ctrl event to avoid overwriting of
buffer count to old buffer count value that is set by
client.
Change-Id: I76135a88948ad7e2845c054a48e9f148bf367abb
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
Fixed encoder reference buffer count to use maximum
number of hier players set by client.
Change-Id: I7fe55aff9ee3ac5065e6cab4af37013577e3c4c0
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
Updated maximun allowed mdbf to support one 8K
session and one 4K session at a time.
Change-Id: I64ad3820aaddf5a3f89f97fe34c158b30f1e3675
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
Modified vbvdelay logic with default behavior as
CBR+. Enable legacy CBR if resolution is < 720p.
Client can overwrite default behavior if
resolution is between VGA & 720p.
Change-Id: I9bd5ede782959780e5a5cb56eda0ae5e344e66aa
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
In case of opaque color format the bit depth will be known with
first ETB. Existing logic calculates output buffer size based on
8-bit which won't be sufficient for 10-bit.
So consider 10-bit by default while calculating encoder output
buffer size.
Change-Id: I51eee2fcb0dc137c596babd04659cd1fc087ebd6
Updated corresponding variables of size_vpss_lb
to align height to 16. This is needed to fix internal buffer mismatch
of H264 decoder with firmware which was caused due to height alignment
to 8. Also updated SIZE_VP9D_LB_FE_TOP_DATA, SIZE_VP9D_LB_PE_TOP_DATA
and SIZE_VP9D_LB_VSP_TOP macros width alignment to 16 from 8.
Change-Id: I308a64ec69ac2a63fae9a9481652119f55834cae
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
Do not reset buffer counts while session is running and
modify in case of insufficient event processing.
Change-Id: I5425e54702339e768f3c3a6182fa62dd7a8b484a
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
Existing logic to calculate buffer size is based on
the max bitrate supported during a secure session. Even
the peak bitrate calculation is not sufficient to arrive
at the required frame size.
Going back to earlier logic based on macroblocks per frame.
CRs-Fixed: 2467242
Change-Id: I0fe1768036f19ad2f1d08222e3ed239be7a2e27c
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
- Consider thumbnail mode while calculating buffer counts
- decide batching in reconfiguration event so that driver
returns proper min buffer count when client query for it
Change-Id: I4d5373e78d43592caf0cef59f2f8801d20014efd
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
As per system requirements this additional bw is needed
for decode session.
Change-Id: Ia435aadcf78e4e2fd7b01ed00633fa2f38729bc6
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
FW provides UBWC_CR_STATS_INFO with every EBD which can be used
to accurately calculate BW requirements. Also renamed reconbufs
to refbufs, which is common to encode and decode.
CRs-Fixed: 2467542
Change-Id: I29afdcd466bd61f455507d30ab7ca951d0e9911c
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
CF and CR cannot be zero. Initialization of Min/Max values
keeps the values within limits, when FW does not provide them.
Also, do not modify CF, CR value based on DCVS. Always use
worst case values.
CRs-Fixed: 2467542
Change-Id: I91ed83cb5c9e1a8cda5775c491d99b97c4043a12
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
Add sanity checks before and after clocks and regulator
operations to get more information if these operations
not functional as expected.
Change-Id: Ib4985113200ed065e6acf6cb7ae406b88cc7f432
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
Set default profile type to avoid error when client
has not set any profile type.
Change-Id: I89b81f5167f65685e47073b5e73d3bd7c4fe81d6
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
driver returns min buffer count to client which includes
extra buffers count which is required for batching even
though batching may be disabled in start_streaming() later.
So decide batching in set format (configuration) to avoid
adding extra buffers count to reduce memory usage in
non-batching cases.
Change-Id: I147f7aaf928074a23c9dcda2dbf69a744cec382d
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
Add new VIDC_BUS log mask for bus parameters
related logs.
Change-Id: If933c8c88ec2e0ccb283606da7f46a3c3c49756a
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
pkt->msg_size can be corrupted, that leads to OOB access. So added
additional conditional check to avoid OOB access in debug queue
packet handling.
Change-Id: I360812c40369ecef2dd99464d400661bc785074b
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Add support to disable both auto blur and
external blur.
Change-Id: I5200f738ffa5849a3e840f90f0da66c38607ceae
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
Use the existing batch enable variable instead of extra
variable decode_batching.
Change-Id: Ic7875caf2b0d2c47d77b0c0c0ce9b5792920cafc
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
Decode session needs UBWC CR statistics for BW calculations.
Hence need to enable this exetradata by default.
CRs-Fixed: 2467542
Change-Id: I3955a0b09cf82f97478c31704be6b16f297b011b
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
during load resource firmware will check input buffer type
against requested buffer type. If there a mismatch it will
throw an error. So cleared non-requested buffer from the
scratch buffer list
Change-Id: Ifabf532982a393d4fc356ff3cad0ca3fd715fce0
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Existing code updates the device clock before cx ipeak logic.
As a result, the cx ipeak takes a decision based on updated
clock rather than the clock at which the device was running.
With the change, device clock is updated after the cx ipeak
is decided.
Change-Id: Icfde29176f8adb3a12c68a611f47b83ca7a8e4a9
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
Perf mode can be either predefined or can be decided dynamically.
It is configured differently for different video hardware versions.
Perf mode is now updated with below
1. Remove multicore calculation as it is not applicable for single core
hardware.
2. Rate control type CQ is considered during load calculation
3. If the clocks are available, keep higher perf mode, unless restricted
by the hardware specification.
CRs-Fixed: 2462264
Change-Id: I9328e07ea3d1667b15a431c624112f1e8f8c92e0
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
operating rate setting to firmware is not required for decoder.
Change-Id: I271a42822f4a00e95d875400e5ad273697c94ab1
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Video port resolution can be updated during reconfig event itself.
With this, reconfig height and width was removed. Also relevant
code cleanup was made accordingly.
Change-Id: I4fb38563b4c747eb356f28b7df7e99bd397ff8d1
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
Fix to check f/w logging route based on
local flag variant instead of the global one.
Because route maybe updated when error occurred.
Change-Id: Ia67e138a2b494da465f4868553d33509e70020eb
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
Requirement stipulates OPB to be writable buffer in split mode.
Erring out in case of read only buffer will help debugging quickly.
Change-Id: I529a97b3d0aa5f82e7cf7d024475338a9d24d1dd
Signed-off-by: Amit Shekhar <ashekhar@codeaurora.org>
Include BRS control id in msm_venc_s_ctrl to add
support to BRS feature.
Change-Id: I05b23e7960128a7b19c582caa5123849ba0cb2b0
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
Cleaning up the debug change - reset max_tries count
from 10000 to 1000.
Change-Id: Id0b142f92b8f45eaa73ab256b7b07bb10f382b80
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Clean up debug log levels as:
1. Revise VIDC_WARN to VIDC_ERR;
2. Revise VIDC_PROF as VIDC_PERF;
3. Mark some one-time logs, e.g most of logs
in initialization and deinitialization as VIDC_HIGH;
4. Keep VIDC_PKT;
5. All other logs change to VIDC_LOW;
Change-Id: I8fc30f97dc3424da8418aab00e8af074ec8d4ef9
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
DCVS feature depends on multiple client configurations.
Low latency, thumbnail mode, etc are few among them.
DCVS is now decided before the session starts streaming
i.e after all configuration are inplace.
CRs-Fixed: 2457035
Change-Id: I4a42ae6bafdc852e81794b69d117f5821af4841f
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
Reverting 2735098 "update video dimensions during port reconfiguration".
Change-Id: I2343cf77d23a564c3346d71dae9cd6377ae9d4e2
Signed-off-by: Shivendra Kakrania <shiven@codeaurora.org>
During a decode session, video output port can go through
reconfiguration. As a result, update the reconfig dimension
when client calls for g_fmt on output port.
Change-Id: Ib5f5866acbdfe107ba4693b8b94498d42f74b312
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
CVP usage is not supported for secure session so do not
enable CVP usage for secure session.
Change-Id: Ifed6daaf706895ebbc56b246134d9775787c7b9d
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
Fix to independently control f/w logging route.
Change-Id: I81b57995cb9619d2dee9c43547e86cc3f08d3778
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
Driver need not support sessions if cumulative
mbpf (macroblocks per frame) is more than platform
specified value. So reject such sessions.
Change-Id: Id12eedfb97783b746c771066d6a556692be84c9f
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
For H264 decoder, resolutions with non-multiple of 16 were
calculating less internal buffer size. Updated calculation
to handle such scenarios.
Change-Id: I3c07b843cc898a584aba4c9f26627898a7427fe8
Signed-off-by: Shivendra Kakrania <shiven@codeaurora.org>
Have a chipset specific check to decide the default value of
num of extradata planes. Make num of planes as 2 if
extradata is enabled.
Change-Id: Ie61cac744b4277c024f36bebe795bea2eeced6ae
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
Support dynamically config blur resolution to firmware.
Remove unused code for encoder aspect_ratio extradata.
Change-Id: Id2896ab943de4b676338b42bd4993d4057e960ac
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
Write queues virtual address to video firmware to use it
for debug purpose to get more information.
Change-Id: I9bf347c3ea279196e7ae40c936f6b3608c94b09b
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
Entry field from clock data structure gets initialized with
codec data during state transition from MSM_VIDC_CORE_INIT_DONE
to MSM_VIDC_OPEN. When flush is called before this transaction,
it calls msm_clock_data_reset where mentioned field is getting
accessed, which results in uninitialized data access. Add state
check to ensure the command is handled in right sequence.
Change-Id: Ic98221cbfe465415d89a0e2891f8af65f584f1dc
Signed-off-by: Aniket Masule <amasule@codeaurora.org>
Add platform specific capabilities for lito and use them
in place of firmware capabilities.
Change-Id: I4aca463604444b7ec161f794aac5ddd334c14368
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
read bit 21 of register FEATURE_CONFIG1(0x00786008)
to check if fuse is blown to enable lower SKU spec.
Change-Id: I63c5d764aed13c60c0d213aa0fc29dec9edfef3f
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
Make a vote call whenever the clock frequency driver computes
crosses a threshold mark. This vote call handles the situation
when many subsystems are in turbo and where a need arises to
throttle the CDSP current.
CRs-Fixed: 2330072
Change-Id: Id10c02749b00fd5a1b1980923c5034648bd35985
Signed-off-by: shubham gupta <shubgupt@codeaurora.org>
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
Remove support for V4L2_CID_MPEG_VIDC_VIDEO_PICTYPE_DEC_MODE.
Cleared related code.
Change-Id: I3b7100dfd08ee68a5033d8f6ec2cfdcfbbfbbe14
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
By calculating bitrate at each frame, we get a better estimate
of the BW requirements of the decode session. Thus improving
performance and power usage.
CRs-Fixed: 2451137
Change-Id: I22f0029bbb7d501340469a317e89de7eb34717c4
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
Use S32_MAX instead of U32_MAX for maximum ctrl val for
blur resolution, as ctrl val is s32.
Change-Id: Ie92f6ba831ffead2d56c9eee24917b8a42cdd564
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
Move cbr plus variable to legacy cbr variable as
it is interfering with CVP usage.
Change-Id: If31f49858486e4295e7dfd9f47175e23c4078200
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
Regulator handoff causes the GDSC to turn off momentarily and resets
internal registers. As a result, TZ is unable to program secure
registers during Secure PIL load fails. Moving the handoff after
PIL load allows proper secure register programming and enables
secure sessions.
CRs-Fixed: 2450296
Change-Id: I32c7bf8726b51fdfa73b40819e8fdccdbbc0abe3
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
The structure vidc_hal_session_init_done is not being used,
so remove it.
Change-Id: Id4a577db117f98b18439245907765be5c9badc83
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
Default UBWC configuration for LPDDR5 is corrected.
Highest Bank Bit is set to 16.
Change-Id: I0fb18279ae32d34a7f3bada6d05a72c5935430dd
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
video driver does not support TME format, so remove it.
Change-Id: Ica7656fc1758a007f0d20d0351a4cedb82b9a0ee
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
Kona target supports two LTR frames encoding.
Fixing this capability in kona driver.
Handle resolution check correctly while setting
slice mode.
Change-Id: Iea6a041ecafb24da014832ecf2146088d4569a6f
CRs-Fixed: 2444064
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
Video kernel snapshot before disabling msm/vidc compilation
from base kernel.
Change-Id: Id1178c3aca00706ad4822537f7f9a28141478771
Signed-off-by: Shivendra Kakrania <shiven@codeaurora.org>
This change brings msm vidc driver from base 4.19 kernel project.
It is the first source code snapshot from base kernel project.
Change-Id: I1d600c4e9459b9013f4b607890c52644f6d94f0c
Signed-off-by: Shivendra Kakrania <shiven@codeaurora.org>