]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
V4L/DVB (8085): ivtv: fill in all v4l2_framebuffer fields in VIDIOC_G/S_FBUF
authorHans Verkuil <hverkuil@xs4all.nl>
Sat, 21 Jun 2008 12:06:59 +0000 (09:06 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Sun, 20 Jul 2008 10:10:56 +0000 (07:10 -0300)
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/ivtv/ivtv-ioctl.c

index eb4485991a58725d586fbb56b215b02d6e62c0ac..d75c82e509f79bec7000ee9c544df31af9555d02 100644 (file)
@@ -1356,7 +1356,15 @@ static int ivtv_g_fbuf(struct file *file, void *fh, struct v4l2_framebuffer *fb)
        fb->fmt.pixelformat = pixel_format[pixfmt];
        fb->fmt.width = itv->osd_rect.width;
        fb->fmt.height = itv->osd_rect.height;
+       fb->fmt.field = V4L2_FIELD_INTERLACED;
+       fb->fmt.bytesperline = fb->fmt.width;
+       if (fb->fmt.pixelformat != V4L2_PIX_FMT_PAL8)
+               fb->fmt.bytesperline *= 2;
+       if (fb->fmt.pixelformat == V4L2_PIX_FMT_RGB32 ||
+           fb->fmt.pixelformat == V4L2_PIX_FMT_YUV32)
+               fb->fmt.bytesperline *= 2;
        fb->base = (void *)itv->osd_video_pbase;
+       fb->flags = 0;
 
        if (itv->osd_chroma_key_state)
                fb->flags |= V4L2_FBUF_FLAG_CHROMAKEY;
@@ -1404,8 +1412,7 @@ static int ivtv_s_fbuf(struct file *file, void *fh, struct v4l2_framebuffer *fb)
        itv->osd_chroma_key_state = (fb->flags & V4L2_FBUF_FLAG_CHROMAKEY) != 0;
        ivtv_set_osd_alpha(itv);
        yi->track_osd = (fb->flags & V4L2_FBUF_FLAG_OVERLAY) != 0;
-
-       return 0;
+       return ivtv_g_fbuf(file, fh, fb);
 }
 
 static int ivtv_overlay(struct file *file, void *fh, unsigned int on)