From 2ff1c18dde76bfe8c93474f056ff1a6a72640bcb Mon Sep 17 00:00:00 2001 From: Trent Piepho Date: Mon, 22 Oct 2007 13:44:54 -0700 Subject: bttv: SPICT ioctl doesn't work with vlc From: Trent Piepho The bttv driver instists that the depth specified in the call to VIDIOCSPICT match the pixel format specified in the same call. vlc doesn't set the depth field, which makes the SPICT ioctl always fail. The V4L1 standard is not clear on how most operation are supposed to work, and this is no exception. The depth field would appear to be entirely redundant, as the pixel format specifies a specific depth. It could be that this field was only meant for output from the *G*PICT ioctl and should be ignored in *S*PICT. This is in fact what the v4l1-compat wrapper does. Signed-off-by: Trent Piepho --- linux/drivers/media/video/bt8xx/bttv-driver.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'linux/drivers') diff --git a/linux/drivers/media/video/bt8xx/bttv-driver.c b/linux/drivers/media/video/bt8xx/bttv-driver.c index d573ae72c..6cb89f776 100644 --- a/linux/drivers/media/video/bt8xx/bttv-driver.c +++ b/linux/drivers/media/video/bt8xx/bttv-driver.c @@ -2922,10 +2922,6 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, if (NULL == fmt) return -EINVAL; mutex_lock(&fh->cap.lock); - if (fmt->depth != pic->depth) { - retval = -EINVAL; - goto fh_unlock_and_return; - } if (fmt->flags & FORMAT_FLAGS_RAW) { /* VIDIOCMCAPTURE uses gbufsize, not RAW_BPL * RAW_LINES * 2. F1 is stored at offset 0, F2 -- cgit v1.2.3 From a9a028ac2653b3000c2440eeea4bf5dedc54cf48 Mon Sep 17 00:00:00 2001 From: Trent Piepho Date: Mon, 22 Oct 2007 13:44:55 -0700 Subject: bttv: Update initial image size when set via V4L1 VIDIOCMCAPTURE From: Trent Piepho The V4L1 spec says that the image size should be with with VIDIOCSWIN before requesting buffers with VIDIOCGMBUF and capturing into them with VIDIOCMCAPTURE. But it seems that many apps don't do this. They set the size using the fields in the VIDIOCMCAPTURE ioctl. The driver doesn't know what size to capture until it actually starts to capture. In particular, it doesn't know what size to capture until it has already mmap the captured buffers. Which is quite stupid. Why V4L1 has size and format fields for VIDIOCMCAPTURE I have no idea. Many drivers don't support this, including those using v4l1-compat. The bttv does, which is probably the only reason such broken software is so prevalent. But, the driver doesn't adjust its idea of what size is being captured when it is set this way. If you try to query the driver's current setting with v4l2-ctl, it won't be correct. Signed-off-by: Trent Piepho --- linux/drivers/media/video/bt8xx/bttv-driver.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'linux/drivers') diff --git a/linux/drivers/media/video/bt8xx/bttv-driver.c b/linux/drivers/media/video/bt8xx/bttv-driver.c index 6cb89f776..37db47ecc 100644 --- a/linux/drivers/media/video/bt8xx/bttv-driver.c +++ b/linux/drivers/media/video/bt8xx/bttv-driver.c @@ -3154,6 +3154,8 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, vm->width,vm->height,field); if (0 != retval) goto fh_unlock_and_return; + btv->init.width = vm->width; + btv->init.height = vm->height; spin_lock_irqsave(&btv->s_lock,flags); buffer_queue(&fh->cap,&buf->vb); spin_unlock_irqrestore(&btv->s_lock,flags); -- cgit v1.2.3 From b280bfddc08e110a33667a175bb280d77701873b Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 23 Oct 2007 14:30:27 -0600 Subject: Fix a cafe_ccic resume bug From: Jonathan Corbet If the system is suspended while the camera is streaming, it will not continue streaming on resume. Save the state properly so that resume works. Signed-off-by: Jonathan Corbet Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/cafe_ccic.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'linux/drivers') diff --git a/linux/drivers/media/video/cafe_ccic.c b/linux/drivers/media/video/cafe_ccic.c index aed6ab229..c9bcfedf0 100644 --- a/linux/drivers/media/video/cafe_ccic.c +++ b/linux/drivers/media/video/cafe_ccic.c @@ -2239,13 +2239,16 @@ static int cafe_pci_suspend(struct pci_dev *pdev, pm_message_t state) { struct cafe_camera *cam = cafe_find_by_pdev(pdev); int ret; + enum cafe_state cstate; ret = pci_save_state(pdev); if (ret) return ret; + cstate = cam->state; /* HACK - stop_dma sets to idle */ cafe_ctlr_stop_dma(cam); cafe_ctlr_power_down(cam); pci_disable_device(pdev); + cam->state = cstate; return 0; } -- cgit v1.2.3 From 8d0865f57c653ef13eb27ce8ca78901ba6058d57 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 23 Oct 2007 14:31:36 -0600 Subject: cafe_ccic: Add a pointer to the data sheet From: Jonathan Corbet Add a pointer to the (recently posted) Cafe data sheet. Signed-off-by: Jonathan Corbet Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/cafe_ccic.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'linux/drivers') diff --git a/linux/drivers/media/video/cafe_ccic.c b/linux/drivers/media/video/cafe_ccic.c index c9bcfedf0..9c9a33be6 100644 --- a/linux/drivers/media/video/cafe_ccic.c +++ b/linux/drivers/media/video/cafe_ccic.c @@ -3,6 +3,9 @@ * multifunction chip. Currently works with the Omnivision OV7670 * sensor. * + * The data sheet for this device can be found at: + * http://www.marvell.com/products/pcconn/88ALP01.jsp + * * Copyright 2006 One Laptop Per Child Association, Inc. * Copyright 2006-7 Jonathan Corbet * -- cgit v1.2.3 From c8f0e62f66c8fae8399d077e41c8cbab137b3d4f Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 24 Oct 2007 18:23:14 +0200 Subject: saa7134/: make 2 functions static From: Adrian Bunk saa7134_buffer_requeue() and set_tvnorm() can become static. Signed-off-by: Adrian Bunk Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/saa7134/saa7134-core.c | 4 ++-- linux/drivers/media/video/saa7134/saa7134-video.c | 2 +- linux/drivers/media/video/saa7134/saa7134.h | 4 ---- 3 files changed, 3 insertions(+), 7 deletions(-) (limited to 'linux/drivers') diff --git a/linux/drivers/media/video/saa7134/saa7134-core.c b/linux/drivers/media/video/saa7134/saa7134-core.c index 6559c80cc..d39005392 100644 --- a/linux/drivers/media/video/saa7134/saa7134-core.c +++ b/linux/drivers/media/video/saa7134/saa7134-core.c @@ -477,8 +477,8 @@ void saa7134_buffer_timeout(unsigned long data) /* resends a current buffer in queue after resume */ -int saa7134_buffer_requeue(struct saa7134_dev *dev, - struct saa7134_dmaqueue *q) +static int saa7134_buffer_requeue(struct saa7134_dev *dev, + struct saa7134_dmaqueue *q) { struct saa7134_buf *buf, *next; diff --git a/linux/drivers/media/video/saa7134/saa7134-video.c b/linux/drivers/media/video/saa7134/saa7134-video.c index 646e10e43..82fd1c7ac 100644 --- a/linux/drivers/media/video/saa7134/saa7134-video.c +++ b/linux/drivers/media/video/saa7134/saa7134-video.c @@ -540,7 +540,7 @@ void res_free(struct saa7134_dev *dev, struct saa7134_fh *fh, unsigned int bits) /* ------------------------------------------------------------------ */ -void set_tvnorm(struct saa7134_dev *dev, struct saa7134_tvnorm *norm) +static void set_tvnorm(struct saa7134_dev *dev, struct saa7134_tvnorm *norm) { dprintk("set tv norm = %s\n",norm->name); diff --git a/linux/drivers/media/video/saa7134/saa7134.h b/linux/drivers/media/video/saa7134/saa7134.h index 3669a6c5a..23b4f2499 100644 --- a/linux/drivers/media/video/saa7134/saa7134.h +++ b/linux/drivers/media/video/saa7134/saa7134.h @@ -617,9 +617,6 @@ void saa7134_buffer_next(struct saa7134_dev *dev, struct saa7134_dmaqueue *q); void saa7134_buffer_timeout(unsigned long data); void saa7134_dma_free(struct videobuf_queue *q,struct saa7134_buf *buf); -int saa7134_buffer_requeue(struct saa7134_dev *dev, - struct saa7134_dmaqueue *q); - int saa7134_set_dmabits(struct saa7134_dev *dev); extern int (*saa7134_dmasound_init)(struct saa7134_dev *dev); @@ -652,7 +649,6 @@ void saa7134_i2c_call_clients(struct saa7134_dev *dev, extern struct video_device saa7134_video_template; extern struct video_device saa7134_radio_template; -void set_tvnorm(struct saa7134_dev *dev, struct saa7134_tvnorm *norm); int saa7134_videoport_init(struct saa7134_dev *dev); void saa7134_set_tvnorm_hw(struct saa7134_dev *dev); -- cgit v1.2.3