Commit Graph

925 Commits

Author SHA1 Message Date
qctecmdr
e5966632db Merge "video: driver: handle static and dynamic properties for decoder" 2022-03-11 17:02:12 -08:00
Akshata Sahukar
ad541ef5fe video: driver: avoid uninitialized variable usage
Initialize the fence variable to avoid uninitialized variable usage.

Change-Id: I452a12d7dcb7b5778eeee159c96441ae13ed0413
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-03-10 13:07:58 -08:00
Zhongbo Shi
53447b7da5 video: driver: disable auto frame rate for WFD
Disable auto frame rate when time delta based RC
is disabled for WFD encoders.

Change-Id: I40dcf7700cfcc0de2538b43f7ede4a168e452310
Signed-off-by: Zhongbo Shi <quic_zhongbos@quicinc.com>
2022-03-08 18:40:50 -08:00
Govindaraj Rajagopal
4f1180f1a6 video: driver: handle static and dynamic properties for decoder
Added change at decoder side to use adjust/set functions for
static(streamon) and dynamic(s_ctrl) cases.

Change-Id: I3d8c32baaf2fa2c3a077cc936a8ff2159ababfe3
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-03-08 19:46:05 +05:30
qctecmdr
475418eabf Merge "video: driver: add support for MMAP io mode" 2022-02-25 09:17:52 -08:00
qctecmdr
d7658b1aee Merge "video: driver: use static const at possible places" 2022-02-23 19:58:52 -08:00
qctecmdr
37396addce Merge "video: driver: fix static and dynamic property setting sequence" 2022-02-23 19:58:51 -08:00
qctecmdr
098d0f1579 Merge "video: driver: acquire lock for request queue" 2022-02-23 19:58:50 -08:00
Akshata Sahukar
f9a844d745 video: driver: fix in header details
fix in header comment details.

Change-Id: I698b1ee9076a908a2b8f7b9c588c733567f9d8c9
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-02-23 18:08:48 -08:00
Darshana Patil
cf46bf2e54 video: driver: acquire lock for request queue
When client queues buffer via requests using
ioctl MEDIA_REQUEST_IOC_QUEUE, vidioc_qbuf
callback is not called to driver but instead
buf_queue callback is called directly.
Video driver is acquiring lock in vidioc_qbuf
but not in buf_queue and hence acquiring lock
was missing for requests which is leading to
errors. Moved lock from vidioc_qbuf to buf_queue
callback to resolve the issue.

Change-Id: I76e3fcf07b7b24218717075f2c7d4a688ad18e86
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-02-22 12:31:24 -08:00
Govindaraj Rajagopal
8b8d3ec47a video: driver: use static const at possible places
Use static const at all possible places to improve
the performance.

Change-Id: Ib9ac9eb7a15735949ae2a8ab727355e0626bc8ef
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-02-18 20:56:53 +05:30
Govindaraj Rajagopal
0fde3a9aca video: driver: fix static and dynamic property setting sequence
Added changes to reuse caps_list for setting static properties
and also modified dynamic property setting sequence. Removed
redundant implementations.

Change-Id: I5829d3c98b0159916d7794f43e445a6191050182
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-02-18 18:20:39 +05:30
qctecmdr
0841c8daa7 Merge "video: driver: Enhance fence support" 2022-02-17 17:00:57 -08:00
Akshata Sahukar
22cc24de7f video: driver: Enhance fence support
- Introduce V4L2_EVENT_VIDC_METADATA to post fence fd returned in
  ETB metadata done buffer.
- V4L2_CID_MPEG_VIDC_SW_FENCE_FD g_ctrl support for client to get
  fence fd for requested fence id.
- Addition of fence delivery and subscribtion support.
- Fence property packetization to send to firmware via FTB buffer.

Change-Id: Ifb289849e352af2c4729aa95040bd83753979970
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-02-17 13:16:53 -08:00
Govindaraj Rajagopal
93b88b9d69 video: driver: re-organize enums and add comments
Re-organized enums(msm_vidc_inst_capability_type) in below
order.

[1] Root(no parents) enums,
[2] Intermittent(having both parents & children) enums,
[3] Leaf(no children) enums.

Also added proper comments in header file.

Change-Id: I2bda51b54b6fa6e190098f16dd60090004cfbecf
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-02-17 10:33:11 -08:00
Deepa Guthyappa Madivalara
43e71fff42 Revert "video: driver: utilize v4l2_m2m_ioctl_streamon helper function"
This reverts commit e5189157f1.

Change-Id: I33e6e45ea6a08370ef8b80cddce9916bf08e613f
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2022-02-16 16:35:49 -08:00
Dikshita Agarwal
8ab5854042 video: driver: add support for MMAP io mode
If a device supports streaming, it should support MMAP
streaming mode, as it's the one streaming mode that is
always available, so applications can rely on this.

Partially Fixes: v4l2-compliance:
                 test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF.

Change-Id: Ibcb29f75f3fed4e767e05c9d203d611d45f02e8b
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-02-16 11:06:54 +05:30
Akshata Sahukar
0a5549a6a9 video: driver: decouple fence structure from video buffer
Decouple fence structure from video buffer. Also add some
misc fence flow setup support.

