diff options
author | Hans de Goede <hdegoede@redhat.com> | 2011-12-31 06:47:07 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-01-06 07:45:26 -0500 |
commit | 115f418bfa7575fbd1422d7fd274a2425260beb2 (patch) | |
tree | 2ce249f699d355a850ef28fd71cd892aa531fe57 | |
parent | 1516524ff299d803ff530495fd66b514ec962f75 (diff) |
[media] pwc: Remove driver specific use of pixfmt.priv in the pwc driver
The .priv field never was intended for this, setting a framerate is
support using the standardized S_PARM ioctl.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | Documentation/feature-removal-schedule.txt | 8 | ||||
-rw-r--r-- | drivers/media/video/pwc/pwc-v4l.c | 23 |
2 files changed, 6 insertions, 25 deletions
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 11b925ca52e..b7d96e14839 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -469,14 +469,6 @@ Who: Hans de Goede <hdegoede@redhat.com> | |||
469 | 469 | ||
470 | ---------------------------- | 470 | ---------------------------- |
471 | 471 | ||
472 | What: Driver specific use of pixfmt.priv in the pwc driver | ||
473 | When: 3.3 | ||
474 | Why: The .priv field never was intended for this, setting a framerate is | ||
475 | support using the standardized S_PARM ioctl | ||
476 | Who: Hans de Goede <hdegoede@redhat.com> | ||
477 | |||
478 | ---------------------------- | ||
479 | |||
480 | What: Software emulation of arbritary resolutions in the pwc driver | 472 | What: Software emulation of arbritary resolutions in the pwc driver |
481 | When: 3.3 | 473 | When: 3.3 |
482 | Why: The pwc driver claims to support any resolution between 160x120 | 474 | Why: The pwc driver claims to support any resolution between 160x120 |
diff --git a/drivers/media/video/pwc/pwc-v4l.c b/drivers/media/video/pwc/pwc-v4l.c index 566b09c7980..8b862b6916f 100644 --- a/drivers/media/video/pwc/pwc-v4l.c +++ b/drivers/media/video/pwc/pwc-v4l.c | |||
@@ -473,7 +473,7 @@ static int pwc_vidioc_try_fmt(struct pwc_device *pdev, struct v4l2_format *f) | |||
473 | static int pwc_s_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *f) | 473 | static int pwc_s_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *f) |
474 | { | 474 | { |
475 | struct pwc_device *pdev = video_drvdata(file); | 475 | struct pwc_device *pdev = video_drvdata(file); |
476 | int ret, fps, snapshot, compression, pixelformat; | 476 | int ret, pixelformat; |
477 | 477 | ||
478 | if (pwc_test_n_set_capt_file(pdev, file)) | 478 | if (pwc_test_n_set_capt_file(pdev, file)) |
479 | return -EBUSY; | 479 | return -EBUSY; |
@@ -483,16 +483,6 @@ static int pwc_s_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *f) | |||
483 | return ret; | 483 | return ret; |
484 | 484 | ||
485 | pixelformat = f->fmt.pix.pixelformat; | 485 | pixelformat = f->fmt.pix.pixelformat; |
486 | compression = pdev->vcompression; | ||
487 | snapshot = 0; | ||
488 | fps = pdev->vframes; | ||
489 | if (f->fmt.pix.priv) { | ||
490 | compression = (f->fmt.pix.priv & PWC_QLT_MASK) >> PWC_QLT_SHIFT; | ||
491 | snapshot = !!(f->fmt.pix.priv & PWC_FPS_SNAPSHOT); | ||
492 | fps = (f->fmt.pix.priv & PWC_FPS_FRMASK) >> PWC_FPS_SHIFT; | ||
493 | if (fps == 0) | ||
494 | fps = pdev->vframes; | ||
495 | } | ||
496 | 486 | ||
497 | if (pixelformat != V4L2_PIX_FMT_YUV420 && | 487 | if (pixelformat != V4L2_PIX_FMT_YUV420 && |
498 | pixelformat != V4L2_PIX_FMT_PWC1 && | 488 | pixelformat != V4L2_PIX_FMT_PWC1 && |
@@ -511,9 +501,9 @@ static int pwc_s_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *f) | |||
511 | } | 501 | } |
512 | 502 | ||
513 | PWC_DEBUG_IOCTL("Trying to set format to: width=%d height=%d fps=%d " | 503 | PWC_DEBUG_IOCTL("Trying to set format to: width=%d height=%d fps=%d " |
514 | "compression=%d snapshot=%d format=%c%c%c%c\n", | 504 | "compression=%d format=%c%c%c%c\n", |
515 | f->fmt.pix.width, f->fmt.pix.height, fps, | 505 | f->fmt.pix.width, f->fmt.pix.height, pdev->vframes, |
516 | compression, snapshot, | 506 | pdev->vcompression, |
517 | (pixelformat)&255, | 507 | (pixelformat)&255, |
518 | (pixelformat>>8)&255, | 508 | (pixelformat>>8)&255, |
519 | (pixelformat>>16)&255, | 509 | (pixelformat>>16)&255, |
@@ -522,9 +512,8 @@ static int pwc_s_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *f) | |||
522 | ret = pwc_set_video_mode(pdev, | 512 | ret = pwc_set_video_mode(pdev, |
523 | f->fmt.pix.width, | 513 | f->fmt.pix.width, |
524 | f->fmt.pix.height, | 514 | f->fmt.pix.height, |
525 | fps, | 515 | pdev->vframes, |
526 | compression, | 516 | pdev->vcompression, 0); |
527 | snapshot); | ||
528 | 517 | ||
529 | PWC_DEBUG_IOCTL("pwc_set_video_mode(), return=%d\n", ret); | 518 | PWC_DEBUG_IOCTL("pwc_set_video_mode(), return=%d\n", ret); |
530 | 519 | ||