Commit Graph

540 Commits

Author SHA1 Message Date
Maheshwar Ajja
86aaa65234 msm: vidc: add cvp session priority
Set CVP session priority and colorformat.

Change-Id: Ifba0734fa0d38ec47c2aa947bee815ae7c377589
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2019-07-03 15:23:15 -07:00
Priyanka Gujjula
9ce9c42bbb msm: vidc: Avoid information leak while accessing the packet
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>
2019-07-03 21:17:07 +05:30
Govindaraj Rajagopal
a57153a3f9 msm: vidc: Add check to avoid NULL ptr dereference
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>
2019-07-03 18:26:37 +05:30
Dikshita Agarwal
9734cff1ca msm-vidc: update decoder scaling capability
Update scaling capability for decoder to reject the 
usecase where o/p resolution is less than i/p resolution.

Change-Id: I7cf85db78d51f8dd43da8d4312c92ea982054cb1
2019-07-03 12:09:05 +05:30
Darshana Patil
a705e592b9 msm: vidc: update encoder scratch1 size
Updated encoder scratch1 buffer size macro to
match HFICCB changes. This fixes mismatch in
driver and HFI macro scratch1 buffer sizes.

Change-Id: Ie61058f243dc1895e0af00b78118bbe9dbc54a98
2019-06-28 11:39:07 -07:00
qctecmdr
050df56dae Merge "msm: vidc: do not allow queue buffer in flush" 2019-06-27 21:20:51 -07:00
qctecmdr
6dcafba524 Merge "msm: vidc: add lossless encoding capability" 2019-06-27 20:42:45 -07:00
qctecmdr
2999a5c62e Merge "msm: vidc: refinements for lossless encoding" 2019-06-27 19:54:47 -07:00
Maheshwar Ajja
d5074f0078 msm: vidc: do not allow queue buffer in flush
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>
2019-06-27 09:41:25 -07:00
Shi Zhongbo
d9ceba876f msm: vidc: refinements for lossless encoding
1. Refine work mode to 2 and disable low latency by default;
2. Refine output buffer size to (width * height) * 9 / 4;
3. Double scratch buffer size for lossless encoding;

Change-Id: If298b9fc63fc2329f02dcfcef5e4fd0667d3e8e6
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
2019-06-27 16:29:47 +08:00
Shi Zhongbo
1332222345 msm: vidc: add lossless encoding capability
1. Define lossless capability upto 4096x2304@60fps;
2. Check capability when starting the streaming;

Change-Id: Iaa737aca6132b27a22a4e80a7d8eddfd83360b23
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
2019-06-27 12:50:17 +08:00
qctecmdr
bebfa4a42b Merge "msm: vidc: Increase min input buffer count by 2" 2019-06-26 21:22:50 -07:00
Chinmay Sawarkar
14f8f69554 msm: vidc: Increase min input buffer count by 2
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>
2019-06-26 16:32:18 -07:00
Darshana Patil
8bfbae799d msm: vidc: fix slice command buffer sizes
Fix HEVC slice command buffer sizes.

Change-Id: I8db40a80561eebb15fba9345d37b51bd42380c4f
2019-06-26 13:25:23 -07:00
qctecmdr
c0141cd493 Merge "msm: vidc: fix encoder internal buffer size" 2019-06-25 23:52:57 -07:00
Chinmay Sawarkar
04f6c63d2d msm: vidc: Add trace for every buffer transaction
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>
2019-06-25 15:54:47 -07:00
Darshana Patil
7a43aa6b18 msm: vidc: fix encoder internal buffer size
Fixed all encoder internal buffer size
calculation based on bitstream buffer size.

Change-Id: Ib4bdf89f356877acd151d2d0a5a7ca8901421a84
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2019-06-25 11:32:01 -07:00
Qiwei Liu
254903a695 msm: vidc: fix slice mbs setting
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>
2019-06-25 18:02:21 +08:00
qctecmdr
ab390d0f2d Merge "msm: vidc: fix slice command buffer sizes" 2019-06-24 18:45:00 -07:00
qctecmdr
930efbd82f Merge "msm: vidc: enable cvp usage" 2019-06-24 17:48:09 -07:00
qctecmdr
71b6c517d3 Merge "msm: vidc: cvp session clock rate and bus bandwidth" 2019-06-24 11:21:21 -07:00
qctecmdr
8aba0e8837 Merge "msm: vidc: add check to avoid out-of-buffer write" 2019-06-24 11:21:20 -07:00
qctecmdr
a108e35d45 Merge "msm: vidc: add superframe encode support" 2019-06-24 11:21:20 -07:00
Govindaraj Rajagopal
9fed96ca68 msm: vidc: add check to avoid out-of-buffer write
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>
2019-06-23 13:15:14 +05:30
Darshana Patil
836b73ab5f msm: vidc: fix slice command buffer sizes
Fix HEVC slice command buffer sizes.

