Commit Graph

556 Commits

Author SHA1 Message Date
Govindaraj Rajagopal
48dff0980d driver: video: disable dynamic fps detection logic for image session
Image session should run as fast as possible mode and dynamic
framerate detection is not applicable for image session. So
added change to disable that feature for image decode session.

Change-Id: Ifcfeb24d1f70009ba48e9ade77bd765c1b0e8fd7
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-07-02 21:05:52 +05:30
qctecmdr
5b091c785c Merge "msm: vidc: fix BW overvote due to wrong worst_cf in fbd" 2021-07-01 18:02:58 -07:00
qctecmdr
aaab46d99b Merge "driver: video: Reset sequence change request property only during psc handling" 2021-07-01 18:02:57 -07:00
Vikash Garodia
3b67d6b2f9 driver: video: Reset sequence change request property only during psc handling
Sequence change property would configure firmware to generate psc at every
key frame. This property is configured based on low latency settings from
the client.
For cases, when client sets low latency from 1 to 0, the hardware would
continue to run in direct mode (low latency mode). Since the sequence
change property gets disabled, there would not be psc from firmware to
change the mode to 2 stage. Hence the sequence change property to be reset
only during psc handling.

Change-Id: Ie8e17e44c921f036763f6f390397d4d812120e23
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2021-07-01 16:54:30 +05:30
Vikash Garodia
9619e7336d driver: retain real time priority even if rate is not set
There are few apk which does not set the rate. As per the design,
video sessions should run in non real time mode for such sessions.
It is leading to high power as the resources are clocked to max
in non realtime mode.
Keeping the mode as real time for such sessions.

Change-Id: I072b33038b1169788f37711ebf6cb069d0f07381
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2021-07-01 15:45:45 +05:30
Priyanka Gujjula
a3eed1e747 msm: vidc: fix BW overvote due to wrong worst_cf in fbd
For worst complexity factor received in fbd, also need
to divide it by frame_size, otherwise will cause
bus BW overvote.

Change-Id: Ibb20103c4ab8e3830eea8cf8a04b32f421b60362
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
2021-07-01 09:40:08 +05:30
Priyanka Gujjula
d388f8b5cd msm: vidc: Increase vpp cycles for 960fps use case
Increase vpp cycles to bump frequency to 366MHz
for encoder 960fps use case.

Change-Id: If0f9d0f084dfcefa9f8614ec6774588dec6b7007
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
2021-07-01 09:17:42 +05:30
Priyanka Gujjula
892f8c6647 msm: vidc: update iris2 clock calculation
As per vperf sheet, VSP FW Overhead factor(1.05) needs
to be applied to both entropy mode CABAC & CAVLC.

Change-Id: I93dc00137e0633ac2a79862c58970ba43b515ad6
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
2021-07-01 09:11:31 +05:30
Darshana Patil
c80c5b8bbb video: driver: update cycle count requirement of B frames
Decoder base cycle requirement of B frames has increased to 80.
Also, updated cycle count requirement for Encoder HIER B usecase.

Pulled from CL: 3302650.

Change-Id: I0f56166b7261e161630feeb8793473491dacccd7
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-06-29 13:51:26 -07:00
Govindaraj Rajagopal
728d12fac8 video: driver: do core_deinit for venus_hfi_core_init failure
Currently core->state is not moved to deinit for venus_hfi_core_init
failure, so it stays remains at init_wait state and rejecting all
subsequent open requests. Since core->state is in init_wait, all
subsequent requests goes for polling to move state to init, which
will never happen and all session opens will fail always.

Change-Id: Ia7e30bd8559be00022c68f907341fd0f7fdad422
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-06-28 22:41:42 +05:30
qctecmdr
4925de216c Merge "video: driver: optimize buffer pool design" 2021-06-28 00:05:43 -07:00
qctecmdr
f148f64858 Merge "video: driver: update buffer counts during codec change" 2021-06-26 22:58:56 -07:00
Govindaraj Rajagopal
5cf62d3aa0 video: driver: update buffer counts during codec change
At the time of codec change, only properties related to that
particular port gets updated. So other port is still referring
default values from previous codec type, which is not correct.
So added change to properly update buffer count during codec
change.

