Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 306246
b: refs/heads/master
c: 4742c82
h: refs/heads/master
v: v3
  • Loading branch information
Laurent Pinchart authored and Mauro Carvalho Chehab committed May 8, 2012
1 parent f3e2e61 commit ff0a4d2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 31 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: 616bd4e2573cb114aadd90182ebe7f34066b15da
refs/heads/master: 4742c82ed90d0f8c82639750dcfe481e61d883a4
43 changes: 13 additions & 30 deletions trunk/drivers/media/video/uvc/uvc_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,19 @@ int uvc_queue_mmap(struct uvc_video_queue *queue, struct vm_area_struct *vma)
return ret;
}

#ifndef CONFIG_MMU
unsigned long uvc_queue_get_unmapped_area(struct uvc_video_queue *queue,
unsigned long pgoff)
{
unsigned long ret;

mutex_lock(&queue->mutex);
ret = vb2_get_unmapped_area(&queue->queue, 0, 0, pgoff, 0);
mutex_unlock(&queue->mutex);
return ret;
}
#endif

unsigned int uvc_queue_poll(struct uvc_video_queue *queue, struct file *file,
poll_table *wait)
{
Expand Down Expand Up @@ -237,36 +250,6 @@ int uvc_queue_allocated(struct uvc_video_queue *queue)
return allocated;
}

#ifndef CONFIG_MMU
/*
* Get unmapped area.
*
* NO-MMU arch need this function to make mmap() work correctly.
*/
unsigned long uvc_queue_get_unmapped_area(struct uvc_video_queue *queue,
unsigned long pgoff)
{
struct uvc_buffer *buffer;
unsigned int i;
unsigned long ret;

mutex_lock(&queue->mutex);
for (i = 0; i < queue->count; ++i) {
buffer = &queue->buffer[i];
if ((buffer->buf.m.offset >> PAGE_SHIFT) == pgoff)
break;
}
if (i == queue->count) {
ret = -EINVAL;
goto done;
}
ret = (unsigned long)buf->mem;
done:
mutex_unlock(&queue->mutex);
return ret;
}
#endif

/*
* Enable or disable the video buffers queue.
*
Expand Down

0 comments on commit ff0a4d2

Please sign in to comment.