From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Bob Liu <lliubbo@gmail.com>
Cc: linux-media@vger.kernel.org, mchehab@infradead.org,
linux-uvc-devel@lists.berlios.de,
uclinux-dist-devel@blackfin.uclinux.org
Subject: Re: [PATCH] drivers:media:video:uvc: fix uvc_v4l2_get_unmapped_area for NOMMU
Date: Mon, 14 May 2012 13:31:03 +0200 [thread overview]
Message-ID: <1463663.qyvIXF66SU@avalon> (raw)
In-Reply-To: <1336991039-15970-1-git-send-email-lliubbo@gmail.com>
Hi Bob,
On Monday 14 May 2012 18:23:59 Bob Liu wrote:
> Fix uvc_v4l2_get_unmapped_area() for NOMMU arch like blackfin after
> framework updated to use videobuf2.
Thank you for the patch, but I'm afraid you're too late. The fix is already
queued for v3.5 :-)
> Signed-off-by: Bob Liu <lliubbo@gmail.com>
> ---
> drivers/media/video/uvc/uvc_queue.c | 30 ------------------------------
> drivers/media/video/uvc/uvc_v4l2.c | 2 +-
> 2 files changed, 1 insertions(+), 31 deletions(-)
>
> diff --git a/drivers/media/video/uvc/uvc_queue.c
> b/drivers/media/video/uvc/uvc_queue.c index 518f77d..30be060 100644
> --- a/drivers/media/video/uvc/uvc_queue.c
> +++ b/drivers/media/video/uvc/uvc_queue.c
> @@ -237,36 +237,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.
> *
> diff --git a/drivers/media/video/uvc/uvc_v4l2.c
> b/drivers/media/video/uvc/uvc_v4l2.c index 2ae4f88..506d3d6 100644
> --- a/drivers/media/video/uvc/uvc_v4l2.c
> +++ b/drivers/media/video/uvc/uvc_v4l2.c
> @@ -1067,7 +1067,7 @@ static unsigned long uvc_v4l2_get_unmapped_area(struct
> file *file,
>
> uvc_trace(UVC_TRACE_CALLS, "uvc_v4l2_get_unmapped_area\n");
>
> - return uvc_queue_get_unmapped_area(&stream->queue, pgoff);
> + return vb2_get_unmapped_area(&stream->queue, addr, len, pgoff, flags);
Just for the record you would have needed to take the queue->mutex around the
vb2_get_unmapped_area() call here.
> }
> #endif
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2012-05-14 11:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-14 10:23 [PATCH] drivers:media:video:uvc: fix uvc_v4l2_get_unmapped_area for NOMMU Bob Liu
2012-05-14 11:31 ` Laurent Pinchart [this message]
2012-05-15 1:01 ` Bob Liu
2012-05-15 6:15 ` Bob Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1463663.qyvIXF66SU@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=linux-uvc-devel@lists.berlios.de \
--cc=lliubbo@gmail.com \
--cc=mchehab@infradead.org \
--cc=uclinux-dist-devel@blackfin.uclinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.