Change-Id: I320a0916cbf48f06448a959b07e13b74ebb0fd1c
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-06-25 19:35:04 +05:30
Govindaraj Rajagopal
55795168af video: driver: force flush debug queue packets in error scenario
During power_collapse & core_deinit sequence, always flush debug
queue irrespective of firmware logmask, to get more info about
failure.

Change-Id: I4ef328d27a77eb0807df6dc33fe0b2b92bf1feda
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-06-25 18:54:41 +05:30
Govindaraj Rajagopal
1d8d7ac788 video: driver: optimize buffer pool design
Added change to avoid unnecessary list iteration during
msm_memory_free also added logic to catch double free
request.

Change-Id: Ie3fb8019fd039e95ea75ba8f3fbd266af515e5cd
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-06-25 10:04:13 +05:30
qctecmdr
f19e84239c Merge "video: driver: dump queues for system error" 2021-06-24 10:48:08 -07:00
Govindaraj Rajagopal
7f0c2442c5 video: driver: track dma buffer leak
Track dmabuf refcount during dma_buf_get() and dma_buf_put().
So if any dmabuf present with non-zero refcount during close,
then i.e a dmabuf leak. So during session close print error
and call dma_buf_put_refcount_completely() api to recursively
reduce the count to zero and will call dma_buf_put() to avoid
dmabuf leak from video driver side.

Change-Id: I2028c18ca067977eac3cdf0ce7d6cc4200739408
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-06-24 17:15:30 +05:30
Govindaraj Rajagopal
659ec59888 video: driver: dump queues for system error
Add support to dump all queues(cmd, msg, dbg) as part
of handle_system_error using devcoredump framework.

Change-Id: Ia1b011a29e6bc657eb002dbba09deab62dc0b2b2
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-06-24 17:10:17 +05:30
qctecmdr
3730e55b29 Merge "driver: video: Migrate from split binaries to single binary firmware" 2021-06-23 20:28:07 -07:00
Darshana Patil
542929c7af video: driver: reject zero filledlen INPUT buffers
Reject zero filledlen INPUT qbuf ioctls. Expecting
non-zero filledlen.

Change-Id: I662acc72430acf8e2474b6ea26a1f2d0cb1fb6ae
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-06-23 15:48:36 -07:00
Vikash Garodia
6072a60cdc driver: video: Migrate from split binaries to single binary firmware
Migrate from mdt way of loading split firmware binaries to single image
file i.e mbn. With firmware memory carved out, there is no benefit of
keeping firmware files as split.
Loading is improved to 6ms with single image binary.
MODULE_FIRMWARE can be introduced with single binary name to provide info
of the firmware associated with video module.

Change-Id: I7126705e4a32913166eb0671a8dc0d4db5ad8955
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2021-06-23 21:22:59 +05:30
qctecmdr
bfd0fd1248 Merge "video: driver: compilation fixes for host-linux x86_64" 2021-06-23 00:23:03 -07:00
qctecmdr
62edd77cdc Merge "video: driver: add special handling for obsolete instances" 2021-06-23 00:23:03 -07:00
Praveen Chavan
0144963551 video: driver: compilation fixes for host-linux x86_64
Include errno.h explicitly and fix the order of
includes

Test:
   compile on Android for arm64
   compile off-target on host-linux for x86_64

