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>
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>
AV1 bitstream frames can have different resolutions than
sequence resolutions. Subscribe to BITSTREAM_RESOLUTION and
CROP_OFFSETS metadatas and exopose them to clients so that
clients can receive per-frame resolution and crop.
Change-Id: I7c0503f25ddde201979d13ff18028681f685d649
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
Currently driver doesn't support CMD_STOP in open state.
But according to v4l2 std, the call to VIDIOC_DECODER/ENCODER_CMD()
should not fail even if any of the queues is not streaming,
but at the same time it will not initiate the Drain sequence.
So with this fix, not rejecting CMD_STOP in open state but
at the same time not initiating drain sequence.
Fixes: v4l2-compliance :
VIDIOC_(TRY_)DECODER_CMD on decoder.
VIDIOC_(TRY_)ENCODER_CMD on encoder.
Change-Id: Ie94288cca88009a8a945bd7bca70d04239a4678c
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
Decoder needs to support VIDIOC_TRY_DECODER_CMD and
Encoder needs to be support VIDIOC_TRY_ENCODER_CMD.
Partially Fixes: V4l2-complience:
testDecoder(VIDIOC_(TRY)_DECODER_CMD) for decoder.
testEncoder(VIDIOC_(TRY)_ENCODER_CMD) for encoder.
Change-Id: Ia68587412ed316f0c871397da83d6c56665cfbb5
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
- Do not clear V4L2_FL_USES_V4L2_FH flag because this
flag indicates that file->private_data points to
&struct v4l2_fh.
- Initialize v4l2 ctrl handler with driver ctrl handler.
- Add ctrl ops for g_volatile_ctrl to return updated
value of volatile ctrls from driver.
Fixes: v4l2-compliance:
testPrio (VIDIOC_G/S_PRIORITY).
testQueryControls (VIDIOC_QUERYCTRL).
Change-Id: Ibe4b6fa67d2c02a5afeb627f2060e4761c5ef717
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
Add support to set AV1 operating point to firmware.
Change-Id: If0f31c2bf04cb6d4f783264fb3ce706b1bf98261
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
Add support to set AV1 decoder bitstream format
(low-overhead or Annex-B).
Change-Id: Ie36eefe0488bf33af91802c0bee51b3fec2024ac
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
Reset video_cc_mvs0_clk_src value to resolve MMRM high video
clock projection issue.
Change-Id: I0c549d7537a82792e9de708c96c265f0dce5908d
Signed-off-by: Vikash Garodia <quic_vgarodia@quicinc.com>
New dma_buf_vmap api takes dma_buf_map struct as argument,
instead of kvaddr.
Change-Id: I2843a28b2c0c2de2d9cd1bfa96fb1a86ffba6059
Signed-off-by: Chinmay Sawarkar <quic_chinmays@quicinc.com>
Add AV1 codec, profile and level defintions and controls in UAPI.
Add these controls as private controls in video driver.
Change-Id: I58edec2d7fabceaa405708c99a75997c9f454022
Signed-off-by: Mahesh Kumar Sharma <quic_smahesh@quicinc.com>
Add the required config and platform files to enable
kalama platform with iris3 VPU.
Change-Id: Ia65d2212b946d0d37fc99e30e25fe408882bdec3
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
Fix compilation errors on parrot which has a
different lunch combo other than taro/diwali.
Change-Id: I35aee69bc8e18d50395a01b97d282c21e75da193
Signed-off-by: Priyanka Gujjula <quic_pgujjula@quicinc.com>