public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil+cisco@kernel.org>
To: Bradford Love <brad@nextdimension.cc>, linux-media@vger.kernel.org
Subject: Re: [PATCH 05/11] au0828: Fix green screen in analog
Date: Tue, 17 Mar 2026 10:25:55 +0100	[thread overview]
Message-ID: <ff901bcb-c8f1-4a5f-950e-322253b59106@kernel.org> (raw)
In-Reply-To: <20260312213532.2907276-6-brad@nextdimension.cc>

On 12/03/2026 22:35, Bradford Love wrote:
> When the driver was converted to VB2 the original function to fix
> green frame detection was removed and a default vb2 dqbuf function
> was used instead. This vb2 dqbuf function leads to green frames not
> being detected and correupting stream captures.
> 
> The vidioc_dqbuf function checks the greenscreen flag, and, if set
> resets the stream to discard the green frame and decode a real frame.
> 
> Signed-off-by: Bradford Love <brad@nextdimension.cc>
> ---
>  drivers/media/usb/au0828/au0828-video.c | 30 +++++++++++++++++++++++--
>  1 file changed, 28 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c
> index fbaa542c8259..f65f15b1d92a 100644
> --- a/drivers/media/usb/au0828/au0828-video.c
> +++ b/drivers/media/usb/au0828/au0828-video.c
> @@ -1671,6 +1671,32 @@ static int vidioc_log_status(struct file *file, void *fh)
>  	return 0;
>  }
>  
> +static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *b)
> +{
> +	struct video_device *vdev = video_devdata(file);
> +	struct au0828_dev *dev = video_drvdata(file);
> +	int rc;
> +
> +	rc = check_dev(dev);
> +	if (rc < 0)
> +		return rc;
> +
> +	/* Workaround for a bug in the au0828 hardware design that
> +	 * sometimes results in the colorspace being inverted
> +	 */
> +	if (dev->greenscreen_detected == 1) {
> +		dprintk(1, "Detected green frame.  Resetting stream...\n");
> +		au0828_analog_stream_reset(dev);
> +		dev->greenscreen_detected = 0;
> +	}
> +
> +	if (vdev->queue->owner && vdev->queue->owner != file->private_data)
> +		return -EBUSY;
> +
> +	return vb2_dqbuf(vdev->queue, b, file->f_flags & O_NONBLOCK);

Please replace those last 4 lines with:

	return vb2_ioctl_dqbuf(file, priv, b);

It's cleaner that way.

Regards,

	Hans

> +}
> +
> +
>  void au0828_v4l2_suspend(struct au0828_dev *dev)
>  {
>  	struct urb *urb;
> @@ -1764,8 +1790,8 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = {
>  	.vidioc_prepare_buf         = vb2_ioctl_prepare_buf,
>  	.vidioc_querybuf            = vb2_ioctl_querybuf,
>  	.vidioc_qbuf                = vb2_ioctl_qbuf,
> -	.vidioc_dqbuf               = vb2_ioctl_dqbuf,
> -	.vidioc_expbuf               = vb2_ioctl_expbuf,
> +	.vidioc_dqbuf               = vidioc_dqbuf,
> +	.vidioc_expbuf              = vb2_ioctl_expbuf,
>  
>  	.vidioc_s_std               = vidioc_s_std,
>  	.vidioc_g_std               = vidioc_g_std,


  reply	other threads:[~2026-03-17  9:25 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-12 21:35 [PATCH 00/11] Assorted DVB and TV patches Bradford Love
2026-03-12 21:35 ` [PATCH 01/11] si2157: Analog format fixes Bradford Love
2026-03-12 21:35 ` [PATCH 02/11] cx25840: Fix NTSC-J, PAL-N, and SECAM standards Bradford Love
2026-03-12 21:35 ` [PATCH 03/11] xc5000: Add rf strength function Bradford Love
2026-03-12 21:35 ` [PATCH 04/11] cx231xx: Fix AGC levels for NTSC-M Bradford Love
2026-03-12 21:35 ` [PATCH 05/11] au0828: Fix green screen in analog Bradford Love
2026-03-17  9:25   ` Hans Verkuil [this message]
2026-03-17 17:28   ` [PATCH v2] media: " Bradford Love
2026-03-17 21:07     ` [PATCH v3] " Bradford Love
2026-03-19  7:34     ` [PATCH v2] " kernel test robot
2026-03-12 21:35 ` [PATCH 06/11] si2168: Fix i2c command timeout on embedded platforms Bradford Love
2026-03-12 21:35 ` [PATCH 07/11] si2168: fw 4.0-11 loses warm state during sleep Bradford Love
2026-03-12 21:35 ` [PATCH 08/11] saa7164: Fix REV2 firmware filename Bradford Love
2026-03-12 21:35 ` [PATCH 09/11] au0828: Add new Hauppauge HVR1265 and ImpactVCB-e Bradford Love
2026-03-12 21:35 ` [PATCH 10/11] em28xx: Add a variety of DualHD usb id Bradford Love
2026-03-12 21:35 ` [PATCH 11/11] em28xx: remove tuner type from Hauppauge DVB DualHD Bradford Love
2026-03-17  9:52 ` [PATCH 00/11] Assorted DVB and TV patches Hans Verkuil
2026-03-17 13:13   ` Hans Verkuil
2026-03-17 17:20     ` Bradford Love

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=ff901bcb-c8f1-4a5f-950e-322253b59106@kernel.org \
    --to=hverkuil+cisco@kernel.org \
    --cc=brad@nextdimension.cc \
    --cc=linux-media@vger.kernel.org \
    /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