Commit Graph

371 Commits

Author SHA1 Message Date
Akshay Chandrashekhar Kalghatgi
5dbb3c9263 msm: vidc: Add support to prefetch & drain memory
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>
2020-03-12 13:16:03 -07:00
Darshana Patil
6134119508 msm: vidc: calculate decoder fps based on timestamps
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>
2020-03-10 13:32:14 -07:00
Govindaraj Rajagopal
455cd2b148 msm: vidc: update input tag implementation
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>
2020-03-03 12:12:23 -08:00
qctecmdr
666c906d4e Merge "msm: vidc: do not update operating rate during INT_MAX" 2020-03-03 04:57:09 -08:00
Mihir Ganu
494d4b0e21 msm: vidc: Use sid to create instance debugfs directory
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>
2020-02-27 16:34:46 -08:00
Rakshitha Shakamuri
f3511e846e msm: vidc: Update the persist buffer size for encoder on Lahaina
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>
2020-02-26 15:36:18 -08:00
Vikash Garodia
8af58f371e msm: vidc: update capability for quality mode
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>
2020-02-25 22:03:44 -08:00
Vikash Garodia
307e961aa9 msm: vidc: do not update operating rate during INT_MAX
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>
2020-02-24 17:28:01 -08:00
Rakshitha Shakamuri
c638b9401e msm: vidc: Increase the persist buffer size for encoder on Lahaina
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>
2020-02-21 10:58:54 -08:00
Rakshitha Shakamuri
1cfa55008e msm: vidc: Align buffer size calculators with num_vpp_pipes
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>
2020-02-19 18:32:00 -08:00
qctecmdr
833ea5a8b9 Merge "msm: vidc: Move buffer counts handling outside of driver" 2020-02-14 16:13:09 -08:00
Darshana Patil
8cace81134 msm: vidc: Move buffer counts handling outside of driver
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>
2020-02-14 10:19:07 -08:00
qctecmdr
f974523668 Merge "msm: vidc: send mapped addr and size for ftrace" 2020-02-12 23:00:24 -08:00
qctecmdr
5a9dece100 Merge "msm: vidc: Fix input tag fetching condition" 2020-02-12 22:02:34 -08:00
Govindaraj Rajagopal
5f665189a2 msm: vidc: refine decode batching logic
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>
2020-02-12 14:54:27 -08:00
Amit Shekhar
b7ee67c040 msm: vidc: Fix input tag fetching condition
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>
2020-02-12 13:12:19 -08:00
Govindaraj Rajagopal
ac715becb7 msm: vidc: send mapped addr and size for ftrace
buffer addr and size were not updated in "UNMAP" tracing.
So added entries.

Change-Id: I4ae5715263a3e1d21de88e4ff69baf8d74d75560
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-02-08 17:01:09 -08:00
Govindaraj Rajagopal
d33141e60c msm: vidc: alter log printing sequence
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>
2020-02-06 13:23:31 -08:00
Akshay Chandrashekhar Kalghatgi
167523e9ff msm: vidc: Do not unhalt CVP Core Clock
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>
2020-02-04 13:31:04 -08:00
qctecmdr
8f0d93768a Merge "msm: vidc: add vidioc_querymenu support" 2020-02-03 15:08:33 -08:00
Maheshwar Ajja
cf94619546 msm: vidc: add vidioc_querymenu support
Add support for vidioc_querymenu for userspace to
query menu type controls.

Change-Id: Idffb7e978e7f6eba9bf2744bcf87bafcd919decf
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2020-01-31 16:51:57 -08:00
Govindaraj Rajagopal
7faedc509c msm: vidc: reduce max_packets count to 480
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>
2020-01-26 12:26:23 -08:00
Karthikeyan Periasamy
855ad95f05 msm: vidc: skip scaling check for decoder
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>
2020-01-14 16:43:31 -08:00
Vikash Garodia
720369dfcf msm: vidc: ensure the validity of video buffer access
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>
2020-01-14 10:34:34 -08:00
qctecmdr
a263740664 Merge "msm: vidc: make video driver as module" 2020-01-13 11:10:34 -08:00
Malathi Gottam
e81728b7b6 msm: vidc: determine sku version based on ddr rank
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>
2020-01-03 10:38:19 -08:00
Manikanta Kanamarlapudi
946f83bbd4 msm: vidc: Update clock cycles
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>
2020-01-02 22:16:20 -08:00
Govindaraj Rajagopal
05126a1245 msm: vidc: avoid OOB write while accessing memory
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>
2020-01-02 18:06:09 -08:00
Govindaraj Rajagopal
f1e149c74a msm: vidc: remove additional checks in response_handler
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>
2020-01-02 12:40:52 -08:00
Manikanta Kanamarlapudi
7eb97316b0 msm: vidc: Update bengal Profile Level Capabilities
Update HEVC Enc/Dec, AVC Enc/Dec profile level
capabilities to align with PRD specifications.