Change-Id: I77e2469f576369d4dcea672f40413ec21ff7f3f9
Signed-off-by: Praveen Chavan <pchavan@codeaurora.org>
2021-06-22 13:56:47 -07:00
qctecmdr
9e44398cc5 Merge "video: driver: Enable Interlace for enc input buffer size calc" 2021-06-22 13:55:17 -07:00
Govindaraj Rajagopal
9e8a13389a video: driver: add special handling for obsolete instances
Currently inst struct is managed by core->instances list and it
gets unlinked during system_error and inst close sequence.
So if there a target reset situation under stability testing,
it is difficult to catch inst handle in t32 debugging. So added
such obsolete instances into core->dangling_instances, so that
it willbe helpful in debugging, it gets removed before inst free.

Change-Id: Ide9961f7c82e27406752afeb8a1f2ac86b9fa0ba
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-06-22 19:14:29 +05:30
Govindaraj Rajagopal
0a95a29157 video: driver: increase output buffer count for HEIF decode
Increase output buffer min count value from 1 -> 3 to avoid
COMV buffer size calculation mismatch between driver and
firmware.

Change-Id: I9e5b011c8d1bb221dbc3c12797fc64831c0e1cec
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-06-22 16:24:26 +05:30
Akshata Sahukar
bf8e7db0e7 video: driver: Enable Interlace for enc input buffer size calc
Gralloc / Camera allocates encoder input buffers calculated
assuming interlace enbalement. This causes driver and gralloc
enc input buffer size mismatch. Modify driver for time being,
as wrokaround to calulate enc input buffer size assuming
interlace is enabled.

Change-Id: I5f2726d46e301178d9f6bc505a27b37460aa8f41
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-06-21 16:11:35 -07:00
Maheshwar Ajja
2fc3c64665 video: driver: remove noc error log registers reading
Accessing vcodec subsystem registers without video core clock enabled
will result in register access errors. Core clock might have been
already disabled by video firmware as part of inter frame power collapse.
So do not read vcodec noc error log registers from video driver.

Change-Id: I19a32c377c661aa848fbd463ae59159cca4cfe04
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2021-06-18 16:19:49 -07:00
qctecmdr
0df7a874b9 Merge "video: driver: Add support for enc auto framerate" 2021-06-18 10:32:00 -07:00
qctecmdr
cbcb2b94fa Merge "video: driver: handle dynamic qp setting" 2021-06-17 22:15:54 -07:00
Darshana Patil
bd41af8c21 video: driver: handle dynamic qp setting
- make B and P frame QP controls as dynamic.
- enable I/P/B QP to fw as and when these
  controls are set to the driver.
- remove HEIC qp support.

Change-Id: I7f45ab0bda75df8128bbbdfcebe66c2cae208b06
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-06-17 18:11:55 -07:00
qctecmdr
9fbdc18a6d Merge "video: driver: optimize buffer pool implementation" 2021-06-17 17:57:40 -07:00
Akshata Sahukar
04e17860d7 video: driver: Fix to move enc driver state to DRAIN_LAST_FLAG
For encoder, driver state is not moved from DRAIN to
DRAIN_LAST_FLAG after receiving LAST_FLAG from firmware.
This causes RESUME command failure for v4l2 client. Fix the
same.

Change-Id: I2c64e9fa85e970e1d0feafdbd865dad61a6d21e9
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-06-17 11:38:33 -07:00
Priyanka Gujjula
e61b55879b video: driver: Add support for enc auto framerate
1. Calculate framerate based on buffer timestamp
2. If framerate changed and stable for 2 frames,
   update it to firmware and in driver internally.

Change-Id: I7feda86dec8fcfc1dff6defac8c15a97c1b8393e
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
2021-06-17 22:54:34 +05:30
Govindaraj Rajagopal
3e4248dfb0 video: driver: optimize buffer pool implementation
- Maintain free & busy pool to track buffers separately
- track double-free cases during msm_memory_free()
- track memory leak, by checking busy pool buffer count.
  it is expected to be zero at the end of a session.
