summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2006-07-27 00:04:33 -0500
committerMike Isely <isely@pobox.com>2006-07-27 00:04:33 -0500
commit620d187c59c7569f3dfc140c639f8972392d9ed9 (patch)
tree1f1437afd5710da93d06d7e6c2798ddd2a63acc8 /linux/drivers/media
parente4fc875770043b0895e779dc5f2268430e82f5f2 (diff)
downloadmediapointer-dvb-s2-620d187c59c7569f3dfc140c639f8972392d9ed9.tar.gz
mediapointer-dvb-s2-620d187c59c7569f3dfc140c639f8972392d9ed9.tar.bz2
Force horizontal resolution limits in the pvrusb2 driver
From: Mike Isely <isely@pobox.com> This change causes the pvrusb2 driver to limit horizontal resolution to be only 720 if 24xxx device hardware is being used. This is a workaround for an unsolved problem in the driver where if the resolution is set to something other than 720 the video quality will be _seriously_ degraded. It only happens on 24xxx devices (29xxx are unaffected by the problem and unaffected by this change). Once the problem is finally solved, this small change can be removed. Signed-off-by: Mike Isely <isely@pobox.com>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index 1feec2c2b..211b789ff 100644
--- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -364,6 +364,30 @@ static int ctrl_freq_set(struct pvr2_ctrl *cptr,int m,int v)
return 0;
}
+#ifdef CONFIG_VIDEO_PVRUSB2_24XXX
+static int ctrl_hres_max_get(struct pvr2_ctrl *cptr,int *vp)
+{
+ /* If we're dealing with a 24xxx device, force the horizontal
+ maximum to be 720 no matter what, since we can't get the device
+ to work properly with any other value. Otherwise just return
+ the normal value. */
+ *vp = cptr->info->def.type_int.max_value;
+ if (cptr->hdw->hdw_type == PVR2_HDW_TYPE_24XXX) *vp = 720;
+ return 0;
+}
+
+static int ctrl_hres_min_get(struct pvr2_ctrl *cptr,int *vp)
+{
+ /* If we're dealing with a 24xxx device, force the horizontal
+ minimum to be 720 no matter what, since we can't get the device
+ to work properly with any other value. Otherwise just return
+ the normal value. */
+ *vp = cptr->info->def.type_int.min_value;
+ if (cptr->hdw->hdw_type == PVR2_HDW_TYPE_24XXX) *vp = 720;
+ return 0;
+}
+#endif
+
static int ctrl_cx2341x_is_dirty(struct pvr2_ctrl *cptr)
{
return cptr->hdw->enc_stale != 0;
@@ -722,6 +746,12 @@ static const struct pvr2_ctl_info control_defs[] = {
.default_value = 720,
DEFREF(res_hor),
DEFINT(320,720),
+#ifdef CONFIG_VIDEO_PVRUSB2_24XXX
+ /* Hook in check for clamp on horizontal resolution in
+ order to avoid unsolved problem involving cx25840. */
+ .get_max_value = ctrl_hres_max_get,
+ .get_min_value = ctrl_hres_min_get,
+#endif
},{
.desc = "Vertical capture resolution",
.name = "resolution_ver",