]> err.no Git - linux-2.6/blobdiff - drivers/media/common/saa7146_video.c
Merge branch 'linus' into core/generic-dma-coherent
[linux-2.6] / drivers / media / common / saa7146_video.c
index 66fdbd0e6a6ddfe5ad7f5a6a72045e574db95d56..e8bc7abf24097d93b6b0b2135c72a2c3c9b198fd 100644 (file)
@@ -605,8 +605,8 @@ static int saa7146_pgtable_build(struct saa7146_dev *dev, struct saa7146_buf *bu
                struct saa7146_pgtable *pt1 = &buf->pt[0];
                struct saa7146_pgtable *pt2 = &buf->pt[1];
                struct saa7146_pgtable *pt3 = &buf->pt[2];
-               u32  *ptr1, *ptr2, *ptr3;
-               u32 fill;
+               __le32  *ptr1, *ptr2, *ptr3;
+               __le32 fill;
 
                int size = buf->fmt->width*buf->fmt->height;
                int i,p,m1,m2,m3,o1,o2;
@@ -656,7 +656,7 @@ static int saa7146_pgtable_build(struct saa7146_dev *dev, struct saa7146_buf *bu
 
                /* if we have a user buffer, the first page may not be
                   aligned to a page boundary. */
-               pt1->offset = list->offset;
+               pt1->offset = dma->sglist->offset;
                pt2->offset = pt1->offset+o1;
                pt3->offset = pt1->offset+o2;
 
@@ -958,21 +958,18 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
        case VIDIOC_ENUM_FMT:
        {
                struct v4l2_fmtdesc *f = arg;
-               int index;
 
                switch (f->type) {
                case V4L2_BUF_TYPE_VIDEO_CAPTURE:
-               case V4L2_BUF_TYPE_VIDEO_OVERLAY: {
-                       index = f->index;
-                       if (index < 0 || index >= NUM_FORMATS) {
+               case V4L2_BUF_TYPE_VIDEO_OVERLAY:
+                       if (f->index >= NUM_FORMATS)
                                return -EINVAL;
-                       }
-                       memset(f,0,sizeof(*f));
-                       f->index = index;
-                       strlcpy((char *)f->description,formats[index].name,sizeof(f->description));
-                       f->pixelformat = formats[index].pixelformat;
+                       strlcpy((char *)f->description, formats[f->index].name,
+                                       sizeof(f->description));
+                       f->pixelformat = formats[f->index].pixelformat;
+                       f->flags = 0;
+                       memset(f->reserved, 0, sizeof(f->reserved));
                        break;
-               }
                default:
                        return -EINVAL;
                }
@@ -1410,8 +1407,8 @@ static int video_open(struct saa7146_dev *dev, struct file *file)
        sfmt = format_by_fourcc(dev,fh->video_fmt.pixelformat);
        fh->video_fmt.sizeimage = (fh->video_fmt.width * fh->video_fmt.height * sfmt->depth)/8;
 
-       videobuf_queue_pci_init(&fh->video_q, &video_qops,
-                           dev->pci, &dev->slock,
+       videobuf_queue_sg_init(&fh->video_q, &video_qops,
+                           &dev->pci->dev, &dev->slock,
                            V4L2_BUF_TYPE_VIDEO_CAPTURE,
                            V4L2_FIELD_INTERLACED,
                            sizeof(struct saa7146_buf),