mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
To: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Cc: Nicolas Dufresne <nicolas.dufresne@collabora.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	kernel@collabora.com, Robert Mader <robert.mader@collabora.com>,
	linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] hantro: Fix JPEG encoder ENUM_FRMSIZE on RK3399
Date: Sat, 24 Dec 2022 14:03:25 -0300	[thread overview]
Message-ID: <Y6cw3dU8Ku2+aL9y@eze-laptop> (raw)
In-Reply-To: <8d13ffb9-74cb-00f9-072a-0614e341e1ef@collabora.com>

On Sat, Dec 24, 2022 at 09:03:59AM +0100, Benjamin Gaignard wrote:
> 
> Le 23/12/2022 à 19:16, Nicolas Dufresne a écrit :
> > Since 79c987de8b354, enumerating framesize on format set with "MODE_NONE"
> > (any raw formats) is reporting an invalid frmsize.
> > 
> >    Size: Stepwise 0x0 - 0x0 with step 0/0
> > 
> > Before this change, the driver would return EINVAL, which is also invalid but
> > worked in GStreamer. The original intent was not to implement it, hence the
> > -ENOTTY return in this change. While drivers should implement ENUM_FRMSIZE for
> > all formats and queues, this change is limited in scope to fix the regression.
> > 
> > This fixes taking picture in Gnome Cheese software, or any software using
> > GSteamer to encode JPEG with hardware acceleration.
> > 
> > Fixes: 79c987de8b354 ("media: hantro: Use post processor scaling capacities")
> > Reported-by: Robert Mader <robert.mader@collabora.com>
> > Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
> 
> Reviewed-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
> 

Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>

Thanks,
Ezequiel

> > ---
> >   drivers/media/platform/verisilicon/hantro_v4l2.c | 7 +++++--
> >   1 file changed, 5 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/media/platform/verisilicon/hantro_v4l2.c b/drivers/media/platform/verisilicon/hantro_v4l2.c
> > index 2c7a805289e7b..30e650edaea8a 100644
> > --- a/drivers/media/platform/verisilicon/hantro_v4l2.c
> > +++ b/drivers/media/platform/verisilicon/hantro_v4l2.c
> > @@ -161,8 +161,11 @@ static int vidioc_enum_framesizes(struct file *file, void *priv,
> >   	}
> >   	/* For non-coded formats check if postprocessing scaling is possible */
> > -	if (fmt->codec_mode == HANTRO_MODE_NONE && hantro_needs_postproc(ctx, fmt)) {
> > -		return hanto_postproc_enum_framesizes(ctx, fsize);
> > +	if (fmt->codec_mode == HANTRO_MODE_NONE) {
> > +		if (hantro_needs_postproc(ctx, fmt))
> > +			return hanto_postproc_enum_framesizes(ctx, fsize);
> > +		else
> > +			return -ENOTTY;
> >   	} else if (fsize->index != 0) {
> >   		vpu_debug(0, "invalid frame size index (expected 0, got %d)\n",
> >   			  fsize->index);

  reply	other threads:[~2022-12-24 17:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-23 18:16 Nicolas Dufresne
2022-12-24  8:03 ` Benjamin Gaignard
2022-12-24 17:03   ` Ezequiel Garcia [this message]
2022-12-25  0:14     ` Robert Mader

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=Y6cw3dU8Ku2+aL9y@eze-laptop \
    --to=ezequiel@vanguardiasur.com.ar \
    --cc=benjamin.gaignard@collabora.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=kernel@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mchehab@kernel.org \
    --cc=nicolas.dufresne@collabora.com \
    --cc=p.zabel@pengutronix.de \
    --cc=robert.mader@collabora.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

all inboxes | Powered by JetHome®