Commit Graph

564 Commits

Author SHA1 Message Date
Akshata Sahukar
942f406c42 video: driver: Cap chroma qp offset value other than -12 as 0
Cap chroma qp offset value other than -12 as 0.

Change-Id: I0ca9c4844ab835a9365e695f38deff90768191aa
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-07-15 10:23:02 -07:00
qctecmdr
e03d09350d Merge "video: driver: add support to bugon for requested types" 2021-07-14 15:52:51 -07:00
qctecmdr
36d28e81f7 Merge "video: driver: add support to dump subsystem memory" 2021-07-14 15:52:50 -07:00
Govindaraj Rajagopal
142d7813b6 video: driver: add support to dump subsystem memory
Added support to dump subsystem region along with firmware
region and queues.

Change-Id: If032553f23195b3c9ddc9d6e18854319452558c7
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-07-13 20:04:52 +05:30
Akshata Sahukar
3aaf56bebe video: driver: set RGBA enc session input default color space as BT709 LR
If client fails to configure color aspects to driver, driver does not set
required color space flags to firmware. For RGBA enc session, there is
implicit CSC. Hence, resultant color space should be BT709 LR. But
firmware fails to generate this color space info assuming that color
space info is not required. Hence, fix this by setting BT709 LR as
default color space info for RGBA enc session.

Change-Id: I6f9fa0986dd8657b1d6bcc2c86286aa51813f518
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-07-12 17:39:33 -07:00
Govindaraj Rajagopal
63614e76b8 video: driver: add support to bugon for requested types
Added change to enable bugon at handle_system_error for
error types requested via debugfs property.

Fatal:
adb shell "echo 0x1 > /d/msm_vidc/enable_bugon"

NoC:
adb shell "echo 0x2 > /d/msm_vidc/enable_bugon"

WD Timeout:
adb shell "echo 0x4 > /d/msm_vidc/enable_bugon".

Change-Id: Iecc1b076c7ca53acee837d68e1a7446dbaef6e94
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-07-12 21:55:02 +05:30
qctecmdr
c7b23776f2 Merge "video: driver: Enable decode order for thumbnail mode" 2021-07-08 20:22:34 -07:00
qctecmdr
05aa27a1ee Merge "video: driver: amend ipsc discard handling" 2021-07-08 20:22:34 -07:00
Darshana Patil
5e9c1e75fa video: driver: amend ipsc discard handling
when client does stream on and stream off on input port,
and if ipsc is raised by fw at the same time, the ipsc
is discarded by driver and this race condition results in
incorrect port setting properties used by the driver.
To resolve this, driver will resubscribe for port settings
during the following input port streamon and fw will reraise
ipsc and new properties will be used.

Signed-off-by: Darshana Patil <darshana@codeaurora.org>
Change-Id: Id777f9c039a089846e65406e007501b62a571a25
2021-07-08 17:57:16 -07:00
qctecmdr
44e14be2f2 Merge "video: driver: move state to ERROR instead of just returning -EINVAL" 2021-07-08 17:56:10 -07:00
Akshata Sahukar
40ae39388e video: driver: Enable decode order for thumbnail mode
Enable decode order for thumbnail mode.

Change-Id: If0c7b304369d4fb1aaedccb7fe1919ab8b6077a5
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-07-08 17:54:35 -07:00
qctecmdr
716ab7d3ef Merge "video: driver: queue deferred buffers during IPSC" 2021-07-08 15:09:54 -07:00
Akshata Sahukar
975c7beb5e video: driver: move state to ERROR instead of just returning -EINVAL
move driver state to ERROR if any session pkt processing failed.

Change-Id: Id9c653eb01a0845d6d25cf16383f34707d76ba96
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-07-08 14:34:52 -07:00
qctecmdr
e1400eabe4 Merge "video: driver: enumerate color format based on preference" 2021-07-08 12:42:50 -07:00
qctecmdr
9b35e17031 Merge "video: driver: ignore input/output port streamoff if already streamed off" 2021-07-08 09:41:52 -07:00
Govindaraj Rajagopal
9fc813b9c4 video: driver: queue deferred buffers during IPSC
Queue pending buffers from decode_batch during ipsc to avoid
reconfig latency. So added change to queue all pending buffers,
if inst->state is not in START state.

Change-Id: I09eab9c1f4708ec4390486230579fab2ef216a46
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-07-08 20:05:20 +05:30
Akshata Sahukar
423459fcfc video: driver: enumerate color format based on preference
Enumerate supported color formats based on preference.
Compressed format should be populated first, then linear formats.

Change-Id: I82ebd9b9386098575c257b193be37e07ab476d9a
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-07-07 15:23:07 -07:00
Akshata Sahukar
7616a6bdad video: driver: ignore input/output port streamoff if already streamed off
Ignore input port or output port streamoff if corresponding port is already
streamed off.

Change-Id: I708126b24758ee0f76bc2646527d1baee59e5178
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-07-07 14:06:04 -07:00
Dikshita Agarwal
9a47e9a449 video: driver: update required fields of format struct
The driver should update field variable of format
structure with a value other than V4L2_FIELD_ANY.
Update it with V4L2_FIELD_NONE.

Fixes: v4l2-compliance: testGetFormats(VIDIOC_G_FMT).

Change-Id: I2338c867b543b2964c0c6a84f76cfad6862a935f
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
2021-07-07 12:01:03 -07:00
Dikshita Agarwal
d128888562 video: driver: retun error for VIDIOC_ENUM_FRAMEINTERVALS from decoder
M2M devices don't support VIDIOC_ENUM_FRAMEINTERVALS,
except for stateful encoders.

Fixes: v4l2-compliance:
	testEnumFormats (VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS).

Change-Id: I94cf3b332f7474457d8b45427ca58c1cbfb1e73d
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
2021-07-07 11:51:50 -07:00
qctecmdr
d90bcf45f5 Merge "video: driver:: handle NULL value of ctrl" 2021-07-04 00:23:18 -07:00
qctecmdr
683774e7f1 Merge "video: driver: fill required fields in capability struct" 2021-07-03 22:14:25 -07:00
qctecmdr
c0c23916cc Merge "msm: vidc: Force nominal for high bitrate decode usecases" 2021-07-02 16:24:53 -07:00
Dikshita Agarwal
167aebba8c video: driver:: handle NULL value of ctrl
In case, when control id passed by client is 0, ctrl ref will be NULL.
handle such NULL ctrl by returning -EINVAL from driver.

Fix: v4l2-compliance: testSimpleControls: Invalid Control.

Change-Id: Ie7dfe96775dd5fe71a4e467539dd261e4ba9efaf
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
2021-07-02 14:32:15 -07:00
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
Priyanka Gujjula
e186efc310 msm: vidc: Force nominal for high bitrate decode usecases
Force the clocks to NOM if bitrate nears or exceeds maximum
supported for VP9 usecases.

Change-Id: I917b0f6c624837403fd9f1499a68812acb00b568
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
2021-07-02 11:20:59 +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
Dikshita Agarwal
fc3bb7608f video: driver: fill required fields in capability struct
- Bus_info in caps shouldn’t be empty and
  the name should have valid prefix.
- Update MSM_VIDC_VERSION to ((5 << 16) + (10 << 8) + 0).

Partially Fixes: v4l2-compliance: testCap (VIDIOC_QUERYCAP).

Change-Id: I2405d1154fbb0e71f859a26169a09ed77ffa330e
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
2021-07-01 12:53:27 +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