All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Tomasz Stanislawski <t.stanislaws@samsung.com>
Cc: linaro-mm-sig@lists.linaro.org, linux-media@vger.kernel.org,
	sumit.semwal@ti.com, jesse.barker@linaro.org, rob@ti.com,
	daniel@ffwll.ch, m.szyprowski@samsung.com,
	kyungmin.park@samsung.com, hverkuil@xs4all.nl,
	laurent.pinchart@ideasonboard.com, pawel@osciak.com
Subject: Re: [PATCH 04/10] v4l: vb2: fixes for DMABUF support
Date: Mon, 23 Jan 2012 12:22:54 -0200	[thread overview]
Message-ID: <4F1D6D3E.7020203@redhat.com> (raw)
In-Reply-To: <1327326675-8431-5-git-send-email-t.stanislaws@samsung.com>

Em 23-01-2012 11:51, Tomasz Stanislawski escreveu:
> Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>

Please better describe this patch. What is it supposing to fix?

> ---
>  drivers/media/video/videobuf2-core.c |   21 +++++++++------------
>  include/media/videobuf2-core.h       |    6 +++---
>  2 files changed, 12 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/media/video/videobuf2-core.c b/drivers/media/video/videobuf2-core.c
> index cb85874..59bb1bc 100644
> --- a/drivers/media/video/videobuf2-core.c
> +++ b/drivers/media/video/videobuf2-core.c
> @@ -119,7 +119,7 @@ static void __vb2_buf_dmabuf_put(struct vb2_buffer *vb)
>  		void *mem_priv = vb->planes[plane].mem_priv;
>  
>  		if (mem_priv) {
> -			call_memop(q, plane, detach_dmabuf, mem_priv);
> +			call_memop(q, detach_dmabuf, mem_priv);

Huh? You're not removing the "plane" parameter on this patch, but, instead,
on a previous patch.

No patch is allowed to break compilation, as it breaks git bisect.

>  			dma_buf_put(vb->planes[plane].dbuf);
>  			vb->planes[plane].dbuf = NULL;
>  			vb->planes[plane].mem_priv = NULL;
> @@ -907,6 +907,8 @@ static int __fill_vb2_buffer(struct vb2_buffer *vb, const struct v4l2_buffer *b,
>  		if (b->memory == V4L2_MEMORY_DMABUF) {
>  			for (plane = 0; plane < vb->num_planes; ++plane) {
>  				v4l2_planes[plane].m.fd = b->m.planes[plane].m.fd;
> +				v4l2_planes[plane].length =
> +					b->m.planes[plane].length;
>  			}
>  		}
>  	} else {
> @@ -1055,15 +1057,10 @@ static int __qbuf_dmabuf(struct vb2_buffer *vb, const struct v4l2_buffer *b)
>  		if (IS_ERR_OR_NULL(dbuf)) {
>  			dprintk(1, "qbuf: invalid dmabuf fd for "
>  				"plane %d\n", plane);
> -			ret = PTR_ERR(dbuf);
> +			ret = -EINVAL;
>  			goto err;
>  		}
>  
> -		/* this doesn't get filled in until __fill_vb2_buffer(),
> -		 * since it isn't known until after dma_buf_get()..
> -		 */
> -		planes[plane].length = dbuf->size;
> -
>  		/* Skip the plane if already verified */
>  		if (dbuf == vb->planes[plane].dbuf) {
>  			dma_buf_put(dbuf);
> @@ -1075,7 +1072,7 @@ static int __qbuf_dmabuf(struct vb2_buffer *vb, const struct v4l2_buffer *b)
>  
>  		/* Release previously acquired memory if present */
>  		if (vb->planes[plane].mem_priv) {
> -			call_memop(q, plane, detach_dmabuf,
> +			call_memop(q, detach_dmabuf,
>  				vb->planes[plane].mem_priv);
>  			dma_buf_put(vb->planes[plane].dbuf);
>  		}
> @@ -1083,8 +1080,8 @@ static int __qbuf_dmabuf(struct vb2_buffer *vb, const struct v4l2_buffer *b)
>  		vb->planes[plane].mem_priv = NULL;
>  
>  		/* Acquire each plane's memory */
> -		mem_priv = q->mem_ops->attach_dmabuf(
> -				q->alloc_ctx[plane], dbuf);
> +		mem_priv = q->mem_ops->attach_dmabuf(q->alloc_ctx[plane],
> +			dbuf, planes[plane].length, write);
>  		if (IS_ERR(mem_priv)) {
>  			dprintk(1, "qbuf: failed acquiring dmabuf "
>  				"memory for plane %d\n", plane);
> @@ -1102,7 +1099,7 @@ static int __qbuf_dmabuf(struct vb2_buffer *vb, const struct v4l2_buffer *b)
>  	 */
>  	for (plane = 0; plane < vb->num_planes; ++plane) {
>  		ret = q->mem_ops->map_dmabuf(
> -				vb->planes[plane].mem_priv, write);
> +			vb->planes[plane].mem_priv);
>  		if (ret) {
>  			dprintk(1, "qbuf: failed mapping dmabuf "
>  				"memory for plane %d\n", plane);
> @@ -1497,7 +1494,7 @@ int vb2_dqbuf(struct vb2_queue *q, struct v4l2_buffer *b, bool nonblocking)
>  	 */
>  	if (q->memory == V4L2_MEMORY_DMABUF)
>  		for (plane = 0; plane < vb->num_planes; ++plane)
> -			call_memop(q, plane, unmap_dmabuf,
> +			call_memop(q, unmap_dmabuf,
>  				vb->planes[plane].mem_priv);
>  
>  	switch (vb->state) {
> diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
> index d8b8171..412c6a4 100644
> --- a/include/media/videobuf2-core.h
> +++ b/include/media/videobuf2-core.h
> @@ -88,10 +88,10 @@ struct vb2_mem_ops {
>  	 * in the vb2 core, and vb2_mem_ops really just need to get/put the
>  	 * sglist (and make sure that the sglist fits it's needs..)
>  	 */
> -	void		*(*attach_dmabuf)(void *alloc_ctx,
> -					  struct dma_buf *dbuf);
> +	void		*(*attach_dmabuf)(void *alloc_ctx, struct dma_buf *dbuf,
> +				unsigned long size, int write);
>  	void		(*detach_dmabuf)(void *buf_priv);
> -	int		(*map_dmabuf)(void *buf_priv, int write);
> +	int		(*map_dmabuf)(void *buf_priv);
>  	void		(*unmap_dmabuf)(void *buf_priv);
>  
>  	void		*(*vaddr)(void *buf_priv);


  reply	other threads:[~2012-01-23 14:23 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-23 13:51 [PATCH 00/10] Integration of videobuf2 with dmabuf Tomasz Stanislawski
2012-01-23 13:51 ` [PATCH 01/10] arm: dma: support for dma_get_pages Tomasz Stanislawski
2012-01-23 13:51 ` [PATCH 02/10] [media] media: vb2: remove plane argument from call_memop and cleanup mempriv usage Tomasz Stanislawski
2012-01-23 13:51 ` [PATCH 03/10] media: vb2: add prepare/finish callbacks to allocators Tomasz Stanislawski
2012-02-03 15:42   ` Pawel Osciak
2012-01-23 13:51 ` [PATCH 04/10] v4l: vb2: fixes for DMABUF support Tomasz Stanislawski
2012-01-23 14:22   ` Mauro Carvalho Chehab [this message]
2012-01-23 14:32     ` Tomasz Stanislawski
2012-01-23 14:52       ` Mauro Carvalho Chehab
2012-01-23 15:25         ` Tomasz Stanislawski
2012-01-23 16:06           ` Mauro Carvalho Chehab
2012-01-23 16:37             ` Tomasz Stanislawski
2012-01-23 16:51               ` Mauro Carvalho Chehab
2012-01-25  5:35           ` Semwal, Sumit
2012-01-25 10:34             ` Tomasz Stanislawski
2012-01-25 14:09               ` Semwal, Sumit
2012-01-23 13:51 ` [PATCH 05/10] v4l: add buffer exporting via dmabuf Tomasz Stanislawski
2012-01-23 14:32   ` Mauro Carvalho Chehab
2012-01-23 14:37     ` Laurent Pinchart
2012-01-23 14:42     ` Tomasz Stanislawski
2012-01-23 15:04       ` Mauro Carvalho Chehab
2012-01-23 15:56         ` Tomasz Stanislawski
2012-01-23 16:42           ` Mauro Carvalho Chehab
2012-01-23 16:57             ` V4L2 Overlay mode replacement by dma-buf - was: " Mauro Carvalho Chehab
2012-01-24  0:11               ` Clark, Rob
2012-01-24  9:44             ` Laurent Pinchart
2012-01-24 11:07   ` [Linaro-mm-sig] " Subash Patel
2012-01-24 12:06     ` Tomasz Stanislawski
2012-01-27 13:40       ` Subash Patel
2012-01-30 14:16         ` Laurent Pinchart
2012-01-26  9:48   ` Tomasz Stanislawski
2012-02-03 15:47     ` Pawel Osciak
2012-02-03 15:50   ` Pawel Osciak
2012-01-23 13:51 ` [PATCH 06/10] v4l: vb2: " Tomasz Stanislawski
2012-01-23 13:51 ` [PATCH 07/10] v4l: vb2: remove dma-contig allocator Tomasz Stanislawski
2012-01-23 14:24   ` Mauro Carvalho Chehab
2012-01-23 13:51 ` [PATCH 08/10] v4l: vb2-dma-contig: code refactoring, support for DMABUF exporting Tomasz Stanislawski
2012-01-23 14:26   ` Mauro Carvalho Chehab
2012-01-23 14:35     ` Tomasz Stanislawski
2012-01-23 14:43       ` Mauro Carvalho Chehab
2012-01-23 14:35   ` [PATCH] media: vb2-memops: Export vb2_get_vma symbol Laurent Pinchart
2012-01-23 14:44     ` Tomasz Stanislawski
2012-03-21 11:12       ` Laurent Pinchart
2012-01-23 13:51 ` [PATCH 09/10] v4l: fimc: integrate capture i-face with dmabuf Tomasz Stanislawski
2012-01-23 13:51 ` [PATCH 10/10] v4l: s5p-tv: mixer: integrate " Tomasz Stanislawski
2012-01-23 14:37 ` [PATCH 00/10] Integration of videobuf2 " Mauro Carvalho Chehab

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=4F1D6D3E.7020203@redhat.com \
    --to=mchehab@redhat.com \
    --cc=daniel@ffwll.ch \
    --cc=hverkuil@xs4all.nl \
    --cc=jesse.barker@linaro.org \
    --cc=kyungmin.park@samsung.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=pawel@osciak.com \
    --cc=rob@ti.com \
    --cc=sumit.semwal@ti.com \
    --cc=t.stanislaws@samsung.com \
    /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.