CRs-Fixed: 2578525
Change-Id: Iff81bcbffe7034a00cd5df9f3f6e35e9500d5c77
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
2020-01-02 12:37:36 -08:00
Manikanta Kanamarlapudi
ea096260e8 msm: vidc: Fix core id value
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>
2020-01-02 12:36:25 -08:00
Dikshita Agarwal
a88ec175cd msm: vidc: update core ops for AR50LT bus calculation
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>
2020-01-02 12:25:27 -08:00
Chinmay Sawarkar
bcd5ad8e90 msm: vidc: Update cycle count for vpx
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>
2020-01-02 12:22:49 -08:00
Vikash Garodia
c7abb94cc3 msm: vidc: add 32 bit support in video driver
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>
2020-01-02 12:18:58 -08:00
qctecmdr
237897b02f Merge "msm: vidc: Update bitrate and frame-size capabilities" 2020-01-02 11:09:16 -08:00
Manikanta Kanamarlapudi
57b101caf9 msm: vidc: Update bitrate and frame-size capabilities
Update max bitrate, min frame width & height.
Add cabac bitrate capability.

CRs-Fixed: 2572200
Change-Id: I41caf4100a2f018d295fb9d802eb8353f9e67168
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
2019-12-30 17:34:26 -08:00
qctecmdr
012bf64164 Merge "msm: venc: fix custom matrix enablement" 2019-12-30 17:27:42 -08:00
Shi Zhongbo
6fe257d27f msm: venc: fix custom matrix enablement
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>
2019-12-30 16:32:50 -08:00
qctecmdr
d36a642601 Merge "msm: vidc: Fix Power Collapse issue" 2019-12-30 16:32:35 -08:00
qctecmdr
c18d461926 Merge "msm: vidc: Add video param capabilities" 2019-12-30 15:50:24 -08:00
qctecmdr
7fe2a8bf78 Merge "msm-vidc: add bw calculation for ar50LT" 2019-12-30 15:05:46 -08:00
Manikanta Kanamarlapudi
fb13af1aa4 msm: vidc: Add video param capabilities
Add heic & B-frame QP capabilities for
bengal target.

CRs-Fixed: 2558188
Change-Id: I3bfd4f2fc83792395e0a6bd9b4596d7823f92bc8
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
2019-12-30 12:09:30 -08:00
Shi Zhongbo
a0e884a3b0 msm: venc: set operating rate to 1 for HEIC
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>
2019-12-30 11:00:51 -08:00
Manikanta Kanamarlapudi
f0cfef2440 msm: vidc: Fix Power Collapse issue
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>
2019-12-30 11:00:30 -08:00
Dikshita Agarwal
c4f845c6e4 msm-vidc: add bw calculation for ar50LT
Add bw calculation logic for ar50LT.

Change-Id: I326a2d1999248cc189922cb124732e087ad9ff9e
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
2019-12-30 10:59:44 -08:00
Shi Zhongbo
2b6da92f88 msm: vidc: fix CSC coefficients
Fix to use correct CSC coefficients for
BT601 to BT709 CSC.

Change-Id: I8365603fed10151db0efbea0058bb896c419c3f4
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
2019-12-27 16:57:48 -08:00
qctecmdr
32e3693d10 Merge "msm: venc: use output resolution for vbv delay" 2019-12-27 13:12:36 -08:00
qctecmdr
b7e38e6b61 Merge "msm: venc: increase output buffer size only for hevc" 2019-12-27 12:26:39 -08:00
Shi Zhongbo
45a07678d1 msm: venc: use output resolution for vbv delay
Fix to use output port resolution to determine
vbv delay.

Change-Id: Id6dc80f1349d0f5b10be2fa6343fb98816156f58
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
2019-12-27 10:52:20 -08:00
Govindaraj Rajagopal
18c386f2f5 msm: venc: increase output buffer size only for hevc
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>
2019-12-27 10:27:30 -08:00