All of lore.kernel.org
 help / color / mirror / Atom feed
* em28xx: fix bytesperline calculation in TRY_FMT
@ 2013-02-06 12:14 Hans Verkuil
  2013-02-06 12:14 ` [REVIEW PATCH] " Hans Verkuil
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Verkuil @ 2013-02-06 12:14 UTC (permalink / raw)
  To: linux-media; +Cc: fschaefer.oss, dheitmueller

Compared to the previous patch I've removed the calculation change (I still
think it is wrong, but this needs to be considered in a wider perspective).

But the more obvious problem where the current width instead of the one
provided by the application is used still needed to be fixed, which is
done by this patch.

Regards,

	Hans


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [REVIEW PATCH] em28xx: fix bytesperline calculation in TRY_FMT
  2013-02-06 12:14 em28xx: fix bytesperline calculation in TRY_FMT Hans Verkuil
@ 2013-02-06 12:14 ` Hans Verkuil
  2013-02-06 15:39   ` Frank Schäfer
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Verkuil @ 2013-02-06 12:14 UTC (permalink / raw)
  To: linux-media; +Cc: fschaefer.oss, dheitmueller, Hans Verkuil

From: Hans Verkuil <hans.verkuil@cisco.com>

The bytesperline calculation was incorrect: it used the old width instead of
the provided width. Fixed.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 drivers/media/usb/em28xx/em28xx-video.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c
index 2eabf2a..32bd7de 100644
--- a/drivers/media/usb/em28xx/em28xx-video.c
+++ b/drivers/media/usb/em28xx/em28xx-video.c
@@ -906,7 +906,7 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
 	f->fmt.pix.width = width;
 	f->fmt.pix.height = height;
 	f->fmt.pix.pixelformat = fmt->fourcc;
-	f->fmt.pix.bytesperline = (dev->width * fmt->depth + 7) >> 3;
+	f->fmt.pix.bytesperline = (width * fmt->depth + 7) >> 3;
 	f->fmt.pix.sizeimage = f->fmt.pix.bytesperline * height;
 	f->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M;
 	if (dev->progressive)
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [REVIEW PATCH] em28xx: fix bytesperline calculation in TRY_FMT
  2013-02-06 12:14 ` [REVIEW PATCH] " Hans Verkuil
@ 2013-02-06 15:39   ` Frank Schäfer
  0 siblings, 0 replies; 3+ messages in thread
From: Frank Schäfer @ 2013-02-06 15:39 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: linux-media, dheitmueller, Hans Verkuil

Am 06.02.2013 13:14, schrieb Hans Verkuil:
> From: Hans Verkuil <hans.verkuil@cisco.com>
>
> The bytesperline calculation was incorrect: it used the old width instead of
> the provided width. Fixed.
>
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> ---
>  drivers/media/usb/em28xx/em28xx-video.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c
> index 2eabf2a..32bd7de 100644
> --- a/drivers/media/usb/em28xx/em28xx-video.c
> +++ b/drivers/media/usb/em28xx/em28xx-video.c
> @@ -906,7 +906,7 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
>  	f->fmt.pix.width = width;
>  	f->fmt.pix.height = height;
>  	f->fmt.pix.pixelformat = fmt->fourcc;
> -	f->fmt.pix.bytesperline = (dev->width * fmt->depth + 7) >> 3;
> +	f->fmt.pix.bytesperline = (width * fmt->depth + 7) >> 3;
>  	f->fmt.pix.sizeimage = f->fmt.pix.bytesperline * height;
>  	f->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M;
>  	if (dev->progressive)

Acked-by: Frank Schäfer <fschaefer.oss@googlemail.com>

Also Cc: stable@kernel.org ?

Regards,
Frank


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-02-06 15:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-06 12:14 em28xx: fix bytesperline calculation in TRY_FMT Hans Verkuil
2013-02-06 12:14 ` [REVIEW PATCH] " Hans Verkuil
2013-02-06 15:39   ` Frank Schäfer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.