aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ivtv/ivtv-ioctl.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-06-22 10:57:31 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-20 06:11:51 -0400
commit37f89f9542c3945bddf46efc15a1b1e349af3f88 (patch)
tree5020c56d1b73c13e8e1a7425f55c703745cf12ca /drivers/media/video/ivtv/ivtv-ioctl.c
parent21575c13125f2ef790e192e2c70e446c6cfe0d7d (diff)
V4L/DVB (8104): cx18/ivtv: ioctl debugging improvements
Completely rely on the video_ioctl2 debugging facilities rather than doing it ourselves. Fill in some missing fields in ivtv with VIDIOC_G_FBUF. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-ioctl.c')
-rw-r--r--drivers/media/video/ivtv/ivtv-ioctl.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c
index aa222056dd47..8d602cb6ba68 100644
--- a/drivers/media/video/ivtv/ivtv-ioctl.c
+++ b/drivers/media/video/ivtv/ivtv-ioctl.c
@@ -1336,6 +1336,8 @@ static int ivtv_g_fbuf(struct file *file, void *fh, struct v4l2_framebuffer *fb)
1336 1336
1337 if (!(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT_OVERLAY)) 1337 if (!(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT_OVERLAY))
1338 return -EINVAL; 1338 return -EINVAL;
1339 if (!itv->osd_video_pbase)
1340 return -EINVAL;
1339 1341
1340 fb->capability = V4L2_FBUF_CAP_EXTERNOVERLAY | V4L2_FBUF_CAP_CHROMAKEY | 1342 fb->capability = V4L2_FBUF_CAP_EXTERNOVERLAY | V4L2_FBUF_CAP_CHROMAKEY |
1341 V4L2_FBUF_CAP_GLOBAL_ALPHA; 1343 V4L2_FBUF_CAP_GLOBAL_ALPHA;
@@ -1349,11 +1351,15 @@ static int ivtv_g_fbuf(struct file *file, void *fh, struct v4l2_framebuffer *fb)
1349 fb->fmt.height = itv->osd_rect.height; 1351 fb->fmt.height = itv->osd_rect.height;
1350 fb->fmt.field = V4L2_FIELD_INTERLACED; 1352 fb->fmt.field = V4L2_FIELD_INTERLACED;
1351 fb->fmt.bytesperline = fb->fmt.width; 1353 fb->fmt.bytesperline = fb->fmt.width;
1354 fb->fmt.colorspace = V4L2_COLORSPACE_SMPTE170M;
1355 fb->fmt.field = V4L2_FIELD_INTERLACED;
1356 fb->fmt.priv = 0;
1352 if (fb->fmt.pixelformat != V4L2_PIX_FMT_PAL8) 1357 if (fb->fmt.pixelformat != V4L2_PIX_FMT_PAL8)
1353 fb->fmt.bytesperline *= 2; 1358 fb->fmt.bytesperline *= 2;
1354 if (fb->fmt.pixelformat == V4L2_PIX_FMT_RGB32 || 1359 if (fb->fmt.pixelformat == V4L2_PIX_FMT_RGB32 ||
1355 fb->fmt.pixelformat == V4L2_PIX_FMT_YUV32) 1360 fb->fmt.pixelformat == V4L2_PIX_FMT_YUV32)
1356 fb->fmt.bytesperline *= 2; 1361 fb->fmt.bytesperline *= 2;
1362 fb->fmt.sizeimage = fb->fmt.bytesperline * fb->fmt.height;
1357 fb->base = (void *)itv->osd_video_pbase; 1363 fb->base = (void *)itv->osd_video_pbase;
1358 fb->flags = 0; 1364 fb->flags = 0;
1359 1365
@@ -1396,6 +1402,8 @@ static int ivtv_s_fbuf(struct file *file, void *fh, struct v4l2_framebuffer *fb)
1396 1402
1397 if (!(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT_OVERLAY)) 1403 if (!(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT_OVERLAY))
1398 return -EINVAL; 1404 return -EINVAL;
1405 if (!itv->osd_video_pbase)
1406 return -EINVAL;
1399 1407
1400 itv->osd_global_alpha_state = (fb->flags & V4L2_FBUF_FLAG_GLOBAL_ALPHA) != 0; 1408 itv->osd_global_alpha_state = (fb->flags & V4L2_FBUF_FLAG_GLOBAL_ALPHA) != 0;
1401 itv->osd_local_alpha_state = 1409 itv->osd_local_alpha_state =
@@ -1744,6 +1752,7 @@ static int ivtv_default(struct file *file, void *fh, int cmd, void *arg)
1744static int ivtv_serialized_ioctl(struct ivtv *itv, struct inode *inode, struct file *filp, 1752static int ivtv_serialized_ioctl(struct ivtv *itv, struct inode *inode, struct file *filp,
1745 unsigned int cmd, unsigned long arg) 1753 unsigned int cmd, unsigned long arg)
1746{ 1754{
1755 struct video_device *vfd = video_devdata(filp);
1747 struct ivtv_open_id *id = (struct ivtv_open_id *)filp->private_data; 1756 struct ivtv_open_id *id = (struct ivtv_open_id *)filp->private_data;
1748 int ret; 1757 int ret;
1749 1758
@@ -1812,13 +1821,11 @@ static int ivtv_serialized_ioctl(struct ivtv *itv, struct inode *inode, struct f
1812 return ret; 1821 return ret;
1813 } 1822 }
1814 1823
1815 if (ivtv_debug & IVTV_DBGFLG_IOCTL) { 1824 if (ivtv_debug & IVTV_DBGFLG_IOCTL)
1816 printk(KERN_INFO "ivtv%d ioctl: ", itv->num); 1825 vfd->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG;
1817 v4l_printk_ioctl(cmd); 1826 ret = video_ioctl2(inode, filp, cmd, arg);
1818 printk("\n"); 1827 vfd->debug = 0;
1819 } 1828 return ret;
1820
1821 return video_ioctl2(inode, filp, cmd, arg);
1822} 1829}
1823 1830
1824int ivtv_v4l2_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, 1831int ivtv_v4l2_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,