linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lucas Stach <l.stach@pengutronix.de>
To: Philipp Zabel <p.zabel@pengutronix.de>
Cc: linux-media@vger.kernel.org,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	kernel@pengutronix.de
Subject: Re: [PATCH] [media] coda: do not enumerate YUYV if VDOA is not available
Date: Fri, 07 Apr 2017 09:55:11 +0200	[thread overview]
Message-ID: <1491551711.2904.51.camel@pengutronix.de> (raw)
In-Reply-To: <20170406140340.5900-1-p.zabel@pengutronix.de>

Am Donnerstag, den 06.04.2017, 16:03 +0200 schrieb Philipp Zabel:
> TRY_FMT already disables the YUYV format if the VDOA is not available.
> ENUM_FMT must do the same.
> 
> Fixes: d40e98c13b3e ("[media] coda: support YUYV output if VDOA is used")
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>

Reviewed-by: Lucas Stach <l.stach@pengutronix.de>

> ---
>  drivers/media/platform/coda/coda-common.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c
> index eb6548f46cbac..1c155b055ea30 100644
> --- a/drivers/media/platform/coda/coda-common.c
> +++ b/drivers/media/platform/coda/coda-common.c
> @@ -386,6 +386,7 @@ static int coda_enum_fmt(struct file *file, void *priv,
>  {
>  	struct video_device *vdev = video_devdata(file);
>  	const struct coda_video_device *cvd = to_coda_video_device(vdev);
> +	struct coda_ctx *ctx = fh_to_ctx(priv);
>  	const u32 *formats;
>  
>  	if (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT)
> @@ -398,6 +399,11 @@ static int coda_enum_fmt(struct file *file, void *priv,
>  	if (f->index >= CODA_MAX_FORMATS || formats[f->index] == 0)
>  		return -EINVAL;
>  
> +	/* Skip YUYV if the vdoa is not available */
> +	if (!ctx->vdoa && f->type == V4L2_BUF_TYPE_VIDEO_CAPTURE &&
> +	    formats[f->index] == V4L2_PIX_FMT_YUYV)
> +		return -EINVAL;
> +
>  	f->pixelformat = formats[f->index];
>  
>  	return 0;

      reply	other threads:[~2017-04-07  7:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-06 14:03 [PATCH] [media] coda: do not enumerate YUYV if VDOA is not available Philipp Zabel
2017-04-07  7:55 ` Lucas Stach [this message]

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=1491551711.2904.51.camel@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --cc=kernel@pengutronix.de \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=p.zabel@pengutronix.de \
    /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).