Change-Id: Ia4e223a3a288f0dae3238850685f3a73d4b9400a
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-02-14 09:46:11 -08:00
qctecmdr
d10f2f9108 Merge "video: driver: utilize v4l2_m2m_ioctl_streamon helper function" 2022-02-11 18:19:50 -08:00
Deepa Guthyappa Madivalara
e5189157f1 video: driver: utilize v4l2_m2m_ioctl_streamon helper function
Use v4l2_m2m_ioctl_streamon helper function for input and output ports

Change-Id: I20375259321cc5925ccaf7f8eab95a94f55d2821
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2022-02-11 16:49:44 -08:00
qctecmdr
dde62fecf8 Merge "video: driver: check whether meta buffers dequeued from FW" 2022-02-10 22:35:17 -08:00
qctecmdr
528845d245 Merge "video: driver: propagate i/p port color info to o/p port" 2022-02-10 22:35:17 -08:00
qctecmdr
8a7f66a9f4 Merge "video: driver: handle invalid format in s_fmt" 2022-02-10 22:35:17 -08:00
Akshata Sahukar
71f8dcf2f2 video: driver: Align hfi property file with CL: 35116137
Align driver hfi property file with fw file of CL: 35116137

Change-Id: Ic5abbb9212b664b55f16afa4c79e00fb0d76ae89
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-02-10 15:01:22 -08:00
Darshana Patil
18e6df6689 video: driver: check whether meta buffers dequeued from FW
when metadata is enabled check if the meta buffers are dequeued
from FW before sending vb2 buffer done on corresponding input
or output buffers.

Change-Id: Icabeaf08b398b9be0159d5db68c94734351b3a5a
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-02-09 11:53:54 -08:00
qctecmdr
fe6594bcce Merge "video: driver: add support to send input meta buffer via request" 2022-02-07 20:52:22 -08:00
Dikshita Agarwal
4d8dedc066 video: driver: handle invalid format in s_fmt
Handle invalid format 0xfffff by invoking try_fmt in
s_fmt. It is expected from driver to return EINVAL for only
unsupported buf type and if color format is unsupported,
driver should fill the fmt structure with valid values.

Partially Fixes: v4l2-compliance:
			TestSetFormat(VIDIOC_S_FMT)

Change-Id: I27e82866e8ad4a13661431f2a38a66ac3ef7dd80
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-02-07 11:20:13 +05:30
Darshana Patil
9978dc376e video: driver: add support to send input meta buffer via request
Client can enable V4L2_CID_MPEG_VIDC_INPUT_METADATA_VIA_REQUEST_ENABLE
control and send input metadata buffer via request.

Change-Id: Icccdada8253d1d0291c01e2e539968141f7ddd2c
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-02-04 13:47:34 -08:00
Akshata Sahukar
9df792a982 video: driver: propagate i/p port color info to o/p port
Client may do g_fmt on output port to fetch output port
color info. Hence, update output port color info with
client set input port color info.

Change-Id: Ifa3b16763d7389cd063493e25ce8b266ce1cb8c6
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-02-04 10:33:43 -08:00
Darshana Patil
7c4952934b video: driver: packetize dynamic controls with buffer
packetize dynamic controls set via request api along
with corresponding input buffer under the same hfi header
and queue to FW.

Change-Id: I8bf82f7ccb1ab16c42ce02189a208f5f7cb8dc70
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-02-03 15:08:02 -08:00
qctecmdr
dc71b3eaf1 Merge "video: driver: misc video changes" 2022-02-03 14:48:53 -08:00
Maheshwar Ajja
ef829ce44f video: driver: add fence support
Add fence support for decoder output buffers for
the consumer to use it to improve latency.

Change-Id: I7384b4a9793248988a2d2d546a535f26636d5bb3
Signed-off-by: Maheshwar Ajja <quic_majja@quicinc.com>
2022-02-02 21:43:52 -08:00
Govindaraj Rajagopal
0ba80e3956 video: driver: misc video changes
[1] Remove CAP_FLAG_ROOT flag. Root willbe identified
    with has_parents() api.
[2] Replace field(struct msm_vidc_inst_cap) cap -> cap_id.
[3] Rename below pool apis.
    msm_memory_alloc    -> msm_memory_pool_alloc
	msm_memory_free     -> msm_memory_pool_free
[4] Remove struct msm_vidc_inst_cap_entry usage in inst.
	inst->firmware.list -> inst->firmware_list
	inst->children.list -> inst->children_list
[5] Organize msm_vidc_inst_capability_type enums in such
    a way that all parents placed first then children. It
	will save CPU cycles while preparing caps_list.

