[linux-dvb] [PATCH 2/2] V4L: convert saa7146 VIDIOCGMBUF to videobuf_cgmbuf

Brandon Philips brandon at ifup.org
Thu Nov 29 20:57:50 CET 2007


Converting saa7146 to videobuf_cgmbuf was suggested by Mauro last week
and should work, but I am unable to test it on real hardware.  

e9hack could you test this?

Signed-off-by: Brandon Philips <bphilips at suse.de>
---

diff --git a/linux/drivers/media/common/saa7146_video.c b/linux/drivers/media/common/saa7146_video.c
--- a/linux/drivers/media/common/saa7146_video.c
+++ b/linux/drivers/media/common/saa7146_video.c
@@ -1196,28 +1196,11 @@ int saa7146_video_do_ioctl(struct inode 
 	case VIDIOCGMBUF:
 	{
 		struct video_mbuf *mbuf = arg;
-		struct videobuf_queue *q;
-		int i;
-
-		/* fixme: number of capture buffers and sizes for v4l apps */
 		int gbuffers = 2;
-		int gbufsize = 768*576*4;
 
 		DEB_D(("VIDIOCGMBUF \n"));
 
-		q = &fh->video_q;
-		err = videobuf_mmap_setup(q,gbuffers,gbufsize,
-					  V4L2_MEMORY_MMAP);
-		if (err < 0) 
-			return err;
-
-		gbuffers = err;
-		memset(mbuf,0,sizeof(*mbuf));
-		mbuf->frames = gbuffers;
-		mbuf->size   = gbuffers * gbufsize;
-		for (i = 0; i < gbuffers; i++)
-			mbuf->offsets[i] = i * gbufsize;
-		return 0;
+		return videobuf_cgmbuf(&fh->video_q, mbuf, gbuffers);
 	}
 #endif
 	default:



More information about the linux-dvb mailing list