As per the recommended configuration, the max spec
for running an encode session in high quality is
1080p@30. Updating the same.
Change-Id: I649790bbf8a3c2264bfe6c36769717df2d2f2a55
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
Currently video has multiple nodes in dtsi to support/limit
sw capabilities via sku-index. Mostly restriction comes in
terms of allowed-clock-rate. So created static entries in
platform.c to configure clocks based on plaform fuse value.
So that single vidc dtsi node is sufficient and there will
not be a probe defer/failure during bootup.
For ex. Shima supports 3 sku's.
AB - max 364.8 MHz - sku_version(1) - picked from dtsi(default sku)
AA - max 201.6 MHz - sku_version(2) - clock_data_v2
AC - max 444 MHz - sku_version(0) - clock_data_v0(no fuse)
Single vidc node - "aa00000.qcom,vidc"
Change-Id: I870f1e3a24c0cbfdd92c537d3e40c4cf5400326d
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Update min resolution support from 128x128
to 96x96 for decoder.
CRs-Fixed: 2724675
Change-Id: I230d3c5fbdc1d476a634160de30b20e207a5f315
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
qbuf ioctl acquired bufq[port].lock in one thread and flush
call acquired registeredbufs.lock in another thread. So
thread-1 is waiting for registeredbufs.lock & thread-2 is
waiting for bufq[port].lock i.e leading to deadlock. So
added change to avoid above mentioned deadlock.
Change-Id: Ie21984fdb562ca7a09f801f036f3a78429ceab94
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Currently, total buffer size across pipes is
aligned with 256. It should be per pipe usage
aligned with 256.
Change-Id: I389f2a0539bb04b9d038fe44122da70690c43466
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
Video instances might still be alive at the time firmware unload
handler is called. As a result, firmware unload request is not propagated
to firmware. Add place holder to increase default delay for this request
to 1sec to wait until all instances are closed and successfully unload
firmware.
Change-Id: Id1e7455d40c1808690148046f9a839f1b79574ae
For 8K video, bse-vpp delay is 6, and one frame may
have maximum 600 slices according to h265 spec, so
need to increase max slice count to 3600 to allocate
large working buffer size for worst case.
Change-Id: Iab035b4cbe8c0121bf1e63d4f3e18c9436a16f5d
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
use num_vpp_pipes from platform_data to configure
workroute.
Change-Id: I5fea0d381402f9877fdb5d0df179bc0857016c56
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Add configurations specific to shima platform as per
H/W and spec.
Eg: Codec data, performance configs, fuse etc.
Change-Id: I4918af58dcafba3aaafa5eeaaaec256f8cbdca37
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Increase the delay between reset assert and deassert to a minimum of
400us, as required for Lahaina power sequence.
Change-Id: I8fb77b0746a7cc68ad3925b2e22b402cd0ff8070
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
Thumbnail sessions are considered to be non realtime
sessions. Hence ignore the thumbnail sessions load on
device while calculating the load and mark thumbnail
sessions as perf session.
Change-Id: Ifa89c2f670fa631b6805a5d796a04e07e294ca4c
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
Update min resolution support from 128x128
to 96x96 for decoder
Change-Id: Ib6b09af6c00323b67a1f50887d80e59148e6cfd8
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
During msm_vidc_probe, core->platform_data will be NULL, if
there is no match with compatible string in the of_dt table.
In msm_decide_dt_node sku-index check will be by passed due
to default value(0) i.e leading to NULL ptr dereference
exception in msm_vidc_init_core_clk_ops. So added check to
avoid subsequent calls, if core->platform_data is NULL.
Change-Id: I335a2836b2e34e79dcb8743816205d23f798617d
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
With best fit configuration, the probability of getting
a mapping for video buffer increases even when the system
is fragmented.
Change-Id: I8689447ce1341fd1189b543eb9fb6a2e03edcc94
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
For 720p or lower, video hardware can run only in
a specific work mode. Fix the condition, so that
the work mode is configured as desired by firmware
CRs-Fixed: 2699234
Change-Id: I8f9ad5030e7a83075a9d2d1bfe2fc39774f4aa56
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
Encoder calculate fps based on timestamp,
if fps changes and stable for 2 frames,
set to firmware to facilitate rate control.
Use closest rounding instead of floor rounding
when calculate fps.
Change-Id: Id2420729a309378107ff6f7830515fae31512ddd
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
Static - Enable latency hint which indicates that the
decode session may go into low latency mode during the
session. With this configuration, video driver disables
DCVS and decode batching.
Dynamic - Enable or disable low latency control during
the session. Based on it, video driver would decide the
work mode and set the same.
Change-Id: If6e85b7adb1bbe4b4bec9e4a8671db64f240cfe8
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
VPP delay is not applicable to Thumbnail usecase. Hence buffer
counts should not include VPP delay, in thumbnail usecase.
Change-Id: Iba7d3efec48c08c160eb602d946643d620d2a36f
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
Uncomment HFI calling part for bitrate boost
setting.
Change-Id: I289b1866089fff883d624bb505b37cca4061a626
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
Modify output driver min count to 4 for HEVC/H264.
Change-Id: I8efa986b693804392a6178b369ef43c7edf9e0d4
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
After grid flag enabled for HEIC, update min
input buffer count to 2.
Change-Id: Ia279b571af8c15e029a1cc77e3cbd3f6e51448f7
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
Adjust the load by max image spec for concurrent
video and image sessions.
Change-Id: I433b3a4fb4436589b930a842a02033ac665a826c
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
Assign enum_fmt_out to support input port enum_fmt.
Fix encoder enum_fmt compressd flag.
Change-Id: I822ee81586fe50bfe1fbfd8a808307051e639a79
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
After couple of buffer transaction, sometimes session will be idle,
So do not consider inactive sessions for clk scaling and bus vote
calculation.
Change-Id: Ib4cc7606da6c828ce1d9108528a2cbbad4e5f6e4
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Shouldn't use count_min to validate dpb buffer count, as it
has already been modified when received seq change event.
Use dpb buffer_count_actual instead.
Change-Id: Iad4117e4d0045859312d726caae1c8801ba1b897
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
buffer counts(min_cnt, min_host, actual_cnt) is updated in
hal_buffer_requirements only for internal buffers. Currently
for dpb, we are updating only actual_cnt, due to that
msm_vidc_verify_buffer_counts check is failing. So updated
all 3 variables (min_cnt, min_host, actual) for dpb.
Change-Id: Ib6e476fae57407a2b5fb55b1b73986dfca410ae6
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
check total non_secure memory usage, reject the new
non-secure session, if total non-secure memory usage
exceeds the non-secure region size.
Change-Id: I2b0aaae061e5b022237a4c49c66e92461fb40fca
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
do not allow to open new session, if total video consumed
memory is beyond allowed memory_size_max_limit for video.
Change-Id: I6bfade01f99bae24691254744adf7ce38de51fdd
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
calculate buffer size as per the max resolution
for the targets that does not support 4k and also
ensure the size is equal to YUV size by overriding
the div factor to 1.
Change-Id: Ia63676d30d1ee1e697518780a03a48010380555d
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
[1] add support for HFI_PROPERTY_PARAM_HEVC_PPS_CB_CR_OFFSET
[2] send (cb_qp_offset << 16 | cr_qp_offset) to firmware
[3] default:0 and overridden: -12
[4] firmware will subtract 12 from driver sent value.
0 maps to 12 to fw and bitstream has 0
-12 maps to 0 to fw and bitstream has -12
Change-Id: I286c7088640349691930c95e9b176e4e748c669a
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Remove usage of core 1 since there is no support of IRIS1.
Change-Id: I5588b452455b592b8156ea4f46cb8e3171e14947
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
AON register programming is used to set NOC to low
power mode during IRIS2 power off sequence. However
AON register memory map is not applicable and hence
skipping AON register programming for lagoon.
Change-Id: Ib63248d118ed9fecfa5fa87925e8f69625dc1ba8
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
a. NOC error info registers are different for IRIS2_1 pipe HW
to IRIS2 HW. FW can retrieve the same info without NOC error
info registers. Hence removing the support to print NOC
error info registers for lagoon.
b. Since IRIS2 has noc error recovery enabled and same FW is
used for IRIS2 and IRIS2_1 pipe, only printing NOC error
info registers is disabled with out disabling noc error
recovery.
Change-Id: I936629e4f53faa5e25b2a64fb92378a26499ed57
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
Initialize ubwc_stats_lock before use and destroy it before
video instance is destroyed.
Change-Id: I4ecc02109d9d1c3f8b7cfe28c49b5467866b4d3e
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
Add to enable bitrate boost mode when rate
control mode is VBR and CAC is enabled.
The default boost margin is 25. This value
can be config from 0 - 100 by the client.
Change-Id: I4c3d0ae557052d3e615aee4c74b52ce0596fcfcc
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
Update colrcbuf_size calculations with frame width/height
in MB's instead of frame width/heigt in LCU's.
Change-Id: Ia84609e90c3bd6fb626cf759090e9ddcd1f86435
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
Change default width & height for 1080p to
QVGA. Having 1080p as default, creates issue in
concurrent sessions for low end targets where
max capability is 1080p.
CRs-Fixed: 2602438
Change-Id: I0ca9d8633af1882abd5dbfd113c7dd55cd399f0a
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
Add vpu_ver as IRIS2_1 for lagoon and its
corresponding checks such as no CVP, ROI type,
buffer size calculators based on vpu version.
Change-Id: Ie26c015413c551ca430bb70822a4a65d61d56e11
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
During multiple error scenario, video driver prints
the properties of ongoing video instances. Add a log
to indicate if the session is of type image.
Change-Id: Ie23522bd31c9f5188c204c4a1eeae59a627d1976
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
As per the interface agreement, rg_data would communicate
the size of extradata. Update the same while creating the
packet.
Change-Id: Id61bce9486a11db5263c336b3284e81953a9a070
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
Enable work mode 2 for image sessions where rc type
is Constant Quality(CQ).
Change-Id: I55b6abe8a0e28b3afc55c83456c02be19cf1e7cb
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
Updated BRS control to accept 0,1,2,3 values instead of boolean.
0 -> disable
1 -> 8-bit
2 -> 10-bit
3 -> both
Also, Internal blur is treated as adaptive in firmware with new
restrictions. Adding internal blur conditions accordingly.
Change-Id: I0aa525bc333acaeeddb5b68cf947030c25466154
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
Video hardware supports RGBA888 compressed colorformat.
So, adding RGBA support in driver.
CRs-Fixed: 2610032
Change-Id: I5f69961c2df365058406fb8a1e5cb62e283385d0
Signed-off-by: Karthikeyan Periasamy <kperiasa@codeaurora.org>
Driver will internally produce subframe flag for all ETB of
a Superframe to firmware (except last ETB). Firmware will
propagate subframe flag to FBD. Driver client will receive
multiple FBDs with subframe flag for single Superframe ETB
(except last FBD). This subframe flag indicates that more
FBD expected for same input.
Change-Id: I627123ee2500dd7846363d8b819c3fa56234a494
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
Remove all VP8 profiling on lahaina for both encoder and decoder.
Change-Id: I575ffdced1dbe3db0b55243acb88de4fc8971f86
Signed-off-by: Rakshitha Shakamuri <rshakamu@codeaurora.org>
Add extra check to avoid NULL pointer derefernce when DEBUG_FS is
disabled.
Change-Id: Id89e5422c5afce0428dd77280788d50af0a22fec
Signed-off-by: Prakruthi Deepak Heragu <pheragu@codeaurora.org>
Introduced new property to configure start up delay for vpp processing.
This feature is enabled for AVC/HEVC 8k resolution case. Due to the delay
in vpp processing, ubwc stats structure is moved from ebd to fbd.
Ubwc stats changed from per buffer stat to worst case stat from current
dpb list. Introduced debugfs control "vpp_delay" to control delay of vpp
processing, range 0 to 31.
Updated min buffer count requirement due to vpp delay as well.
Change-Id: Ib2a07e4b5d7a9cbf3661258790276843ad714d37
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
Return ENOMEM instead of ENOTSUPP when VP9 decode overload
occurs so that userspace can handle this error case correctly.
ENOTSUPP is not available in userspace.
Change-Id: I5260812bb00fde7eed02a29943a67af038e3c001
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
FBD packets may contain UBWC CR data information, for certain
targets. Packet size checks should take this into account.
Change-Id: I3ed5705fd6d5b78921aadb2f91c75a071a1f16b2
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
Enable timestamp reordering by using the
calculated timestamps maintained in a
sorted order and associate with output
buffers. This would resolve the issue
if the parser sends incorect timestamps.
Change-Id: I870fd8ed25e05b8e86c677e79182e9c7785656a8
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
B-frame enablement decision logic has been moved to HAL interface.
Hence, removing from kernel space.
Change-Id: I24943f7facf172f5b9f30fbc67692fd866d490cd
CRs-Fixed: 2615700
Signed-off-by: Amit Shekhar <ashekhar@codeaurora.org>
Currently, both bitrate and frame-quality can be set for a CQ rc-mode
session. Adding additional check in driver to set only one of these.
Change-Id: I1ea7b08cf8c7fe90e35aa57f570703e8cdf854e9
CRs-Fixed: 2615700
Signed-off-by: Amit Shekhar <ashekhar@codeaurora.org>
Set the allocated encoder persist buffer to firmware.
Change-Id: I83fdf2dace76848e4a5ad4d8f3a85c9605b56cd0
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
Video driver extending few standard controls value and
hence mark those controls as custom controls.
Change-Id: I373ed21482bb577c4fc5c28fd011098963608f53
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
Use correct types in callback functions to avoid kernel
control flow integrity (kCFI) warnings.
Change-Id: Ia84a3d10ebb83407b4ac2c6140daec35e0698bd5
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
Check if the non-pix and pix prefetched memory is sufficient
Change-Id: I71561959a3ed1e9acdb654650144f35656230345
Signed-off-by: Akshay Chandrashekhar Kalghatgi <akalghat@codeaurora.org>
Perform cache operations on all planes including buffer extradata
planes, since userspace may set cache flag on all planes.
Change-Id: I9cc6060ec7fb2626b4885c7df7592abae99fb955
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
Secure memory allocations take a long time. Use memory prefetch and
drain operations to reduce allocation times.
Change-Id: Iaa86a97d7a8b1d6eb1683d273ddb27ffe8d891ae
Signed-off-by: Akshay Chandrashekhar Kalghatgi <akalghat@codeaurora.org>
Get Video FW ELF image name from driver's DT entry.
Change-Id: I95320f2b1bdf9ba9e8bb6264babc33c162da60e0
Signed-off-by: Akshay Chandrashekhar Kalghatgi <akalghat@codeaurora.org>
Calculate decoder framerate based on input buffer
timestamps and maintain a sorted order list for
timestamps and framerate in a sliding window of
size 32. Send calculated framerate to client in
every dqbuf output buffer. Use the maximum framerate
available in the list for bandwidth and clockrate
calculations.
Change-Id: I5fa357645cb806bf97ccd30ed68bd784d526e233
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
In qbuf (input) store input_tag to etb_data list and send it to
firmware in etb. Firmware will return input_tag in ftb_done,
store it in fbd_data list and return the same when client does
dqbuf (output).
Change-Id: I3589e5a3017cac49000fc64191f9f756bc4011f4
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Currently, instance pointer value is used to create an instance debugfs
name. Using instance pointer causes multiple instances to have the same
debugfs name when kptr restriction is applied. Use instance sid instead
of pointer value to create a unique debugfs name during concurrencies.
Also, use %pK instead of %p in other places.
Change-Id: I098f641e9a548bcb8bf6d939422607cdc194adb3
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
Updated the HFI_IRIS2_ENC_PERSIST_SIZE parameter to use double
the existing buffer size instead of calculating on
HFI_VENUS_VPPSG_MAX_REGISTERS.
Change-Id: I434e084db95082906638a4a288ed848f3bab89d3
Signed-off-by: Rakshitha Shakamuri <rshakamu@codeaurora.org>
Usecase like UHD encode is configured by driver in
high quality mode. But video firmware overwrites the
mode to performance mode.
Update the quality configuration to make them inline
with video firmware configuration.
Change-Id: I6f432bbf889c01d0a9b1f91bfb3d2dd2b9351b5b
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
INT_MAX is an interface provided to client to configure
video session in TURBO mode. When client configures the
operating rate as INT_MAX, the rate at which the frames
arrive at video driver does not change, so there is no
need to update the operating rate.
If the operating rate is updated, macroblocks/s for the
session goes high. As a result, the session gets rejected
as the clock is not sufficient for high mbs/s.
Change-Id: Iaa48073a486ce6435664a6afb8a4c6ddd7b7f87d
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
Signed-off-by: Rakshitha Shakamuri <rshakamu@codeaurora.org>
Updated the HFI_IRIS2_ENC_PERSIST_SIZE parameter to be allocated
by encoder ARP buffer.
Change-Id: I09fa92d1f04348266f1fae71479c9b1c077556ae
Signed-off-by: Rakshitha Shakamuri <rshakamu@codeaurora.org>
Buffer size calculators are dependent on pipe configuration
of the chipset. Ex: Kona has 4 pipes and lagoon has 1 pipe.
Hence aligning the buffer size calculators based on chipset
specific usage of pipes.
Change-Id: I8bb19efc4a80c7e17d9db3cf7d5f1151191b502e
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
Signed-off-by: Rakshitha Shakamuri <rshakamu@codeaurora.org>
Client should take care of buffer allocations for
advanced use cases like HFR and HEIF. Driver will
handle extra buffers only in bare minimum usecases
like DCVS and decode batching.
Change-Id: Id5ec012ba2620b47578173e8306f1700644f0b8c
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
1. is_batching_allowed api is not considering platform
check(core->resources.decode_batching).
2. increase both input & output buffers count if
current session supports batching.
Change-Id: Iabe7479b4664a78b637ee981d67c604f7d0d5d56
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
For sub-frame encode sessions, input buffer done is received only after
all sub-frames have been received. In these sub-frame encode cases,
input tags are not fetched for sub-frame outputs for first input and
buffers are dropped in HAL in absence of apt input tags. Limit buffer
counter check from input tag fetch condition for decode sessions only.
Change-Id: I8c584834369be921d8699da49cfa1fec65fb993d
CRs-Fixed: 2547055
Signed-off-by: Amit Shekhar <ashekhar@codeaurora.org>
buffer addr and size were not updated in "UNMAP" tracing.
So added entries.
Change-Id: I4ae5715263a3e1d21de88e4ff69baf8d74d75560
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Low power flag is updated after calling msm_print_core_status.
So it is printing "HQ" even for "LP" session. So changed api
calling sequence.
Change-Id: I1f88f3f3e1ca43f11c00359dbfaec5d2ff99ae89
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Configure CVP_VPU_WRAPPER_CORE_CLOCK_CONFIG register to unhalt AXI & VPU
core clocks but not unhalt CVP core clock. Add a function to write a
masked value to register.
Change-Id: I8cb80b1823d091ac4eb705fd207afbd35bde86de
Signed-off-by: Akshay Chandrashekhar Kalghatgi <akalghat@codeaurora.org>
Add support for vidioc_querymenu for userspace to
query menu type controls.
Change-Id: Idffb7e978e7f6eba9bf2744bcf87bafcd919decf
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
Currently max_packets is configured as 1000, but max outstanding
packets will not exceed more than 480(16 clients x 30 pkts/client).
Change-Id: I8c074e08c959473c20450bc7d62486362ba81b47
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Scaling check is not required for decoder as clients may not
set both input and output resolutions for decoder
in which case input and output resolution will be different
and scaling check fails if enabled.
Change-Id: Iccdbad63bd8f975df4f57cad0250557119cf788d
Signed-off-by: Karthikeyan Periasamy <kperiasa@codeaurora.org>
During subsystem failure, the cause for failure is updated
in a specific video buffer by the video firmware. Video
firmware can even update the size of that specific buffer.
To ensure the validity of that buffer access, check if
the access is within the allocated size.
CRs-Fixed: 2585811
Change-Id: I30b8bf2e9ba3699d229f4acc104f46566fcb60fa
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
Based on the ddr rank info, sku version is set.
Change-Id: I1823585553bad65462e047a5bebc6d93716c7703
Signed-off-by: Malathi Gottam <mgottam@codeaurora.org>
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
Update clock cycles of vsp and vpp
required for per MB in bengal target.
CRs-Fixed: 2558188
Change-Id: Ifa39458123dfe2b687b0865e119e23aaf5613713
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
Exclude 4 bytes which holds the size of the buffer while calculating
the actual buffer size to avoid OOB write.
Change-Id: I965e78097a3680065aaf7609d35af1a42fc44824
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
possibility of OOB access on device->response_pkt in
__response_handler. for e.x if msg queue contains 1000
messages and all 1000 were read and queue is empty.
So __get_q_size api will return zero and _iface_msgq_read
will go in an infinite loop, even if packet_count
== max_packets.
Change-Id: I3c0fb095feff0ba5d4d6dab65ed9d5111f1b6f05
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Add definition for decide_core_and_power_mode
to fix the core id issue. Wrong core id
results in incorrect clock values.
CRs-Fixed: 2572953
Change-Id: I2219df71f555fb34a69146821997bab5fa8971a9
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
Update core ops to invoke calc_bw_ar50lt API to
calculate bus bw requirement for ar50lt.
Change-Id: I1c8e1766d9aa2f8ad44498587b171c2827759ddb
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
VPx cycle requirement is not same as CABAC.
Hence update required as per system recommendation.
CRs-Fixed: 2560714
Change-Id: If600bc9c4abb364dba5f807c944976be992567c9
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
The commit adds the following
1 Keep DMA mask aligned with api definition.
2 Replace the various division operations with 32 bit compatible modules.
Change-Id: I7bc931ffd124ef2b0be8d2bec44fbebf29d4cfb3
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
Fix to set 7 instead of 1 to firmware to
enable all custom bias, matrix and limit.
Change-Id: Idd8bf0f6036ef2919855f379fffa51d5339eba1d
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
Set operating rate to 1 by force for HEIC, so as
to avoid overloads.
Change-Id: If3f980e096c7e30368b9c6a280e78bbe1625e87a
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
Driver is not polling for the PC Ready to be
set and truning of the regulators/clocks. Fix the
same.
H2X Interrupt has to be enabled for every boot.
CRs-Fixed: 2572953
Change-Id: Ib24b35dcebedf464bcd461718a18e732531ea4ce
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
Fix to use correct CSC coefficients for
BT601 to BT709 CSC.
Change-Id: I8365603fed10151db0efbea0058bb896c419c3f4
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
Fix to use output port resolution to determine
vbv delay.
Change-Id: Id6dc80f1349d0f5b10be2fa6343fb98816156f58
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
10 bit support is available only for hevc codec type.
So increase encoder output buffer size(factor - 1.25)
only for hevc.
Change-Id: I49f6bccc074814d8c737f47fd82907a018ac169a
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
For HFR(like 960 fps) usecases requires higher buffer count-24.
But due to framework change(277033), We don't need any addtional
buffers for HFR usecases also. So reducing the count back to 12.
Change-Id: Ia3669858cde0962275d00f31d2bbb7308a3ce983
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
1. Set perf mode for image session buffers so that
they will be processed quickly.
2. Set max frequency for any turbo sessions.
Change-Id: Icf9b0af5cffcd395356783a9ff7a9421a309f52c
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
Check ubwc_config for not being NULL before
dereferencing.
Change-Id: Ia4c87ea4a0e963b33165b0ea9a9c39339cc65832
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
Add new ioctl to query the supported ROI map type.
Based on vpu version, report whether support 2-bit type
ROI map, or 2-byte type ROI map.
Change-Id: I6db970f5f36e4cc61365867c2a07d63aaf9365ea
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
For hevc codec, LCU sizes are 32x32 or 64x64. Existing
capabilities consider alignment with 16. Considering a
hevc clip of dimension 4096x2160, the coded resolution
becomes 4096x2176. Limiting the cap with 4096x2160 will
break such usecase, hence keeping the capabilities
considering 32-byte alignment.
Change-Id: I505843878f177c63b88959f92ce3a7d5a06b996b
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
-Fix to add 4 extra dcvs buffers at encoder input and decoder
output side irrespective of fps and resolution.
-Decrease total encoder input buffer count from 16 to 8 for non-hfr
use-cases.
-Increase total encoder output buffer count for hfr use-cases
irrespective of resolution.
Change-Id: I2fcda6e8c93bcc0df8c3168049ebf4a60e6bb5f1
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
Input buffer counts, ie Dec Bitstream and Enc Yuv,
depend on input resolution. Hence they should be recalculated
in set format. Stale values can result in excess memory usage.
CRs-Fixed: 2548727
Change-Id: I57c87270a6613da290f14484897cef16e964e27a
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
Increase vpp cycles by 2% for 1080P@HSR480 encode
usecase so that the video core runs at higher
frequency(366Mhz) helping to achieve the desired
performance.
Change-Id: Id81abd36ab79067d52da9371d1dd5bdcfe622389
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
make changes in video driver to make it as module.
Change-Id: I00788a1b72cc799f655b16e1bc6b7d6d6e0441f9
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
Reject the buffer device address mapping when the device
address is mapped in secure context bank for a non-secure
instance and for the converse as well.
Change-Id: Ic2fc578acd23d3582b390b24cc9d829d49d00d4d
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
For secure encoding case, there is no camera usage. Hence,
by default make number of planes as 1. If any input requires
extradata, client will enable it and driver will update
number of planes.
Change-Id: Id9afd0a286a53d5d4c6045ba58227f57a0a8e0ca
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
Fix to add condition to skip mbpf capability checking
for HEIF image encoding.
Change-Id: Ife323366b8c08040c3f6fab8a0d15b89fe6f6777
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
Default buffer count will not be sufficient for HFR(fps > 480).
So recalculate buffer count, if fps is updated before calling
vidioc_reqbuf.
Change-Id: Iec792892d283072f064c4148c65560b6a7e31d45
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Set CABAC as the default entropy mode for h264.
Also, check profile settings to ensure that CABAC mode
is set only for applicable profiles.
Change-Id: Id5e67c1a7ac0862ea963312ebdaee58945bf8bc0
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
Increase total input buffers used for HFR cases. Required
for smooth performance.
Change-Id: Ia7dd49ead71239c2fb669e016d5e9fd2f94ca862
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
DCVS scaling window should be equal to the additional buffers
allocated for DCVS and independent of the buffer count required
by Client and FW.
CRs-Fixed: 2527739
Change-Id: I665a3d9792f44ea031d6c8d05d6e7a546a22f9a8
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
SKU index is not applicable for all targets. Hence no need
to keep it mandatory. SKU related changes will happen only
when the property is present otherwise will default to 0.
Change-Id: I88076ea95bccd4130202c055e5c148d817dd302e
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
Add new DDR type 5X and deprecate DDR type 4Y.
Macro values also changed.
CRs-Fixed: 2534324
Change-Id: I0412b4e624df9c377db18b635d2cde321fccf8d0
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
Currently setting signal_info, only if colorspace info
is set properly. But sometimes client can set only range.
So need to send signal_info always to firmware.
Change-Id: I5282ec01b473485ec39f39abbf7160b9c5cc0256
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Eos buffer is queued to firmware and its ref is maintained
using eosbufs.list. Sometimes EOS request client sent even
before port_reconfig. In that case requeing same buffer
which is already with firmware at start_streaming. So during
handle_ebd of 2nd eos buffer, it can't find the entry at
eosbufs.list. So client closes the session.
Always check, if buffer is already queued, then do not queue
the same buffer again, during start_streaming after reconfig.
Change-Id: If934d8ce357226dee78db15ccb7b3c57103d2f12
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
When set color format constraints, one buffer is not
correctly freed, fix it.
Change-Id: Iad497f03981653a7f28524f1d9e4218f706dcca1
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
Initialize port format type to avoid failure
when g_fmt is called before s_fmt.
Change-Id: I37758f6d8be766c75cc8bc97147312b3b0bb0915
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
Add Lahaina-specific platform data needed for driver probe
and remove data for older platforms.
Change-Id: I35e7711fd024467f0b6ce40aabdaf71f0c523e9a
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
Initialize device_caps with device capabilities before video
devices are registered, as required by V4L2 framework.
Change-Id: I9fc037ae65d352b15d78eee979df30a24137dea8
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
ar50 and iris1 are no longer used.
Deleting the unused code pieces and files.
Change-Id: I01fab64b5e3682338fc0ffab986e7807a74c37b5
Signed-off-by: Karthikeyan Periasamy <kperiasa@codeaurora.org>
- msm-bus API is deprecated in favor of upstream interconnect API
- Migrate all msm-bus functions to interconnect (icc) API
- Remove msm-bus sub-device probing and parse interconnect fields from
msm-vidc device tree
Change-Id: Ibf08c52e001c5fde7e30d2aedbd3456a270f5b6c
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
- Made the changes in video module to compile successfully.
- Removed cvp and v4l2 private files.
Change-Id: Iaf5f29d6042a87d5b96b1fa4abb985ee3e592f0e
Signed-off-by: Karthikeyan Periasamy <kperiasa@codeaurora.org>
Error recovery is enabled by default & it will get triggered
for all sys error reported by video firmware.
For debugging purpose it can be disabled as:
1. disable error recovery for noc error:
echo 1 > /d/msm_vidc/disable_err_recovery
2. disable error recovery for non-noc error:
echo 2 > /d/msm_vidc/disable_err_recovery
3. disable error recovery for all cases
echo 3 > /d/msm_vidc/disable_err_recovery
Change-Id: Ie260485842704d3e278ded8c6d1722bc19c80f6f
Signed-off-by: Shivendra Kakrania <shiven@codeaurora.org>
print logs based on logmask set on debugfs entry
(/d/msm_vidc/debug_level)
[1] 0xx -> print logs for all session type
[2] 1xx -> print only encoder logs
[3] 2xx -> print only decoder logs
[4] 4xx -> print only cvp logs
Change-Id: I8e01ee9c8b80a50b178ea87bf25d7ef25401f67a
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Introduced CVP skip ratio property to indicate the number of
buffers skipped for CVP processing. This serves as a hint to Video
firmware to know the number of frames for which CVP metadata has to be
reused from earlier frame to which CVP metadata was sent
Change-Id: I58ad5daf9a9c6ae7a0aa48e3bd1d60e7dc9229e6
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
Raise an insufficient event whenever there is a change reported
from interlace to progressive and vice versa so that driver can
set appropriate work/route mode.
CRs-Fixed: 2444064
Change-Id: Ic78867a2b51aa22de5dfeeb4b806014e2f0f23e6
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
[1] Maintain log_ctxt cookie to track debug information.
[2] Print codec type and session type by default in logs.
Change-Id: I6c01f3238ba868fdc525f5c60f58545a07bdef3a
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Print session_id details in all possible call flow paths.
Change-Id: I0c583dc99d4ebee7fbcb4e36d917ba9120fa670e
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Avoid allocating smaller encoder scratch1 buffer for Video
firmware when frame height is greater than frame width.
Change-Id: I663da164b3cbb945d7da2d6ab40199d8ef14d979
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
Remove freq list, which is unused in current dcvs design.
Remove unused dcvs load, load_low, load_norm, load_high,
as current dcvs design only use min_freq and dcvs_flags.
Change-Id: Ifbf251a9506286f2f34eca6eeb1af79bd07c0f43
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
Update CVP metadata skip logic to send a frame for CVP
processing every time frame rate or operatimg rate changes
dynamically. This helps in handling skipping of CVP metadata
processing for a random number of frames whenever frame rate
or operating rate changes dynamically, and avoid sending
CVP metadata to video firmware for an unpredictable frame.
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
Change-Id: I049f0c0ade1700816203713cd82382c2a614f20a
For encode usecase, video driver operates cache always on
the encoded data length rather than the buffer length.
This is an optimization and saves cache operation on unused
memory region.
VB index is used to identify a buffer given to client and fed
again to encoder. Based on that, the filled length of that
buffer is then operated for cache operations.
For certain usecases, it is difficult to identify the buffer
based on VB index. Hence keep a counter to track the max filled
length during the usecase and operate cache on that length
Change-Id: I62cfe876077786ec9d14f541a0080cd2fc124b01
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
V4L controls are made to be part of a cluster when they
are interdependent. If any one control in that cluster
is updated, all the remaining controls get updated as well
with the current control value.
Existing video usecase does not require any v4l controls
to be clustered. Hence removing the cluster controls.
Change-Id: I98dfc4af5291837054a8a28b00942fea6866f0a9
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
Add codec check for bit depth or color space only reconfig
event. VP9 and HEVC have bit depth reconfig event while only
HEVC has color space reconfig event.
Change-Id: Ia6732e31a15957dc7116535131203a69fe19c987
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
MBs per frame for HEIF encode can be pretty large for high resolution
images. Skip mbpf check for image sessions.
Change-Id: I993115743f4792377a3a008b341d4c8256b102b9
Signed-off-by: Amit Shekhar <ashekhar@codeaurora.org>
- Possiblilty of performance hit due to memory
alloc/free at frame level.
- Reuse same buffer_tag instead of reallocating.
Change-Id: Ifb8efc43907feea4d6da5e8a0bf0aeaa47c8e1d7
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Firmware needs to access extradata buffer to find the size of extradata.
In secure sessions, assigning input buffer address to extradata address
causes fault since firmware does not have access to input adderss.
Extradata address and size in ETB must be set to zero for EOS cases
so that firmware skips accessing the extradata buffer.
CRs-Fixed: 2444064
Change-Id: Ia916d2f5f0500c85426fee3274f88fcf36103068
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
If client sets operating rate as INT_MAX, vote the highest
Venus clock and BW. This will allow operating the video session
at highest possible performance. DCVS & Batching is disabled.
CRs-Fixed: 2502809
Change-Id: I33e952f501a3ba6c1c8588ee319e10a586941d05
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
In case of secure encoding, NAL length based NAL header not supported.
Only startcode based NAL header is supported.
Change-Id: I119ffa47a003006e5b0d3bf7fbb5eb547de00830
Avoid alloc/free buffer at frame level in window based
bitrate check, re-use existing nodes to reduce
CPU workload, especially for HFR video.
Change-Id: I8bbbbef5229af7e608d7da1dfa4f75aab3903649
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>