Change-Id: I87138c75e7476e6da6c16cefed00d9a3f405b90e
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2019-06-21 18:31:58 -07:00
qctecmdr
8daa6110c7 Merge "msm-vidc: Update capabilities for VP8 codec" 2019-06-20 10:49:53 -07:00
Maheshwar Ajja
935b2ecc22 msm: vidc: cvp session clock rate and bus bandwidth
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>
2019-06-19 23:21:38 -07:00
Dikshita Agarwal
cfa9b00d0c msm-vidc: Update capabilities for VP8 codec
- Higher SKU supports 4k@30.
- Lower SKU supports 1080p@60.

Change-Id: I2581e9061eedb680e49d1b040a7291211417c31a
2019-06-20 11:15:56 +05:30
Govindaraj Rajagopal
aeee6b18df msm-vidc: restrict interlace clip resolution
[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>
2019-06-20 10:27:42 +05:30
qctecmdr
97b0836ed1 Merge "msm: vidc: fix encoder reference buffer count" 2019-06-19 17:21:49 -07:00
qctecmdr
2829ba22c6 Merge "msm: venc: Modify vbvdelay logic" 2019-06-19 17:21:49 -07:00
qctecmdr
a540f6e64d Merge "msm-vidc: calculate encode output buffer size considering 10-bit" 2019-06-19 17:21:49 -07:00
Maheshwar Ajja
5e31da536d msm: vidc: add superframe encode support
In HFR (High Frame Rate) encoding usecases client
sends superframe (single input multiple frames).
So add support for encoding superframes.

Change-Id: I6f726d0ccf5b4b831e517efd3587d822da7eaae5
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2019-06-19 16:09:52 -07:00
Akshata Sahukar
2d58b33183 msm: vidc: fix to pass correct buffer count to fw
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>
2019-06-18 18:24:26 -07:00
Darshana Patil
979119ba67 msm: vidc: fix encoder reference buffer count
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>
2019-06-18 16:47:17 -07:00
Akshata Sahukar
b491becf08 msm: vidc: Update Max Allowed MB per frame
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>
2019-06-18 15:11:00 -07:00
Darshana Patil
307e05c5f8 msm: venc: Modify vbvdelay logic
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>
2019-06-18 12:55:32 -07:00
Dikshita Agarwal
185d24cddd msm-vidc: calculate encode output buffer size considering 10-bit
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
2019-06-17 18:27:48 +05:30
qctecmdr
7c73b4c8b5 Merge "msm: vidc: add sanity checks for clocks and regulators" 2019-06-14 23:41:47 -07:00
qctecmdr
495a0403e4 Merge "msm: vidc: Update bitstream buffer size for secure case" 2019-06-14 23:41:47 -07:00
qctecmdr
28bf999dd6 Merge "msm: vidc: add additional check to avoid out of bound access" 2019-06-14 23:41:47 -07:00
qctecmdr
2b53225bae Merge "msm: vidc: add caps for batch mode decode" 2019-06-14 22:45:09 -07:00
qctecmdr
2e161c01f5 Merge "msm: vidc: Update all height and width alignment to 16" 2019-06-14 21:55:19 -07:00
qctecmdr
4f7323e6d7 Merge "msm: vidc: Add bw for cbcr dbp read and write" 2019-06-14 21:55:19 -07:00
Akshata Sahukar
82b6884d19 msm: vidc: Update all height and width alignment to 16
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>
2019-06-14 15:17:05 -07:00
Maheshwar Ajja
eb66c84844 msm: vidc: amend reconfiguration buffer requirements
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>
2019-06-14 08:01:56 -07:00
Vikash Garodia
ac11cf2022 msm: vidc: Update bitstream buffer size for secure case
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>
2019-06-14 14:39:11 +05:30
Maheshwar Ajja
82b121236b msm: vidc: amend buffer counts calculation
- 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>
2019-06-13 17:17:10 -07:00
Chinmay Sawarkar
fb9ec98d70 msm: vidc: Add bw for cbcr dbp read and write
As per system requirements this additional bw is needed
for decode session.

Change-Id: Ia435aadcf78e4e2fd7b01ed00633fa2f38729bc6
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2019-06-13 14:57:40 -07:00
Chinmay Sawarkar
d6ab63aafe msm: vidc: Use frame statistics for decode bw calculations
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>
2019-06-13 14:51:15 -07:00