Commit Graph

274 Commits

Author SHA1 Message Date
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
Govindaraj Rajagopal
d1161f93dc msm: vidc: increase msm_vidc_hw_rsp_timeout to 1500
Increase msm_vidc_hw_rsp_timeout to 1500, if kerenl or firmware
log_mask is set.

Change-Id: Id12e05e78ac4b004e4ccef7ff48be4f8eca1242a
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2019-08-05 11:27:07 +05:30
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
qctecmdr
8ce34de1fe Merge "msm: venc: fix ltrmode for unsupported codec/RC type" 2019-07-30 23:59:11 -07:00
Darshana Patil
bd8775b802 msm: vidc: remove volatile flag for certain controls
Reverting the volatile flag added to GOP size, bframe
and max hier layer controls.

Change-Id: I3f74bc59e7a73882ff1ce95832b8f248a8ddb80e
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2019-07-30 18:45:10 -07:00
Darshana Patil
353089d3be msm: venc: fix ltrmode for unsupported codec/RC type
Do a get control before accessing the control value
to make sure right structure is accessed.

Change-Id: Iabf2ca85c342fe46d2236232794bbe9b9981fb18
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2019-07-30 17:07:24 -07:00
qctecmdr
8fd369bab9 Merge "msm: vidc: Add window based bitrate check in decoder" 2019-07-29 22:28:26 -07:00
qctecmdr
e8df88c30b Merge "msm: venc: Set LTR info only when LTR is enabled" 2019-07-29 21:26:34 -07:00
Qiwei Liu
15f3510a38 msm: vidc: Add window based bitrate check in decoder
In decoder, window based bitrate check will help
identify usecases where, input bitrate exceeds hw
capabilities.

CRs-Fixed: 2497423
Change-Id: Ic68bd66584ed84382ba03777d39775d08278a8a0
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2019-07-29 18:38:22 -07:00
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
Darshana Patil
a7967f7038 msm: venc: Set LTR info only when LTR is enabled
Set LTR use mask and mark index information to
firmware only when LTR count is non zero.

Change-Id: Icdcd0e8e29841e0cf4d2222ad3c2331aed2e3968
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2019-07-29 14:55:47 -07:00
Darshana Patil
1af4075b33 msm: vidc: adding support of driver editable control values using volatile flags in v4l2 control
Due to various feature constraint and best effort encode/decode, driver needs to update client
updated or default control value.Later these driver updated values are used in programming video
firmware. Hence, we need various controls as volatile

Change-Id: Ied22665addda921b0ef4827fb7a2b1fd47be5bbb
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2019-07-29 14:45:52 -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
Maheshwar Ajja
f9c4430e8b msm: vidc: handle dynamic framerate or operating rate changes
Update CVP driver clocks, buses and preprocess frame skip logic
if framerate or operating rate changed dynamically.

Change-Id: Iebed437a1d7e0e136ebf703db76528cbd102363c
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2019-07-19 16:50:44 -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