ChangeSet 1.893.2.19, 2002/12/26 18:54:02-08:00, spse@secret.org.uk [PATCH] 2.4.20 usbvideo fixes from 2.5 4/5 Add setVideoMode callback to VIDIOCSWIN Make VIDIOCGWIN return videosize instead of canvas size diff -Nru a/drivers/usb/usbvideo.c b/drivers/usb/usbvideo.c --- a/drivers/usb/usbvideo.c Mon Jan 6 11:30:18 2003 +++ b/drivers/usb/usbvideo.c Mon Jan 6 11:30:18 2003 @@ -1417,6 +1417,9 @@ if (copy_from_user(&vw, arg, sizeof(vw))) return -EFAULT; + if (VALID_CALLBACK(uvd, setVideoMode)) { + return GET_CALLBACK(uvd, setVideoMode)(uvd, &vw); + } if (vw.flags) return -EINVAL; if (vw.clipcount) @@ -1434,8 +1437,8 @@ vw.x = 0; vw.y = 0; - vw.width = VIDEOSIZE_X(uvd->canvas); - vw.height = VIDEOSIZE_Y(uvd->canvas); + vw.width = VIDEOSIZE_X(uvd->videosize); + vw.height = VIDEOSIZE_Y(uvd->videosize); vw.chromakey = 0; if (VALID_CALLBACK(uvd, getFPS)) vw.flags = GET_CALLBACK(uvd, getFPS)(uvd); diff -Nru a/drivers/usb/usbvideo.h b/drivers/usb/usbvideo.h --- a/drivers/usb/usbvideo.h Mon Jan 6 11:30:18 2003 +++ b/drivers/usb/usbvideo.h Mon Jan 6 11:30:18 2003 @@ -270,6 +270,7 @@ int (*procfs_write)(struct file *file,const char *buffer,unsigned long count,void *data); int (*startDataPump)(struct uvd *uvd); void (*stopDataPump)(struct uvd *uvd); + int (*setVideoMode)(struct uvd *uvd, struct video_window *vw); }; struct usbvideo {