linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
To: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Cc: linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev,
	Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Daniel Almeida <daniel.almeida@collabora.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Sebastian Fricke <sebastian.fricke@collabora.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH 3/4] media: verisilicon: Hook the (TRY_)DECODER_CMD stateless ioctls
Date: Fri, 10 Nov 2023 09:33:31 +0100	[thread overview]
Message-ID: <ZU3q2y_QA6Pznvtf@aptenodytes> (raw)
In-Reply-To: <fd9ca918dcbc892169b9f0dae7d0de537f4035ed.camel@collabora.com>

[-- Attachment #1: Type: text/plain, Size: 2709 bytes --]

Hi Nicolas,

On Thu 09 Nov 23, 16:38, Nicolas Dufresne wrote:
> Le jeudi 09 novembre 2023 à 21:16 +0100, Paul Kocialkowski a écrit :
> > The (TRY_)DECODER_CMD ioctls are used to support flushing when holding capture
> > buffers is supported. This is the case of this driver but the ioctls were never
> > hooked to the ioctl ops.
> > 
> > Add them to correctly support flushing.
> 
> While this CMD looks useful on paper, we have had no use for it in any
> open source user space. So with this in mind, shall we really enable it
> ? How can we be sure that its actually working as intended ?

Well I think it's part of the spec that it needs to be supportd.

I must admit I have never used it in a real use case either, but it can be fixed
later (without changing the uAPI) if the implementation turns out to be
malfunctioning.

Cheers,

Paul

> > Fixes: 340ce50f75a6 ("media: hantro: Enable HOLD_CAPTURE_BUF for H.264")
> > Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
> > ---
> >  drivers/media/platform/verisilicon/hantro_drv.c  | 2 ++
> >  drivers/media/platform/verisilicon/hantro_v4l2.c | 3 +++
> >  2 files changed, 5 insertions(+)
> > 
> > diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c
> > index a9fa05ac56a9..3a2a0f28cbfe 100644
> > --- a/drivers/media/platform/verisilicon/hantro_drv.c
> > +++ b/drivers/media/platform/verisilicon/hantro_drv.c
> > @@ -905,6 +905,8 @@ static int hantro_add_func(struct hantro_dev *vpu, unsigned int funcid)
> >  
> >  	if (funcid == MEDIA_ENT_F_PROC_VIDEO_ENCODER) {
> >  		vpu->encoder = func;
> > +		v4l2_disable_ioctl(vfd, VIDIOC_TRY_DECODER_CMD);
> > +		v4l2_disable_ioctl(vfd, VIDIOC_DECODER_CMD);
> >  	} else {
> >  		vpu->decoder = func;
> >  		v4l2_disable_ioctl(vfd, VIDIOC_TRY_ENCODER_CMD);
> > diff --git a/drivers/media/platform/verisilicon/hantro_v4l2.c b/drivers/media/platform/verisilicon/hantro_v4l2.c
> > index b3ae037a50f6..db145519fc5d 100644
> > --- a/drivers/media/platform/verisilicon/hantro_v4l2.c
> > +++ b/drivers/media/platform/verisilicon/hantro_v4l2.c
> > @@ -785,6 +785,9 @@ const struct v4l2_ioctl_ops hantro_ioctl_ops = {
> >  	.vidioc_g_selection = vidioc_g_selection,
> >  	.vidioc_s_selection = vidioc_s_selection,
> >  
> > +	.vidioc_decoder_cmd = v4l2_m2m_ioctl_stateless_decoder_cmd,
> > +	.vidioc_try_decoder_cmd = v4l2_m2m_ioctl_stateless_try_decoder_cmd,
> > +
> >  	.vidioc_try_encoder_cmd = v4l2_m2m_ioctl_try_encoder_cmd,
> >  	.vidioc_encoder_cmd = vidioc_encoder_cmd,
> >  };
> 

-- 
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2023-11-10 17:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-09 20:16 [PATCH 1/4] media: vicodec: Disable (TRY_)DECODER_CMD for the stateless case Paul Kocialkowski
2023-11-09 20:16 ` [PATCH 2/4] media: visl: Hook the (TRY_)DECODER_CMD stateless ioctls Paul Kocialkowski
2023-11-10 21:06   ` Daniel Almeida
2023-11-09 20:16 ` [PATCH 3/4] media: verisilicon: " Paul Kocialkowski
2023-11-09 21:38   ` Nicolas Dufresne
2023-11-10  8:33     ` Paul Kocialkowski [this message]
2023-11-10 21:07   ` Daniel Almeida
2023-11-09 20:16 ` [PATCH 4/4] media: rkvdec: " Paul Kocialkowski
2023-11-10 21:08   ` Daniel Almeida
2023-11-10 21:06 ` [PATCH 1/4] media: vicodec: Disable (TRY_)DECODER_CMD for the stateless case Daniel Almeida

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZU3q2y_QA6Pznvtf@aptenodytes \
    --to=paul.kocialkowski@bootlin.com \
    --cc=daniel.almeida@collabora.com \
    --cc=ezequiel@vanguardiasur.com.ar \
    --cc=gregkh@linuxfoundation.org \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=mchehab@kernel.org \
    --cc=nicolas.dufresne@collabora.com \
    --cc=p.zabel@pengutronix.de \
    --cc=sebastian.fricke@collabora.com \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).