public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>,
	Bob Liu <lliubbo@gmail.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Media Mailing List <linux-media@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [GIT PULL for 3.3-rc1] media updates
Date: Mon, 30 Apr 2012 13:23:17 +0200	[thread overview]
Message-ID: <24289717.tQzdZ5Ax07@avalon> (raw)
In-Reply-To: <CAMuHMdV+ub7t_O5mu1vWrZFZOhZ7NYZfnoBWPyfK2bYQUT4yPw@mail.gmail.com>

Hi Geert,

On Wednesday 25 April 2012 17:12:49 Geert Uytterhoeven wrote:
> On Sun, Jan 15, 2012 at 14:41, Mauro Carvalho Chehab wrote:
> > Laurent Pinchart (18):
> >      [media] uvcvideo: Move fields from uvc_buffer::buf to uvc_buffer
> >      [media] uvcvideo: Use videobuf2-vmalloc
> 
> It seems these change (3d95e932573c316ad56b8e2f283e26de0b9c891c
> resp. 6998b6fb4b1c8f320adeee938d399c4d8dcc90e2) broke the
> build for nommu a while ago, as uvc_queue_get_unmapped_area() was not
> or was incorrectly updated:
> 
> drivers/media/video/uvc/uvc_queue.c:254:23: error: 'struct
> uvc_video_queue' has no member named 'count'
> drivers/media/video/uvc/uvc_queue.c:255:18: error: 'struct
> uvc_video_queue' has no member named 'buffer'
> drivers/media/video/uvc/uvc_queue.c:256:19: error: 'struct vb2_buffer'
> has no member named 'm'
> drivers/media/video/uvc/uvc_queue.c:259:16: error: 'struct
> uvc_video_queue' has no member named 'count'
> drivers/media/video/uvc/uvc_queue.c:263:23: error: 'buf' undeclared
> (first use in this function)
> 
> Cfr. http://kisskb.ellerman.id.au/kisskb/buildresult/6171077/

My bad, and thanks for the report. The following patch should fix this. Do you
have a NOMMU system to test it on ?

>From bbd5c24f340abeeecddd3e84c0da76408fc3f964 Mon Sep 17 00:00:00 2001
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Date: Mon, 30 Apr 2012 13:19:10 +0200
Subject: [PATCH] uvcvideo: Use videobuf2 .get_unmapped_area() implementation

The get_unmapped_area() operation was forgotten during conversion to
videobuf2. Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/media/video/uvc/uvc_queue.c |   43 ++++++++++------------------------
 1 files changed, 13 insertions(+), 30 deletions(-)

diff --git a/drivers/media/video/uvc/uvc_queue.c b/drivers/media/video/uvc/uvc_queue.c
index 8f54e24..9288fbd 100644
--- a/drivers/media/video/uvc/uvc_queue.c
+++ b/drivers/media/video/uvc/uvc_queue.c
@@ -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)
 {
@@ -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.
  *
-- 
Regards,

Laurent Pinchart


  reply	other threads:[~2012-04-30 11:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-15 13:41 [GIT PULL for 3.3-rc1] media updates Mauro Carvalho Chehab
2012-04-25 15:12 ` Geert Uytterhoeven
2012-04-30 11:23   ` Laurent Pinchart [this message]
2012-05-22 19:59     ` Geert Uytterhoeven

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=24289717.tQzdZ5Ax07@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=akpm@linux-foundation.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=lliubbo@gmail.com \
    --cc=mchehab@redhat.com \
    --cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox