Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 92591
b: refs/heads/master
c: ce54093
h: refs/heads/master
i:
  92589: 98b28d4
  92587: 4a009aa
  92583: 1b4cd23
  92575: e4dafbb
v: v3
  • Loading branch information
Brandon Philips authored and Mauro Carvalho Chehab committed Apr 24, 2008
1 parent e310da1 commit daaffd5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 137d1cb19d9da163ce6cb57a6fa1e6a3468af6a4
refs/heads/master: ce54093cefd64c1a2cb6b8c5ed1d68d2bd7a34ab
16 changes: 15 additions & 1 deletion trunk/drivers/media/video/videobuf-dma-sg.c
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,14 @@ static int __videobuf_mmap_mapper(struct videobuf_queue *q,
goto done;
}

/* This function maintains backwards compatibility with V4L1 and will
* map more than one buffer if the vma length is equal to the combined
* size of multiple buffers than it will map them together. See
* VIDIOCGMBUF in the v4l spec
*
* TODO: Allow drivers to specify if they support this mode
*/

/* look for first buffer to map */
for (first = 0; first < VIDEO_MAX_FRAME; first++) {
if (NULL == q->bufs[first])
Expand Down Expand Up @@ -590,10 +598,16 @@ static int __videobuf_mmap_mapper(struct videobuf_queue *q,
map = kmalloc(sizeof(struct videobuf_mapping),GFP_KERNEL);
if (NULL == map)
goto done;
for (size = 0, i = first; i <= last; size += q->bufs[i++]->bsize) {

size = 0;
for (i = first; i <= last; i++) {
if (NULL == q->bufs[i])
continue;
q->bufs[i]->map = map;
q->bufs[i]->baddr = vma->vm_start + size;
size += q->bufs[i]->bsize;
}

map->count = 1;
map->start = vma->vm_start;
map->end = vma->vm_end;
Expand Down

0 comments on commit daaffd5

Please sign in to comment.