Commit Graph

478 Commits

Author SHA1 Message Date
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
Chinmay Sawarkar
7e866a6a3c msm: vidc: Initialize max cf and max cr values
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>
2019-06-13 14:51:05 -07:00
qctecmdr
b9dc8d7ed3 Merge "msm: vidc: add VIDC_BUS log mask" 2019-06-12 20:11:55 -07:00
Dikshita Agarwal
56010535ad msm: vidc: add caps for batch mode decode
- Add caps for batch mode decode for lito.
- fix min value for few caps.

Change-Id: I24ae2baf506f885398ef9f121e6a25a141078db8
2019-06-12 17:33:15 +05:30
Maheshwar Ajja
d4b95d4a4e msm: vidc: add sanity checks for clocks and regulators
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>
2019-06-11 16:41:38 -07:00
qctecmdr
c8babda925 Merge "msm: vidc: Provide default profile type in s_fmt" 2019-06-11 16:25:15 -07:00
qctecmdr
635c29dcf0 Merge "msm: vidc: limit gop size to firmware max supported value" 2019-06-11 16:25:14 -07:00
Govindaraj Rajagopal
cb789feb4e msm: vidc: limit gop size to firmware max supported value
Change gop size to firmware max supported range.

Change-Id: Ic84dc498b9399b8cc453127c42acf42d31c0f3d4
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2019-06-11 10:25:49 -07:00
Akshata Sahukar
1f3b5821fe msm: vidc: Provide default profile type in s_fmt
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>
2019-06-11 10:25:19 -07:00
Maheshwar Ajja
1dcfc5752d msm: vidc: decide batching while configuration
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>
2019-06-11 10:16:12 -07:00
qctecmdr
5db23dd1f4 Merge "msm: vidc: support disable all blur feature" 2019-06-11 01:07:19 -07:00
Shi Zhongbo
2a820b1c52 msm: vidc: add VIDC_BUS log mask
Add new VIDC_BUS log mask for bus parameters
related logs.

Change-Id: If933c8c88ec2e0ccb283606da7f46a3c3c49756a
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
2019-06-11 13:44:52 +08:00
Govindaraj Rajagopal
fc8664564a msm: vidc: add additional check to avoid out of bound access
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>
2019-06-11 10:16:06 +05:30