public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Jacek Anaszewski <j.anaszewski@samsung.com>
Cc: linux-media@vger.kernel.org, kyungmin.park@samsung.com,
	s.nawrocki@samsung.com, sw0312.kim@samsung.com
Subject: Re: [PATCH 14/16] s5p-jpeg: Synchronize V4L2_CID_JPEG_CHROMA_SUBSAMPLING control value
Date: Tue, 19 Nov 2013 15:46:57 +0100	[thread overview]
Message-ID: <528B79E1.6050102@xs4all.nl> (raw)
In-Reply-To: <1384871228-6648-15-git-send-email-j.anaszewski@samsung.com>

On 11/19/2013 03:27 PM, Jacek Anaszewski wrote:
> When output queue fourcc is set to any flavour of YUV,
> the V4L2_CID_JPEG_CHROMA_SUBSAMPLING control value as
> well as its in-driver cached counterpart have to be
> updated with the subsampling property of the format
> so as to be able to provide correct information to the
> user space and preclude setting an illegal subsampling
> mode for Exynos4x12 encoder.
> 
> Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
>  drivers/media/platform/s5p-jpeg/jpeg-core.c |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c
> index 319be0c..d4db612 100644
> --- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
> +++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
> @@ -1038,6 +1038,7 @@ static int s5p_jpeg_try_fmt_vid_out(struct file *file, void *priv,
>  {
>  	struct s5p_jpeg_ctx *ctx = fh_to_ctx(priv);
>  	struct s5p_jpeg_fmt *fmt;
> +	struct v4l2_control ctrl_subs;
>  
>  	fmt = s5p_jpeg_find_format(ctx, f->fmt.pix.pixelformat,
>  						FMT_TYPE_OUTPUT);
> @@ -1048,6 +1049,10 @@ static int s5p_jpeg_try_fmt_vid_out(struct file *file, void *priv,
>  		return -EINVAL;
>  	}
>  
> +	ctrl_subs.id = V4L2_CID_JPEG_CHROMA_SUBSAMPLING;
> +	ctrl_subs.value = fmt->subsampling;
> +	v4l2_s_ctrl(priv, &ctx->ctrl_handler, &ctrl_subs);

TRY_FMT should never have side-effects, so this isn't the correct
way of implementing this.

Also, don't use v4l2_s_ctrl, instead use v4l2_ctrl_s_ctrl. The v4l2_s_ctrl
function is for core framework use only, not for use in drivers.

Regards,

	Hans

> +
>  	return vidioc_try_fmt(f, fmt, ctx, FMT_TYPE_OUTPUT);
>  }
>  
> 


  reply	other threads:[~2013-11-19 14:47 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-19 14:26 [PATCH 00/16] Add support for Exynox4x12 to the s5p-jpeg driver Jacek Anaszewski
2013-11-19 14:26 ` [PATCH 01/16] s5p-jpeg: Reorder quantization tables Jacek Anaszewski
2013-11-19 14:26 ` [PATCH 02/16] s5p-jpeg: Fix output YUV 4:2:0 fourcc for decoder Jacek Anaszewski
2013-11-19 14:26 ` [PATCH 03/16] s5p-jpeg: Fix erroneous condition while validating bytesperline value Jacek Anaszewski
2013-11-19 14:26 ` [PATCH 04/16] s5p-jpeg: Remove superfluous call to the jpeg_bound_align_image function Jacek Anaszewski
2013-11-19 14:26 ` [PATCH 05/16] s5p-jpeg: Rename functions specific to the S5PC210 SoC accordingly Jacek Anaszewski
2013-11-19 14:26 ` [PATCH 06/16] s5p-jpeg: Fix clock resource management Jacek Anaszewski
2013-11-19 14:26 ` [PATCH 07/16] s5p-jpeg: Fix lack of spin_lock protection Jacek Anaszewski
2013-11-19 14:27 ` [PATCH 08/16] s5p-jpeg: Synchronize cached controls with V4L2 core Jacek Anaszewski
2013-11-19 14:27 ` [PATCH 09/16] s5p-jpeg: Split jpeg-hw.h to jpeg-hw-s5p.c and jpeg-hw-s5p.c Jacek Anaszewski
2013-11-19 14:27 ` [PATCH 10/16] s5p-jpeg: Add hardware API for the exynos4x12 JPEG codec Jacek Anaszewski
2013-11-19 14:27 ` [PATCH 11/16] s5p-jpeg: Retrieve "YCbCr subsampling" field from the jpeg header Jacek Anaszewski
2013-11-19 14:27 ` [PATCH 12/16] s5p-jpeg: Ensure correct capture format for Exynos4x12 Jacek Anaszewski
2013-11-19 14:27 ` [PATCH 13/16] s5p-jpeg: Allow for wider JPEG subsampling scope for Exynos4x12 encoder Jacek Anaszewski
2013-11-19 14:27 ` [PATCH 14/16] s5p-jpeg: Synchronize V4L2_CID_JPEG_CHROMA_SUBSAMPLING control value Jacek Anaszewski
2013-11-19 14:46   ` Hans Verkuil [this message]
2013-11-20 13:47     ` Jacek Anaszewski
2013-11-20 14:13       ` Hans Verkuil
2013-11-19 14:27 ` [PATCH 15/16] s5p-jpeg: Ensure setting correct value of the chroma subsampling control Jacek Anaszewski
2013-11-19 14:52   ` Hans Verkuil
2013-11-19 14:27 ` [PATCH 16/16] s5p-jpeg: Adjust g_volatile_ctrl callback to Exynos4x12 needs Jacek Anaszewski

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=528B79E1.6050102@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=j.anaszewski@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-media@vger.kernel.org \
    --cc=s.nawrocki@samsung.com \
    --cc=sw0312.kim@samsung.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