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>
[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>
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>
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>
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>
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>
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>
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>
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>
Invoke correct APIs to handle different types of events.
Fixes: v4l2-compliance:
test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT.
Change-Id: I442fae3111d65a9612c73f2d16f9ed8031c77ec0
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
- Request api allows to synchronize controls along
with buffers.
- Client allocates a request fd. This request fd is
associated with control and set using s_ext_ctrls.
Such controls are stored by the framework and not
applied immediately.
- Request fd is also associated with input qbuf and
queued to driver. Following this actual request is
queued. Buffers do not enter the queue untill the
request is queued.
- As part of qbuf, driver call request_setup() which
inturn sets the control to driver.
Change-Id: I316c4dc2a0091b21059230be5ee5fd6379259456
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
Allow five 4K resolution video sessions to support usecases
which needs five 4K sessions.
Change-Id: Iaf0d8f46d85f563fe45d4064baf9e9ec712e9241
Signed-off-by: Maheshwar Ajja <quic_majja@quicinc.com>
Added changes to call do msm_vidc_core_init() inside
msm_vidc_probe_video_device() itself. It will uniform
core init and deinit as part of insmod and rmmod.
follow core_init and core_init_wait for all new session
open sequence.
Change-Id: I081d5ff3632296b5d2086992e6f3388daedfd1d7
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
Add support to handle AV1 bitstreams with flim grain
for both UBWC and linear colorformats.
Change-Id: Ica07853d992c566c3471dc007ad8c22aba796dd4
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
This change is made to support 100ms VBV delay for
aggressive rate control in iris3 hw.
Video buffer verifer helps to ensure that encoded stream
doesn't overflow or underflow the decoder's buffer.
iris3 hw is capable to decode data in 100ms VBV buffer window.
Adaptive Blur (Internal encoder feature): This is other enhancement
which supports adaptive blur feature on iris3 for CBR_VFR
(Constant bit rate_Variable frame rate)/CBR_CFR
(Constant bit rate_Constant frame rate) rc types apart from
already supported VBR_CFR. Unlike iris2, there is no need to enable CAC.
Below are the listed scenarios when it is enabled/disabled on iris3-
- Supported only for 8 bits encoding (H.264 & H.265).
- By default enabled for VBR_CFR/CBR_VFR/CBR_CFR RC without CAC enabled.
- No dependency on CAC to be enabled.
- Adaptive Blur is disabled if minquality_VBR is enabled
- Adaptive Blur is supported for 3 RC types: VBR_CFR, CBR_VFR & CBR_CFR
- If any one of the features (scalar/external blur) enabled, encoder
disables adaptive-blur.
- Static property available to disable adaptive blur feature
Below are the listed scenarios when it is enabled/disabled on iris2-
- Supported only for 8 bits encoding (H.264 & H.265).
- By default enabled for VBR_CFR RC type with CAC enabled.
- Dependency on CAC to be enabled.
- Adaptive Blur is disabled if CAC is disabled
- Adaptive Blur is disabled if minquality_VBR is enabled
- Adaptive Blur is not supported for any other RC types except: VBR_CFR
- If any one of the features (scalar/external blur) enabled, encoder
disables adaptive-blur.
- Static property available to disable adaptive blur feature
For backward compatibilty:
- Removed CAC as parent from msm_vidc_kalama.c.
- Removed cac query from msm_vidc_adjust_blur_type in msm_vidc_control.c.
- Moved legacy code to newly created function msm_vidc_adjust_blur_type_iris2().
- Added msm_vidc_adjust_blur_type_iris2 in BLUR_TYPES in msm_vidc_waipio.c
Change-Id: I49dec7e2574496d1b32babde55c0187866ca21d2
Signed-off-by: Mahesh Kumar Sharma <quic_smahesh@quicinc.com>
read_only and release list does not take dma ref_count
using dma_buf_get(). dma_buf ptr will be obselete when
its ref_count reaches zero. So print the dma_buf info
before releasing the ref count.
Change-Id: I8c145a1107b83c7f3b366834feb37171c8614d15
Signed-off-by: Priyanka Gujjula <quic_pgujjula@quicinc.com>
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
New session open followed by system_error will attempt to
core_init again, at the same time client is attempting to
open 2nd session, so core->state is moved to init_wait
atate.
1st session core_init request is getting timedout and i.e
leading to force core_deinit and core->state also moved to
core_deinit state.
At the sametime client is attempting to open 3rd session,
and unfortunately core is in deinit state, so it bypasses
all init_wait check moved ahead and attempted core_init
again and moved core state to init_wait and waits for
core_init_done with timeout.
2nd session got timedout and attempts deinit and moved
&core->state to core_deinit.
Client again attempts 4th session open and that will attempt
to reinitialize &core->init_done completion struct, on which
3rd session is already waiting for. So that is leading to
list corruption failure at core kernel side.
Change-Id: Idaf96355c18f34e4204214b18479f067cfc47165
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
For timestamp reorder feature, input ts is propagated to
output as it is. This is to ensure if app queues linear
order ts for bframe enabled case, it will make sure to
avoid jumbled output ts(due to DPB reordering). But looks
like client requirement is to always get sorted output
timestamp. So added change to produce output ts always
in sorted order.
Change-Id: I1f7778c99e7acfb07103ff226f2bdf306a4c2fb9
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
Added changes to update the proper stride and scanline info to firmware.
Change-Id: Ic8e119a48af8c3203fc21a320255d930f5c8585f
Signed-off-by: Gaviraju Doddabettahalli Bettegowda <quic_gdoddabe@quicinc.com>
Added support for timestamp reorder. It is default
disabled.
Change-Id: I51a6fc785860081b651fc67f443132cb2675b9fd
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
Both &inst->stats_work and &inst->response_work both were using
&inst->response_workq for scheduling works. From reverse thread
handle_session_response_work_handler incremented refcount via
get_inst_ref(), at the same time driverfd got closed by HAL.
So strongref is held by handle_session_response_work_handler and
as part of put_inst(refcount is zero), will attempt to destry
&inst->response_workq inside msm_vidc_close_helper.
destroy_workqueue() call will wait until all already fired events
to complete, which will never happen in this case i.e leading to
deadlock situation. It is an attempt to self destruction, which is
not allowed.
Added changes to avoid above mentioned situation.
Change-Id: Ieb26a4b02f87f2bb738027cfd16e4c261b756dc3
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
Release cmd + RO sent to firmware for entries present in
&inst->buffers.release.list. After issuing release cmd before
getting release done, driver removed excessive mapping entries
which holds mapping refcount as 1. So last refcount on underlying
dmabuf reaches zero.
RO & release list doesnot take dma ref_count using dma_buf_get().
Dmabuf ptr willbe obsolete when its last ref was last. So removed
print_vidc_buffer in msm_vdec_handle_release_buffer() to avoid
NULL ptr dereferrence inside print_vidc_buffer.
Change-Id: I0bdac5e2a398f67b4aac95fa78eaf6f2b816a315
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
-Removed unwanted functions
-Removed unwanted part of code from function definitions
-Added proper format specifier according to the data type.
Change-Id: I700202f1cf588506b329d202ce3e2729c027dcae
Signed-off-by: Gaviraju Doddabettahalli Bettegowda <quic_gdoddabe@quicinc.com>
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
HAL received lastflag FBD(for EOS) from reverse(polling) thread,
and before it sends SessionContinue(START_CMD) to driver, component
thread initiated streamoff on input port. So driver statemachine
got changed from DRAIN_LAST_FLAG to START_OUTPUT state.
After Streamoff sequence, reverse thread attempting START_CMD will
fail due to driver statemachine check. So q->last_buffer_dequeued
was never getting reset at v4l2 layer. As a result all subsequent
dqbuf ioctl calls will fail and leading to session hung issue.
Added change to call vb2_clear_last_buffer_dequeued() before
START_CMD rejection at driver side to avoid above mentioned issue.
Change-Id: Ic06f555f0c4deaa05c526ba9c0a19396d5a6f289
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
Using session id instead of session debug string when
dumping packet for a given session, in case of the
instance objest released in the other thread.
Change-Id: I1b91c051d510b8beea9d37de87f63f346efda050
Signed-off-by: Zhongbo Shi <quic_zhongbos@quicinc.com>
qbuf call for actual bitstream and yuv buffer 'struct v4l2_buffer'
length field indicates numplanes and for metadata buffers, length field
indicates capacity. So always check length field before accessing/
dereferencing b->m.planes or b->m.fd.
Change-Id: I409b28e0a66bd5c031b2c98c6d7614da99164a6c
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
When client called streamoff on capture port, driver needs
to flush out pending last flag buffers, if any, to avoid
session errors.
Change-Id: I733ba1a39374f38a1d63a876fb4d2fc06aa6daf7
Signed-off-by: Maheshwar Ajja <quic_majja@quicinc.com>