The patch number 8958 was added via Mauro Carvalho Chehab <[EMAIL PROTECTED]>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        [EMAIL PROTECTED]

------

From: Jean Delvare  <[EMAIL PROTECTED]>
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.

Priority: high

Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>


---

 linux/drivers/media/video/zoran_driver.c |   13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff -r f89ee3a28992 -r a329c2e5416e linux/drivers/media/video/zoran_driver.c
--- a/linux/drivers/media/video/zoran_driver.c  Sun Sep 07 10:21:34 2008 +0200
+++ b/linux/drivers/media/video/zoran_driver.c  Sun Sep 07 10:56:55 2008 +0200
@@ -2799,7 +2799,8 @@ zoran_do_ioctl (struct inode *inode,
                                    fh->v4l_settings.format->fourcc;
                                fmt->fmt.pix.colorspace =
                                    fh->v4l_settings.format->colorspace;
-                               fmt->fmt.pix.bytesperline = 0;
+                               fmt->fmt.pix.bytesperline =
+                                   fh->v4l_settings.bytesperline;
                                if (BUZ_MAX_HEIGHT <
                                    (fh->v4l_settings.height * 2))
                                        fmt->fmt.pix.field =
@@ -2894,13 +2895,6 @@ zoran_do_ioctl (struct inode *inode,
                                fmt->fmt.pix.width, fmt->fmt.pix.height,
                                fmt->fmt.pix.pixelformat,
                                (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 
*/
                        if (!
@@ -2985,6 +2979,7 @@ zoran_do_ioctl (struct inode *inode,
                                fh->jpg_buffers.buffer_size =
                                    zoran_v4l2_calc_bufsize(&fh->
                                                            jpg_settings);
+                               fmt->fmt.pix.bytesperline = 0;
                                fmt->fmt.pix.sizeimage =
                                    fh->jpg_buffers.buffer_size;
 
@@ -3041,6 +3036,8 @@ zoran_do_ioctl (struct inode *inode,
 
                                /* tell the user the
                                 * results/missing stuff */
+                               fmt->fmt.pix.bytesperline =
+                                       fh->v4l_settings.bytesperline;
                                fmt->fmt.pix.sizeimage =
                                        fh->v4l_settings.height *
                                        fh->v4l_settings.bytesperline;


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/a329c2e5416e6ced4f3fa9901ec647180c0771fa

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to