diff options
author | Mike Isely <isely@pobox.com> | 2006-09-02 21:37:52 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-09-26 11:30:35 -0400 |
commit | 3ad9fc37bacd74c5c05eb0bd4b76876e0daf8a2d (patch) | |
tree | fae4e6dc78ea80a95f49174dd6a806b186dca2e0 | |
parent | 22ebb77dfa94904f534563512b70178f98bbe962 (diff) |
V4L/DVB (4597): Improve resolution limit enforcements in pvrusb2
The pvrusb2 driver resolution limits are now programmed the following
way, based on empirical measurements of the hardware:
Vertical max: 480 for NTSC, 576 otherwise
Vertical min: 75 for 24xxx, 17 otherwise
Horizontal max: 720
Horizontal min: 720 for 24xxx, 19 otherwise
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-hdw.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 6ab6fd187340..88604365777c 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c | |||
@@ -377,6 +377,28 @@ static int ctrl_hres_min_get(struct pvr2_ctrl *cptr,int *vp) | |||
377 | return 0; | 377 | return 0; |
378 | } | 378 | } |
379 | 379 | ||
380 | static int ctrl_vres_max_get(struct pvr2_ctrl *cptr,int *vp) | ||
381 | { | ||
382 | /* Actual maximum depends on the video standard in effect. */ | ||
383 | if (cptr->hdw->std_mask_cur & V4L2_STD_525_60) { | ||
384 | *vp = 480; | ||
385 | } else { | ||
386 | *vp = 576; | ||
387 | } | ||
388 | return 0; | ||
389 | } | ||
390 | |||
391 | static int ctrl_vres_min_get(struct pvr2_ctrl *cptr,int *vp) | ||
392 | { | ||
393 | /* Actual minimum depends on device type. */ | ||
394 | if (cptr->hdw->hdw_type == PVR2_HDW_TYPE_24XXX) { | ||
395 | *vp = 75; | ||
396 | } else { | ||
397 | *vp = 17; | ||
398 | } | ||
399 | return 0; | ||
400 | } | ||
401 | |||
380 | static int ctrl_cx2341x_is_dirty(struct pvr2_ctrl *cptr) | 402 | static int ctrl_cx2341x_is_dirty(struct pvr2_ctrl *cptr) |
381 | { | 403 | { |
382 | return cptr->hdw->enc_stale != 0; | 404 | return cptr->hdw->enc_stale != 0; |
@@ -734,7 +756,7 @@ static const struct pvr2_ctl_info control_defs[] = { | |||
734 | .internal_id = PVR2_CID_HRES, | 756 | .internal_id = PVR2_CID_HRES, |
735 | .default_value = 720, | 757 | .default_value = 720, |
736 | DEFREF(res_hor), | 758 | DEFREF(res_hor), |
737 | DEFINT(320,720), | 759 | DEFINT(19,720), |
738 | /* Hook in check for clamp on horizontal resolution in | 760 | /* Hook in check for clamp on horizontal resolution in |
739 | order to avoid unsolved problem involving cx25840. */ | 761 | order to avoid unsolved problem involving cx25840. */ |
740 | .get_max_value = ctrl_hres_max_get, | 762 | .get_max_value = ctrl_hres_max_get, |
@@ -745,7 +767,11 @@ static const struct pvr2_ctl_info control_defs[] = { | |||
745 | .internal_id = PVR2_CID_VRES, | 767 | .internal_id = PVR2_CID_VRES, |
746 | .default_value = 480, | 768 | .default_value = 480, |
747 | DEFREF(res_ver), | 769 | DEFREF(res_ver), |
748 | DEFINT(200,625), | 770 | DEFINT(17,576), |
771 | /* Hook in check for video standard and adjust maximum | ||
772 | depending on the standard. */ | ||
773 | .get_max_value = ctrl_vres_max_get, | ||
774 | .get_min_value = ctrl_vres_min_get, | ||
749 | },{ | 775 | },{ |
750 | .v4l_id = V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ, | 776 | .v4l_id = V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ, |
751 | .default_value = V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000, | 777 | .default_value = V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000, |