summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pwc/pwc-v4l.c
diff options
context:
space:
mode:
authorHans de Goede2012-01-10 17:01:41 +0100
committerMauro Carvalho Chehab2012-01-16 14:08:26 +0100
commitd167a85c5fb45b1ecdacdb9b7733833a9af78da8 (patch)
treebc04587bbd8d77b7a7d4eeea3e8ebb9007ae6e75 /drivers/media/video/pwc/pwc-v4l.c
parent[media] pwc: Make decoder data part of the main pwc struct (diff)
downloadkernel-qcow2-linux-d167a85c5fb45b1ecdacdb9b7733833a9af78da8.tar.gz
kernel-qcow2-linux-d167a85c5fb45b1ecdacdb9b7733833a9af78da8.tar.xz
kernel-qcow2-linux-d167a85c5fb45b1ecdacdb9b7733833a9af78da8.zip
[media] pwc: Fix pixfmt handling
Before this patch various code in the mode setting patch checked pdev->pixfmt, but that was not set until the mode setting succeeded, so it was looking at the old pixfmt! This patch fixes this by making the pixfmt a parameter to set_video_mode, and setting it from set_video_mode on success. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/pwc/pwc-v4l.c')
-rw-r--r--drivers/media/video/pwc/pwc-v4l.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/media/video/pwc/pwc-v4l.c b/drivers/media/video/pwc/pwc-v4l.c
index ef422d0ac599..b275fad2927b 100644
--- a/drivers/media/video/pwc/pwc-v4l.c
+++ b/drivers/media/video/pwc/pwc-v4l.c
@@ -493,16 +493,11 @@ static int pwc_s_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *f)
(pixelformat>>24)&255);
ret = pwc_set_video_mode(pdev, f->fmt.pix.width, f->fmt.pix.height,
- 30, &compression);
+ pixelformat, 30, &compression);
PWC_DEBUG_IOCTL("pwc_set_video_mode(), return=%d\n", ret);
- if (ret == 0) {
- pdev->pixfmt = pixelformat;
- pwc_vidioc_fill_fmt(f, pdev->width, pdev->height,
- pdev->pixfmt);
- }
-
+ pwc_vidioc_fill_fmt(f, pdev->width, pdev->height, pdev->pixfmt);
leave:
mutex_unlock(&pdev->udevlock);
return ret;
@@ -1141,8 +1136,8 @@ static int pwc_s_parm(struct file *file, void *fh,
goto leave;
}
- ret = pwc_set_video_mode(pdev, pdev->width, pdev->height, fps,
- &compression);
+ ret = pwc_set_video_mode(pdev, pdev->width, pdev->height, pdev->pixfmt,
+ fps, &compression);
pwc_g_parm(file, fh, parm);