Commit Graph

236 Commits

Author SHA1 Message Date
qctecmdr
185da22f03 Merge "msm_vidc: vdec: add codec check for reconfig event" 2019-08-22 20:06:58 -07:00
qctecmdr
8c35bce4a2 Merge "msm_vidc: Skip mbpf check for image sessions" 2019-08-22 13:53:46 -07:00
qctecmdr
191e3fd62e Merge "msm: vidc: Set ETB extradata address to NULL during EOS" 2019-08-22 13:00:08 -07:00
qctecmdr
8dde95e9eb Merge "msm: vidc: Remove cluster controls" 2019-08-22 12:03:29 -07:00
Vikash Garodia
65106f1bc6 msm: vidc: Remove cluster controls
V4L controls are made to be part of a cluster when they
are interdependent. If any one control in that cluster
is updated, all the remaining controls get updated as well
with the current control value.
Existing video usecase does not require any v4l controls
to be clustered. Hence removing the cluster controls.

Change-Id: I98dfc4af5291837054a8a28b00942fea6866f0a9
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2019-08-21 20:20:52 +05:30
Shi Zhongbo
040e0b96c7 msm_vidc: vdec: add codec check for reconfig event
Add codec check for bit depth or color space only reconfig
event. VP9 and HEVC have bit depth reconfig event while only
HEVC has color space reconfig event.

Change-Id: Ia6732e31a15957dc7116535131203a69fe19c987
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
2019-08-21 10:24:37 +08:00
Amit Shekhar
b6d2a31088 msm_vidc: Skip mbpf check for image sessions
MBs per frame for HEIF encode can be pretty large for high resolution
images. Skip mbpf check for image sessions.

Change-Id: I993115743f4792377a3a008b341d4c8256b102b9
Signed-off-by: Amit Shekhar <ashekhar@codeaurora.org>
2019-08-20 18:22:31 -07:00
Govindaraj Rajagopal
4b98f5a1ae msm: vidc: optimize buffer tag allocation
- Possiblilty of performance hit due to memory
  alloc/free at frame level.
- Reuse same buffer_tag instead of reallocating.

Change-Id: Ifb8efc43907feea4d6da5e8a0bf0aeaa47c8e1d7
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2019-08-20 10:08:52 +05:30
Mihir Ganu
1dd6b69b53 msm: vidc: Set ETB extradata address to NULL during EOS
Firmware needs to access extradata buffer to find the size of extradata.
In secure sessions, assigning input buffer address to extradata address
causes fault since firmware does not have access to input adderss.
Extradata address and size in ETB must be set to zero for EOS cases
so that firmware skips accessing the extradata buffer.

CRs-Fixed: 2444064
Change-Id: Ia916d2f5f0500c85426fee3274f88fcf36103068
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2019-08-19 13:53:42 -07:00
qctecmdr
c8be54f0a9 Merge "msm: vidc: Add support to disable CVP usage" 2019-08-16 19:09:52 -07:00
qctecmdr
c2a859472e Merge "msm: vidc: Force venus to max if operating rate is INT_MAX" 2019-08-16 18:16:42 -07:00
Chinmay Sawarkar
8f3af55bc5 msm: vidc: Force venus to max if operating rate is INT_MAX
If client sets operating rate as INT_MAX, vote the highest
Venus clock and BW. This will allow operating the video session
at highest possible performance. DCVS & Batching is disabled.

CRs-Fixed: 2502809
Change-Id: I33e952f501a3ba6c1c8588ee319e10a586941d05
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2019-08-16 17:53:07 -07:00
Akshata Sahukar
408a8050fb msm: vidc: Add support to disable CVP usage
Add support to disable overall CVP usage.

Change-Id: I82e7a3e6533008b29f0beafba61fa7b6906aab53
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2019-08-16 15:55:45 -07:00
Akshay Chandrashekhar Kalghatgi
b1e18454d0 msm: vidc: Check NAL stream format for secure session
In case of secure encoding, NAL length based NAL header not supported.
Only startcode based NAL header is supported.

Change-Id: I119ffa47a003006e5b0d3bf7fbb5eb547de00830
2019-08-16 11:17:45 -07:00
qctecmdr
305725a1a9 Merge "msm: vidc: optimize buffer alloc in bitrate check" 2019-08-16 00:02:33 -07:00
qctecmdr
f69cf0392b Merge "Revert "msm: vidc: Fix work mode for rate control CQ"" 2019-08-15 23:16:18 -07:00
qctecmdr
992618a0c1 Merge "msm: vidc: make venus_hfi_device as a static variable" 2019-08-15 22:07:32 -07:00
Qiwei Liu
d27e0f6115 msm: vidc: optimize buffer alloc in bitrate check
Avoid alloc/free buffer at frame level in window based
bitrate check, re-use existing nodes to reduce
CPU workload, especially for HFR video.

