aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pwc/pwc-if.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2012-01-10 11:01:41 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-01-16 08:08:26 -0500
commitd167a85c5fb45b1ecdacdb9b7733833a9af78da8 (patch)
treebc04587bbd8d77b7a7d4eeea3e8ebb9007ae6e75 /drivers/media/video/pwc/pwc-if.c
parent56ae24aad8f9e25dfef995c3e898e5f394cf0beb (diff)
[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-if.c')
-rw-r--r--drivers/media/video/pwc/pwc-if.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/video/pwc/pwc-if.c b/drivers/media/video/pwc/pwc-if.c
index 250ad4c3e9d8..1f3386da05fa 100644
--- a/drivers/media/video/pwc/pwc-if.c
+++ b/drivers/media/video/pwc/pwc-if.c
@@ -386,7 +386,7 @@ retry:
386 /* We first try with low compression and then retry with a higher 386 /* We first try with low compression and then retry with a higher
387 compression setting if there is not enough bandwidth. */ 387 compression setting if there is not enough bandwidth. */
388 ret = pwc_set_video_mode(pdev, pdev->width, pdev->height, 388 ret = pwc_set_video_mode(pdev, pdev->width, pdev->height,
389 pdev->vframes, &compression); 389 pdev->pixfmt, pdev->vframes, &compression);
390 390
391 /* Get the current alternate interface, adjust packet size */ 391 /* Get the current alternate interface, adjust packet size */
392 intf = usb_ifnum_to_if(udev, 0); 392 intf = usb_ifnum_to_if(udev, 0);
@@ -1128,7 +1128,8 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
1128 pwc_set_leds(pdev, 0, 0); 1128 pwc_set_leds(pdev, 0, 0);
1129 1129
1130 /* Setup intial videomode */ 1130 /* Setup intial videomode */
1131 rc = pwc_set_video_mode(pdev, MAX_WIDTH, MAX_HEIGHT, 30, &compression); 1131 rc = pwc_set_video_mode(pdev, MAX_WIDTH, MAX_HEIGHT,
1132 V4L2_PIX_FMT_YUV420, 30, &compression);
1132 if (rc) 1133 if (rc)
1133 goto err_free_mem; 1134 goto err_free_mem;
1134 1135