Commit Graph

533 Commits

Author SHA1 Message Date
Amit Shekhar
328a5418c5 msm: vidc: Remove b-frame enablement decision logic
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>
2020-03-26 14:24:25 -07:00
Chinmay Sawarkar
580131ac8b msm: vidc: Update internal buffer size calculations
Internal buffer size formulae updated to handle non-backward
compatible changes in the Firmware.

Change-Id: I324da7b698f216bd1bc1c3349cae51cdc4ec631a
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2020-03-25 15:42:29 -07:00
Amit Shekhar
0701e2bcef msm: vidc: Fix bitrate setting for CQ rc-mode sessions
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>
2020-03-25 14:30:55 -07:00
Mihir Ganu
8594905e54 msm: vidc: Set encoder persist buffer to FW
Set the allocated encoder persist buffer to firmware.

Change-Id: I83fdf2dace76848e4a5ad4d8f3a85c9605b56cd0
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2020-03-24 12:21:18 -07:00
qctecmdr
548c8ad2f1 Merge "msm: vidc: Use correct parameter types in callbacks" 2020-03-23 16:40:16 -07:00
qctecmdr
7eaa56d70c Merge "msm: vidc: add check for prefetch memory sufficiency" 2020-03-23 16:40:16 -07:00
Maheshwar Ajja
24de1903d9 msm: vidc: mark few standard controls as custom controls
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>
2020-03-20 20:34:36 -07:00
Mihir Ganu
69f3ae926c msm: vidc: Use correct parameter types in callbacks
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>
2020-03-20 20:32:58 -07:00
Akshay Chandrashekhar Kalghatgi
972cddc45f msm: vidc: add check for prefetch memory sufficiency
Check if the non-pix and pix prefetched memory is sufficient

Change-Id: I71561959a3ed1e9acdb654650144f35656230345
Signed-off-by: Akshay Chandrashekhar Kalghatgi <akalghat@codeaurora.org>
2020-03-17 11:31:51 -07:00
Mihir Ganu
20ebbed266 msm: vidc: Perform cache operations on all planes
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>
2020-03-13 16:53:05 -07:00
qctecmdr
1af989dbb8 Merge "msm: vidc: Add support to prefetch & drain memory" 2020-03-13 02:50:00 -07:00
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
Akshay Chandrashekhar Kalghatgi
feb7dabc19 msm: vidc: Get FW name from DT
Get Video FW ELF image name from driver's DT entry.

Change-Id: I95320f2b1bdf9ba9e8bb6264babc33c162da60e0
Signed-off-by: Akshay Chandrashekhar Kalghatgi <akalghat@codeaurora.org>
2020-03-12 12:16:18 -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