Change-Id: I8bbbbef5229af7e608d7da1dfa4f75aab3903649
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
2019-08-15 21:55:34 +08:00
qctecmdr
953fe222c3 Merge "msm: vidc: update current value while updating the v4l controls" 2019-08-14 12:57:59 -07:00
Qiwei Liu
1ec1845dab msm: vidc: refine bus bw voting
- Avoid redundant memory alloc/free at frame level.
- Only calculate bus bw for current session.
- Skip bus bw voting if change is less than 50MBps.

Change-Id: I944670c6ac0bf663cb43f47a06b8e828ccdb28cc
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
2019-08-13 05:13:27 -07:00
Akshata Sahukar
1b9472cc6f msm: vidc: Add support for V4L2_FLAG_CVPMETADATA_SKIP flag
Introduced CVP skip flag as part of qbuf to indicate buffer is
skipped CVP processing. This is required in order to re-use CVP metadata
from previous frame when it is not an error case. Video firmware will look
at this flag and reuse CVP metadata from earlier frame to encode current frame.

Change-Id: Icf89daa2d5f19790a04f0467a15165870b283ee4
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2019-08-13 00:19:59 -07:00
qctecmdr
e13d370e88 Merge "msm: vidc: Update DCVS thresholds" 2019-08-12 21:06:42 -07:00
qctecmdr
3ee419949e Merge "msm: vidc: add support for input_tag, input_tag2 and sub-frame info" 2019-08-12 19:21:13 -07:00
qctecmdr
a81cba00ec Merge "msm: vidc: do not allow qbuf during flush" 2019-08-12 17:32:50 -07:00
qctecmdr
2fe86880cd Merge "msm: vidc: Set VBR as default rate control mode" 2019-08-12 16:49:51 -07:00
Chinmay Sawarkar
9c6de09cc9 msm: vidc: Update DCVS thresholds
DCVS Min Threshold should be FW Min count. Switch to Load_Norm
only when buffers are equally distributed between FW and Client.
This reduces clock transitions and increases residency in
Load_Low and Load_High.

CRs-Fixed: 2502809
Change-Id: I4896fd8fdffb44b546c6df3321e0155ee4a18dcb
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2019-08-12 15:58:22 -07:00
Vikash Garodia
2b881c253b msm: vidc: update current value while updating the v4l controls
A v4l control has current and new value. Current value indicates the
permanent value and any change in the control should be reflected to
current value. V4l client should ensure that while updating the
new value, current value is updated as well. If current value is
updated by v4l framework, its good, otherwise, the v4l driver should
update it.

Change-Id: Id0730465487dc4175516f4ef460758bee0b76308
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2019-08-12 21:54:19 +05:30
Govindaraj Rajagopal
4a3506cb7d msm: vidc: make venus_hfi_device as a static variable
1. Mostly venus_hfi_device ptr is derived from hal_session
   (session->device). During session close hal_session is
   freed in forward path and at the same time RBR arrives
   at feed_back path leads to race condition.
2. If forward threads acquires device->lock first then
   reverse thread may have stale device ptr(which is already
   freed), accessing that ptr leads to device crash
3. To avoid refrencing device from hal_session, made
   venus_hfi_device as a static variable within hfi_common

Change-Id: Ic5db6d4f6da6da08e16f4f00a06a3c4fec4f9c6e
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2019-08-09 20:19:35 +05:30
Govindaraj Rajagopal
09a93f806b msm: vidc: add support for input_tag, input_tag2 and sub-frame info
1. Client needs input etb to output fbd association. Introducing
   input_tag and input_tag2 fields for this. Client will send
   input_tag via etb reserved fields and client will get back
   those as part of fbd reserved fields.
2. Convey sub-frame information to client from firmware.

CRs-Fixed: 2494945

Change-Id: Ic64131c7f8f3e3035cd6ff3997fe483171d71fc4
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2019-08-09 17:06:26 +05:30
Govindaraj Rajagopal
d4e94261b5 msm: vidc: do not allow qbuf during flush
1. Don't allow qbuf (etb & ftb), if flush is issued to
   (encoder & decoder) input port.
2. Don't allow qbuf (etb & ftb), if flush is issued to encoder
   output port
3. Don't qbuf (ftb), if flush is issued to decoder output port
4. Allow qbuf (etb), if flush is issued to decoder output port
   to handle decoder reconfig.

Change-Id: I08a6a10612cc1a14ad164c55c5c8e54550c84845
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2019-08-09 16:57:19 +05:30
Mihir Ganu
226261607b msm: vidc: Set VBR as default rate control mode
Set VBR as default rate control instead of RC_OFF.

