V4L/DVB: saa7146: fix up bytesperline if it is an impossible value
xawtv using DGA on a Radeon graphics card provides bogus values to S_FBUF, which will then screw up overlay video: https://bugs.launchpad.net/ubuntu/+source/xawtv/+bug/499734 This fixes the bytesperline value if it is off completely. Signed-off-by: Michael Hunold <michael@mihu.de> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
ab51bec1f8
commit
84a1d9c83e
|
@ -558,9 +558,11 @@ static int vidioc_s_fbuf(struct file *file, void *fh, struct v4l2_framebuffer *f
|
||||||
/* ok, accept it */
|
/* ok, accept it */
|
||||||
vv->ov_fb = *fb;
|
vv->ov_fb = *fb;
|
||||||
vv->ov_fmt = fmt;
|
vv->ov_fmt = fmt;
|
||||||
if (0 == vv->ov_fb.fmt.bytesperline)
|
|
||||||
vv->ov_fb.fmt.bytesperline =
|
if (vv->ov_fb.fmt.bytesperline < vv->ov_fb.fmt.width) {
|
||||||
vv->ov_fb.fmt.width * fmt->depth / 8;
|
vv->ov_fb.fmt.bytesperline = vv->ov_fb.fmt.width * fmt->depth / 8;
|
||||||
|
DEB_D(("setting bytesperline to %d\n", vv->ov_fb.fmt.bytesperline));
|
||||||
|
}
|
||||||
|
|
||||||
mutex_unlock(&dev->lock);
|
mutex_unlock(&dev->lock);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue