提交 bba4449c 编写于 作者: J Jean Delvare 提交者: Mauro Carvalho Chehab

V4L/DVB (8958): zr36067: Return proper bytes-per-line value

The zr36067 driver should return the actual bytes-per-line value when
queried with ioctl VIDIOC_G_FMT, instead of 0. Otherwise user-space
applications can get confused.

Likewise, with ioctl VIDIOC_S_FMT, we are supposed to fill the
bytes-per-line value. And we shouldn't fail if the caller sets the
initial value to something different from 0. This is perfectly valid
for applications to pre-fill this field with the value they expect.
Signed-off-by: NJean Delvare <khali@linux-fr.org>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 c014ec90
...@@ -2737,7 +2737,8 @@ zoran_do_ioctl (struct inode *inode, ...@@ -2737,7 +2737,8 @@ zoran_do_ioctl (struct inode *inode,
fh->v4l_settings.format->fourcc; fh->v4l_settings.format->fourcc;
fmt->fmt.pix.colorspace = fmt->fmt.pix.colorspace =
fh->v4l_settings.format->colorspace; fh->v4l_settings.format->colorspace;
fmt->fmt.pix.bytesperline = 0; fmt->fmt.pix.bytesperline =
fh->v4l_settings.bytesperline;
if (BUZ_MAX_HEIGHT < if (BUZ_MAX_HEIGHT <
(fh->v4l_settings.height * 2)) (fh->v4l_settings.height * 2))
fmt->fmt.pix.field = fmt->fmt.pix.field =
...@@ -2833,13 +2834,6 @@ zoran_do_ioctl (struct inode *inode, ...@@ -2833,13 +2834,6 @@ zoran_do_ioctl (struct inode *inode,
fmt->fmt.pix.pixelformat, fmt->fmt.pix.pixelformat,
(char *) &printformat); (char *) &printformat);
if (fmt->fmt.pix.bytesperline > 0) {
dprintk(5,
KERN_ERR "%s: bpl not supported\n",
ZR_DEVNAME(zr));
return -EINVAL;
}
/* we can be requested to do JPEG/raw playback/capture */ /* we can be requested to do JPEG/raw playback/capture */
if (! if (!
(fmt->type == V4L2_BUF_TYPE_VIDEO_CAPTURE || (fmt->type == V4L2_BUF_TYPE_VIDEO_CAPTURE ||
...@@ -2923,6 +2917,7 @@ zoran_do_ioctl (struct inode *inode, ...@@ -2923,6 +2917,7 @@ zoran_do_ioctl (struct inode *inode,
fh->jpg_buffers.buffer_size = fh->jpg_buffers.buffer_size =
zoran_v4l2_calc_bufsize(&fh-> zoran_v4l2_calc_bufsize(&fh->
jpg_settings); jpg_settings);
fmt->fmt.pix.bytesperline = 0;
fmt->fmt.pix.sizeimage = fmt->fmt.pix.sizeimage =
fh->jpg_buffers.buffer_size; fh->jpg_buffers.buffer_size;
...@@ -2979,6 +2974,8 @@ zoran_do_ioctl (struct inode *inode, ...@@ -2979,6 +2974,8 @@ zoran_do_ioctl (struct inode *inode,
/* tell the user the /* tell the user the
* results/missing stuff */ * results/missing stuff */
fmt->fmt.pix.bytesperline =
fh->v4l_settings.bytesperline;
fmt->fmt.pix.sizeimage = fmt->fmt.pix.sizeimage =
fh->v4l_settings.height * fh->v4l_settings.height *
fh->v4l_settings.bytesperline; fh->v4l_settings.bytesperline;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册