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: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

authored by Jean Delvare and committed by Mauro Carvalho Chehab bba4449c c014ec90

+5 -8
+5 -8
drivers/media/video/zoran_driver.c
··· 2737 2737 fh->v4l_settings.format->fourcc; 2738 2738 fmt->fmt.pix.colorspace = 2739 2739 fh->v4l_settings.format->colorspace; 2740 - fmt->fmt.pix.bytesperline = 0; 2740 + fmt->fmt.pix.bytesperline = 2741 + fh->v4l_settings.bytesperline; 2741 2742 if (BUZ_MAX_HEIGHT < 2742 2743 (fh->v4l_settings.height * 2)) 2743 2744 fmt->fmt.pix.field = ··· 2834 2833 fmt->fmt.pix.pixelformat, 2835 2834 (char *) &printformat); 2836 2835 2837 - if (fmt->fmt.pix.bytesperline > 0) { 2838 - dprintk(5, 2839 - KERN_ERR "%s: bpl not supported\n", 2840 - ZR_DEVNAME(zr)); 2841 - return -EINVAL; 2842 - } 2843 - 2844 2836 /* we can be requested to do JPEG/raw playback/capture */ 2845 2837 if (! 2846 2838 (fmt->type == V4L2_BUF_TYPE_VIDEO_CAPTURE || ··· 2917 2923 fh->jpg_buffers.buffer_size = 2918 2924 zoran_v4l2_calc_bufsize(&fh-> 2919 2925 jpg_settings); 2926 + fmt->fmt.pix.bytesperline = 0; 2920 2927 fmt->fmt.pix.sizeimage = 2921 2928 fh->jpg_buffers.buffer_size; 2922 2929 ··· 2974 2979 2975 2980 /* tell the user the 2976 2981 * results/missing stuff */ 2982 + fmt->fmt.pix.bytesperline = 2983 + fh->v4l_settings.bytesperline; 2977 2984 fmt->fmt.pix.sizeimage = 2978 2985 fh->v4l_settings.height * 2979 2986 fh->v4l_settings.bytesperline;