Commit Graph

154 Commits

Author SHA1 Message Date
qctecmdr
ce34a06ee0 Merge "msm: vidc: Ensure size of the data available before typecasting" 2019-07-16 04:00:30 -07:00
qctecmdr
760ff0acd6 Merge "msm: vidc: Fix criteria for hybrid hierp enablement" 2019-07-16 02:27:02 -07:00
Priyanka Gujjula
3be0ff3910 msm: vidc: Ensure size of the data available before typecasting
Ensure the available data size with in the packet before type
casting from a smaller data type to larger data type in order
to avoid information leak or packet out of boundary access.

Change-Id: I8614a8b3f930c87af8aa49f77ea9d768a73ea203
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
2019-07-15 16:57:05 +05:30
qctecmdr
ac0ba4c8f7 Merge "msm: vidc: Fix scaling capability for encoders" 2019-07-12 19:30:34 -07:00
Amit Shekhar
c97d00e59f msm: vidc: Fix criteria for hybrid hierp enablement
If client doesn't request hybrid hierp or sets zero as max
enhancement layer count, then, hybrid hierp is not enabled.

Change-Id: I4284fd5c25d4dc812dac3e134ab5dfc53833bfbf
Signed-off-by: Amit Shekhar <ashekhar@codeaurora.org>
2019-07-12 15:43:19 -07:00
qctecmdr
01ee3c3978 Merge "msm: vidc: Fix validate_pkt_size macro definition" 2019-07-11 22:57:24 -07:00
qctecmdr
a35b41478f Merge "msm: vidc: fix downscale resolution calculation" 2019-07-11 21:46:10 -07:00
qctecmdr
71350c044f Merge "msm: vidc: Fix work mode for rate control CQ" 2019-07-11 18:17:43 -07:00
Akshata Sahukar
99aa37e4ae msm: vidc: fix downscale resolution calculation
Compare unmodified width and height instead of modified values to
resolve downscale resolution calculation issue.

Change-Id: I06e753e416c356ca0e97a6ad53dc12fe04c5cfa3
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2019-07-11 17:32:03 -07:00
qctecmdr
c1c807954d Merge "msm: vidc: add cvp session priority" 2019-07-11 12:45:52 -07:00
Amit Shekhar
10eb14941d msm: vidc: Fix work mode for rate control CQ
Set single stage work mode for HEIC sessions. Currently, with two
stages, encoded tiles are missing at random.

Change-Id: Iadb59102447e1873e99ae1fd03a1d7b6ce3cba1a
Signed-off-by: Amit Shekhar <ashekhar@codeaurora.org>
2019-07-11 12:43:21 -07:00
Vikash Garodia
b77f91e4fb msm: vidc: Fix scaling capability for encoders
Scaling capability are defined in Q16 format. Existing
capability indicates that the capability is 16 times i.e
output dimension can be scaled to 1/16th of input dimension.
As per specification, the achievable ratio is 8.

Change-Id: Ib9e005a055e604d3173dd8cd376d3b6666f2c12c
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2019-07-11 18:03:51 +05:30
Priyanka Gujjula
7b837fbb71 msm: vidc: Fix validate_pkt_size macro definition
Convert validate_pkt_size macro to an inline function
as this macro definition always returns true.

Change-Id: I9e7eadfe82c041721565c880eca3a46e4e3e98d9
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
2019-07-11 16:51:08 +05:30
Darshana Patil
7db4d9a424 msm: vidc: define common macro for DB disable slice boundary
Defined a common macro for disable slice boundary
deblocking mode.

Change-Id: Ie163b1268a91f278e8ed6821c88ebff32e80d9cd
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2019-07-08 13:23:17 -07:00
qctecmdr
d89f059e3a Merge "msm: vidc: Avoid information leak while accessing the packet" 2019-07-08 02:57:07 -07:00
qctecmdr
11c1adfed0 Merge "msm-vidc: update decoder scaling capability" 2019-07-06 20:44:26 -07:00
Darshana Patil
154af16cfc msm: venc: enable encoder deblocking by default
Enable encoder deblocking by default.

Change-Id: I27af7bb60ed3baac061d481ba6181eb7c2e10a7c
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2019-07-05 16:33:36 -07:00
qctecmdr
31f1acd9e2 Merge "msm: vidc: Add check to avoid NULL ptr dereference" 2019-07-04 12:47:46 -07:00
qctecmdr
550bffc032 Merge "msm: vidc: Add trace for every buffer transaction" 2019-07-04 10:34:47 -07:00
qctecmdr
a07a236782 Merge "msm-vidc: restrict interlace clip resolution" 2019-07-04 08:41:43 -07:00
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