Change-Id: Ie89f0109a9fe38a6c18b4713e8e8e905beb40b70
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2019-08-08 14:50:01 -07:00
qctecmdr
0f6ff6216f Merge "msm: vidc: fix kw issues" 2019-08-08 10:31:19 -07:00
qctecmdr
1a997fa744 Merge "msm: vidc: recalculate buffer counts based on frame rate" 2019-08-08 09:47:46 -07:00
qctecmdr
2283a494c7 Merge "msm: vidc: Update cvp extradata control settings" 2019-08-08 09:01:29 -07:00
qctecmdr
75f5271221 Merge "msm: venc: add dynamic flip" 2019-08-08 08:17:59 -07:00
Shi Zhongbo
6854e171a5 msm: vidc: fix kw issues
Fix two kw issues on uninitialized pointer
and possible NULL dereference.

Change-Id: Ic87335d435ee84bef1c264d99e0d857d2932cbdc
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
2019-08-08 14:21:59 +08:00
qctecmdr
cd68fa556e Merge "msm: vidc: increase decode input buffer count" 2019-08-07 21:40:53 -07:00
qctecmdr
b1b780431d Merge "msm: vidc: Do not vote bw on ftb" 2019-08-07 21:40:53 -07:00
qctecmdr
400d1130c6 Merge "msm: vidc: avoid repeatedly set the same freq" 2019-08-07 21:40:53 -07:00
qctecmdr
d10a4f3a23 Merge "msm: vidc: add check to ensure buffer size is 4K aligned" 2019-08-07 21:40:53 -07:00
Maheshwar Ajja
34d3f0fe99 msm: vidc: recalculate buffer counts based on frame rate
Encoder buffer requirement changes based on frame rate or
operating rate (HFR/HSR usecase) and hence recalculate
buffer counts when client set frame rate or operating rate.

Change-Id: I7b421524f319a4fde8b153dcd5c3bde123c5ccf9
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2019-08-07 14:03:20 -07:00
Akshata Sahukar
b273402361 msm: vidc: Update cvp extradata control settings
If kernel to kernel CVP is enabled, initially driver disables
CVP extradata to firmware and then later, re-enables it.
Introduced a new flag to usage of CVP kernel to kernel metadata
to save the usage. As part of start streaming, driver will send
out CVP extradata enabled once based on overall usage.

Also, disabled kernel to kernel CVP usage for superframe.

Change-Id: I5590bd2274e27243da99f207d61fb00fc6fc82e0
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2019-08-06 17:40:30 -07:00
Darshana Patil
efed87ec8d msm: vidc: increase decode input buffer count
Increase input buffers count for first four elgible
sessions to avoid high memory usage. Also made changes
to extra buffer calculations.

Change-Id: Id50791f6800390ad27abc6f361e54dcc7b61a8c8
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2019-08-06 15:06:47 -07:00
Shi Zhongbo
f72fe0767d msm: venc: add dynamic flip
Add to support dynamic flip command.

Change-Id: Ide3aba6185241214eb955861bf251efd51662f03
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
2019-08-06 10:22:29 +08:00
Darshana Patil
af0e01c383 msm: vidc: make realtime as default
By default, a session is realtime. Client can
overwrite as non-realtime.Fixed realtime value
for decoder.Deprecated VIDC_REALTIME flag usage.

Change-Id: I5a1d1c9bdab18d3dfb73f3b21a23054de07d77a1
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2019-08-05 11:45:40 -07:00
Chinmay Sawarkar
02f5b95ce6 msm: vidc: Do not vote bw on ftb
Parameter that affect BW change during ETB and EBD.
During FTB BW calculation and voting is redundant.

Change-Id: I418d422f614670c2543a19709b36b3f39fd0d0e1
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2019-08-05 12:06:15 +08:00
Qiwei Liu
37de0e68d4 msm: vidc: avoid repeatedly set the same freq
If requested clk_freq is not changed, don't call
clk driver to the same value repeatedly.

Change-Id: I7ff1d7faedb10b06c0371f66b4a6cf6592d165fe
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
2019-08-02 22:34:15 +08:00
qctecmdr
b098e7cf4e Merge "msm: vidc: handle dynamic framerate or operating rate changes" 2019-07-31 23:28:48 -07:00
Govindaraj Rajagopal
a6e8541864 msm: vidc: add check to ensure buffer size is 4K aligned
Input and output buffer size must be 4K aligned for both
encoder and decoder session. So reject the session during
msm_vidc_qbuf, if alloc_len is not 4K aligned.

Change-Id: If555f26f1658ce50e12a8533cb9d59134da0aa81
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2019-08-01 11:05:13 +05:30
Darshana Patil
e047e8e387 msm: venc: remove volatile flag from LTR control
Remove volatile flag associated with LTR control.

Change-Id: I86c7fdb8b50adecf84d97145fad406f0e23002df
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2019-07-31 15:10:20 -07:00