Commit Graph

177 Commits

Author SHA1 Message Date
Amit Shekhar
6d95875992 Revert "msm: vidc: Fix work mode for rate control CQ"
Set default double stage work-mode for HEIC sessions.

This reverts commit 10eb14941d.

Change-Id: I347e3af101ef236ba18687a5672f3bca6b49d257
Signed-off-by: Amit Shekhar <ashekhar@codeaurora.org>
2019-07-29 16:12:39 -07:00
qctecmdr
5a31d042fe Merge "msm: vidc: send dmabuf pointer instead of fd" 2019-07-27 14:33:08 -07:00
qctecmdr
048032c021 Merge "msm: vidc: Check image encode capabilities" 2019-07-25 17:21:42 -07:00
Amit Shekhar
61344c1970 msm: vidc: Check image encode capabilities
For heic/hevc image session, check respective capabilities to
allow or reject.

Change-Id: I4e565e6614a7863f75ecd4719480b850e1af43ae
Signed-off-by: Amit Shekhar <ashekhar@codeaurora.org>
2019-07-25 15:10:35 -07:00
Shi Zhongbo
bc901062aa msm: venc: add blur constraints
Add blur constraints to reject external
blur when rotation/flip/scalar enabled.

Change-Id: Ia3fd1240a7788b89736889751f8a905e06e30f12
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
2019-07-25 17:59:15 +08:00
Chinmay Sawarkar
b00fc8327b msm: vidc: Fix default_bus_vote
Update all struct values in default_bus_vote.
Calculate bw only when function available.

CRs-Fixed: 2494775
Change-Id: I70a137494c4469f928efe3ddf1f0297e2281c689
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2019-07-22 14:56:39 -07:00
qctecmdr
5c854678be Merge "msm: vidc: fix some BW and freq calculation issues" 2019-07-19 08:43:36 -07:00
qctecmdr
ff9b687e95 Merge "msm: venc: add all intra encoding supports" 2019-07-18 21:48:31 -07:00
Shi Zhongbo
c074c474fb msm: venc: add all intra encoding supports
1. Add all intra encoding capability;
2. Disable LTR, HP, Slice mode and IR settings;
3. Use WorkMode2, HQ and Pipeline 4 by force;
4. Ignore dynamic switch between IPPP and all intra;
5. Reject sessions if static/dynamic frame rate
   larger than 240;
6. Reject any non HEVC or AVC sessions;
7. Reject any HEVC Main10 profile sessions;
8. Reset all intra flag to false when stream off;

Change-Id: I9f405a7712c84bc6f8319025a7fb2a0a7f9064df
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
2019-07-19 10:05:06 +08:00
Maheshwar Ajja
ba78735a86 msm: vidc: send dmabuf pointer instead of fd
Send dmabuf pointer in reserved fields instead of fd
to CVP driver for internal CVP usage buffers as fd is
not available for these buffers.

Change-Id: Ic25a445253b4ae05748d47b7caf0b88e909aad7e
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2019-07-18 11:54:05 -07:00
Qiwei Liu
8daa8ee72f msm: vidc: fix some BW and freq calculation issues
- Modify max UBWC_CR from 3 to 5, as this value can
exceed 4 in real usecases.
- Decoder dpb read/write has already added cbcr by
dpb_factor, no need to add again.
- Decoder dpb_read BW saving factor for LLC should
be 1.3 for H264 and 1.14 for HEVC.
- VSP base cycle should be 0 for Iris/Iris2.
- Encoder ref_read_cbcr should multiply by
ref_cbcr_read_bw_factor.
- Encoder ref_write should multiply by
recon_write_bw_factor when tile enabled.
- Add fw_vpp_cycles when calculating vpp_cycles.
- Add multi-pipe factor for vpp_cycles.
- Add B-frame factor for encoder vpp_cycles.

Change-Id: I9e40203c5c89d8abdc77787a752ca240e11791f6
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
2019-07-18 15:35:02 +08:00
Priyanka Gujjula
9abcce52a6 msm: vidc: remove key frame flag usage from ebd
Remove HAL_BUFFERFLAG_SYNCFRAME flag usage support
from hfi_msg_session_empty_buffer_done_packet and
its corresponding usage in handle_ebd.

Change-Id: I2dafd35a462a443e6efa165cbf46d4b78833c765
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
2019-07-18 12:01:22 +05:30
Akshata Sahukar
4c65367a07 msm: vidc: Enable LTR use contraint by default
Encoder shall encode subsequent frames in encoding order subject to the 
following constraints:
- It shall not use short-term reference frames in display/input
  order older than the current frame with the LTR command applied
  for future encoding in encoding order.
- It shall not use LTR frames not described by the most recent USELTRFRAME.
- It may use LTR frames updated after the current frame in encoding order.

Change-Id: I167bb0e211c46f892fedb88f8054bc98543ebe8a
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2019-07-17 13:13:10 -07:00
qctecmdr
8e381af8e9 Merge "msm: vidc: Initialize 10bit bw variable" 2019-07-17 01:09:43 -07:00
qctecmdr
34c7c333cd Merge "msm: vidc: Update minimum GOP size calculation" 2019-07-16 19:24:51 -07:00
qctecmdr
03172d2c37 Merge "msm: vidc: Remove mese bw vote for video encoder" 2019-07-16 16:17:26 -07:00
qctecmdr
653e7ca445 Merge "msm: vidc: Optimize bw calculations" 2019-07-16 16:17:25 -07:00
Chinmay Sawarkar
1fc298872a msm: vidc: Initialize 10bit bw variable
In certain scenarios, y_bw_no_ubwc_10bpp and y_bw_10bpp_p010
will be used with unitialized and incorrect values.

CRs-Fixed: 2487664
Change-Id: I292ed33b60c3994886bb3756babc8ab706ceab8b
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2019-07-16 15:53:38 -07:00
qctecmdr
9a80003090 Merge "msm: vidc: queue batched buffers upon timeout" 2019-07-16 15:26:34 -07:00
Akshata Sahukar
9e0c71bb6e msm: vidc: Update minimum GOP size calculation
Use max layers allowed in a session to calculate min GOP size
instead of variable number of layers enabled during each frame
encode to avoid GOP size not being multiple of sub-GOP size issue.

Change-Id: I3bb6e5320385acea9cb892c04b586ac3ca8c753f
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2019-07-16 11:27:54 -07:00
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
Govindaraj Rajagopal
38b1e119c8 msm: vidc: queue batched buffers upon timeout
Client expects all the buffers to be returned in certain scenarios
but driver does not return due to decode batching feature. Add
delayed_work functionality to queue batched buffers to video hardware
upon timeout, so that all the buffers will be returned to client.

Change-Id: I926de1da93d941ff2a64bfec1bbd351de2f3a601
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2019-07-16 10:23:09 +05:30
Chinmay Sawarkar
c5b079d201 msm: vidc: Optimize bw calculations
Calculate DDR and LLCC bw simulteneously to avoid
redundant calculations. This reduces number of calculations
required by 50% and hence reduces cpu load.

CRs-Fixed: 2487664
Change-Id: I6e1768cd63d9b6651fbaf4a8ed8d5706929d7743
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2019-07-15 14:30:18 -07:00
Chinmay Sawarkar
fcc05b6aac msm: vidc: Remove mese bw vote for video encoder
MESE BW vote is not applicable for Kona. We can reduce overall BW
requirement by removing this vote.

CRs-Fixed: 2487664
Change-Id: I7cd6e3937e8884a2e4790a49713bd33aaab9c4bf
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2019-07-15 14:09:29 -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