- maintain common api's to init, alloc, free, destroy
  for all below buffer types.
    - struct msm_vidc_buffer
    - struct msm_vidc_alloc
    - struct msm_vidc_map
    - struct msm_vidc_timestamp.

Change-Id: Ib8655047c3883ea6601344661058d7a629ffd5bd
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-06-17 17:22:06 +05:30
qctecmdr
b113af07cb Merge "video: driver: Add enc vbr min quality restrictions" 2021-06-16 13:43:22 -07:00
Qiwei Liu
7ada486d28 video: driver: refine log level checking
Refine log level checking, to avoid some logs are
always printed if multiple level specified.

Change-Id: I151a5b8cce8d234d6d22450c43cf50d3b0065286
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
2021-06-16 21:21:31 +08:00
Akshata Sahukar
36a4971392 video: driver: Add enc vbr min quality restrictions
Do not support vbr min quality with below configs:
- HEVC 10bit
- Bitstream fps > 60
- ROI enabled/support
- HP encoding
- External Blur
- Resolution beyond 1080P.

Change-Id: I5e4a420abdd0c6fee4342c3c097684ef69bb0597
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-06-15 18:23:36 -07:00
Dikshita Agarwal
b08d4769f8 video: drive: add support to dump FW region
Add support to dump video FW region during FW crash
using devcoredump helpers.

Change-Id: I64c47160f04644223f4e831c35f7a059d38f7d83
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-06-14 11:45:21 -07:00
qctecmdr
71bb59790c Merge "video: driver: Add encoder complexity to decide power mode" 2021-06-11 01:21:50 -07:00
qctecmdr
5c6749e3e0 Merge "video: driver: allow adaptive/external blur along with rotation/flip" 2021-06-10 23:38:05 -07:00
Akshata Sahukar
973d1f0b38 video: driver: allow adaptive/external blur along with rotation/flip
[1] Allow adaptive/external blur along with rotation/flip.
[2] Update HFI_BUFFER_VPSS_ENC macro to align with CL: 30984523.

Change-Id: Ibca9f273da4a8204f586e952aeb9b2e78b5ff941
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-06-10 11:58:05 -07:00
Vikash Garodia
72699f7278 video: driver: Add encoder complexity to decide power mode
Client can choose to run an encode session to acheive maximum
performance rather than maximum quality.
Add the handling to configure video core accordingly for the
configured video session.
Such configuration is only applicable for non-realtime session.

Change-Id: Ife290b377c844e5b1d3be93b2509c787f8e05c59
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2021-06-10 05:43:00 -07:00
Govindaraj Rajagopal
0c062d5a2a video: driver: utilize mod_delayed_work functionality
mod_delayed_work() is a replacement for cancel_delayed_work()
+ queue_delayed_work(). It will update only timer value,
instead of completely cancelling and queueing a new delayed
work.

Change-Id: Id07d54e025c5a2e82f29160ae6d249d44f00bb15
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-06-10 18:00:46 +05:30
qctecmdr
281ce51f5f Merge "video: driver: amend power on and power off sequences" 2021-06-09 19:54:34 -07:00
Maheshwar Ajja
c2b39b9056 video: driver: amend power on and power off sequences
Amend power on and off sequences for iris2 video hardware.

Change-Id: Icada0b95ba5990a6911803ee9fa650a296c357db
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2021-06-09 16:42:48 -07:00
Govindaraj Rajagopal
2c0d2faefa video: driver: limit vp9 max spec to 4K@60
Added change to limit VP9 decode max spec is upto 4K@60.

Change-Id: I5939a8cf6cd227d2cced5adb3628b36493b7b1fc
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-06-09 21:07:54 +05:30
qctecmdr
16a8c42091 Merge "video: driver: encoder default level as HFI_LEVEL_NONE" 2021-06-08 23:29:45 -07:00
qctecmdr
21da327efe Merge "video: driver: do core_deinit for power_collapse failure" 2021-06-08 23:29:45 -07:00