Change-Id: I376f4e6ddec37ce326c393fba133e19ba70bab09
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-02-03 09:58:19 +05:30
qctecmdr
c8b7a6830a Merge "video-driver: prepare conflict free dependency list" 2022-02-02 14:09:20 -08:00
qctecmdr
7f8fc5be92 Merge "video-driver: disable dynamic low latency" 2022-02-02 14:09:20 -08:00
qctecmdr
1f3a7188cb Merge "video: driver: add support for create buf" 2022-02-02 13:53:27 -08:00
qctecmdr
8f0905c717 Merge "video: driver: Add HFI and internal buffer changes for AV1 DRAP" 2022-02-02 13:53:27 -08:00
qctecmdr
444d66c792 Merge "video: driver: update OP port setting if rotation is enabled" 2022-02-02 13:53:27 -08:00
Govindaraj Rajagopal
d9debeed9e video-driver: prepare conflict free dependency list
Convert multi-parent, multi-child based dependency tree
into flattened list. It is organized in such a way that
all parents willbe present before self or any child node.

For some caps, adjust sequence is called without preparing
parent nodes. So that is leading to undefined behaviour.

Added change to address these problems.

Change-Id: Ib28cae8a4ed7e019c80ecfc06519ef78ffa4dc08
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-02-02 14:59:48 +05:30
Mihir Ganu
9bacc5d124 video: driver: Add HFI and internal buffer changes for AV1 DRAP
Add changes for AV1 DRAP (Delayed Random Access Point) handling:
1) Add config in kalama database to control DRAP and the HFI property
to set DRAP config.
2) Update buffer calculations:
- When DRAP is disabled, COMV buffer must be allocated
and PERSIST buffer must be allocated with total_ref_count = 0
- When DRAP is enabled, COMV buffer must not be allocated -
it is part of PERSIST buffer. Persist buffer must be allocated with
the max_width, max_height and total_ref_count configured for DRAP.

Change-Id: I2d2e8fd3f63ea8f9fc2845acd0b4e16ba4776a6b
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2022-02-01 15:32:01 -08:00
qctecmdr
8d6bee38b3 Merge "video: driver: fix msm_vidc_remove sequence" 2022-02-01 15:21:17 -08:00
Zhongbo Shi
afa424d529 video-driver: disable dynamic low latency
Dynamic low latency causes decoder input PSC triggered
for every IDR frame, leading to clock increasing.
And this also causes power higher
for VT call. Thus, need the following changes:

1. Disable dynamic low latency when low latency mode
is enabled;
2. DO NOT allow config low latency mode after
stream on.

Change-Id: Ia57f4c75617214b0352b263425ad9b445ff95524
Signed-off-by: Zhongbo Shi <quic_zhongbos@quicinc.com>
2022-02-01 13:54:45 -08:00
Govindaraj Rajagopal
eee7bd1a5e video: driver: fix msm_vidc_remove sequence
of_platform_depopulate() will attempt to call
msm_vidc_remove for each sub device(contextbank)
individually. So added support for sub device
remove sequence.

Change-Id: I74806e30355d69f7d6080db820bad739b556366f
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-02-01 18:41:36 +05:30
Dikshita Agarwal
58e4fd1d8f video: driver: update OP port setting if rotation is enabled
Update the output port setting when set control is called for
rotation irrespective of the value of rotation angle.

Partially Fixes: v4l2-compliance: encoder:
			TestSetFormat(VIDIOC_S_FMT)

Change-Id: Ic5dce8089820f69fd38ac3b394e1c139d5d76f1b
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-02-01 15:13:18 +05:30
Dikshita Agarwal
365d8650f2 video: driver: add support for create buf
Add handling for VIDIOC_CREATE_BUFS ioctl in driver.
    This ioctl is used to create buffers for memory mapped
    or DMA buffer I/O.
    It can be used as an alternative or in addition to the
    ioctl VIDIOC_REQBUFS ioctl, when a tighter control over
    buffers is required.
    This ioctl can be called multiple times to create buffers
    of different sizes.

    Partially Fixes: v4l2-compliance:
                    test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF.

Change-Id: I9dd6c3f48e48e297b3e56fd4c8062869c8b55bee
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-02-01 13:49:53 +05:30
Dikshita Agarwal
bf0e8166d8 video: driver: add support for query buf
Add handling for VIDIOC_QUERYBUF ioctl in driver.
This can be used to query the status of a buffer
at any time after buffers have been allocated with
the VIDIOC_REQBUFS ioctl.

Partially Fixes: v4l2-compliance:
                test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF.

Change-Id: Ifd014bd8a8b02ce9fa15c62d7583bc8bcfb6756a
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-02-01 08:43:40 +05:30
qctecmdr
0c0981b43c Merge "video: driver: allow five 4K resolution video sessions" 2022-01-28 19:01:20 -08:00
qctecmdr
e37a49f7f2 Merge "video: driver: add input metadata fd control" 2022-01-28 16:46:27 -08:00
qctecmdr
1dcad3ea8c Merge "video: driver: fix subscribe event handling" 2022-01-28 14:25:03 -08:00
Darshana Patil
dce0ce7996 video: driver: add input metadata fd control
Added an extension to allow client to send
input metadata buffer fd via request api.

Change-Id: I8e05e53512b3f5dd31fa16ea64ee5d97ef2de7b4
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-01-28 13:14:31 -08:00