All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: linux-media@vger.kernel.org,
	Hans Verkuil <hans.verkuil@cisco.com>,
	"Lad, Prabhakar" <prabhakar.csengg@gmail.com>
Subject: Re: [PATCHv3 05/12] staging/media: convert drivers to use the new vb2_queue dev field
Date: Sat, 23 Apr 2016 03:17:11 +0300	[thread overview]
Message-ID: <4483803.AG7J000loR@avalon> (raw)
In-Reply-To: <1461314299-36126-6-git-send-email-hverkuil@xs4all.nl>

Hi Hans,

Thank you for the patch.

On Friday 22 Apr 2016 10:38:12 Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
> 
> Stop using alloc_ctx and just fill in the device pointer.
> 
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> Cc: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Pending a fix for the problem I mentioned in a reply to patch 01/12,

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/staging/media/davinci_vpfe/vpfe_video.c | 10 +---------
>  drivers/staging/media/davinci_vpfe/vpfe_video.h |  2 --
>  drivers/staging/media/omap4iss/iss_video.c      | 10 +---------
>  drivers/staging/media/omap4iss/iss_video.h      |  1 -
>  4 files changed, 2 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/staging/media/davinci_vpfe/vpfe_video.c
> b/drivers/staging/media/davinci_vpfe/vpfe_video.c index ea3ddec..77e66e7
> 100644
> --- a/drivers/staging/media/davinci_vpfe/vpfe_video.c
> +++ b/drivers/staging/media/davinci_vpfe/vpfe_video.c
> @@ -542,7 +542,6 @@ static int vpfe_release(struct file *file)
>  		video->io_usrs = 0;
>  		/* Free buffers allocated */
>  		vb2_queue_release(&video->buffer_queue);
> -		vb2_dma_contig_cleanup_ctx(video->alloc_ctx);
>  	}
>  	/* Decrement device users counter */
>  	video->usrs--;
> @@ -1115,7 +1114,6 @@ vpfe_buffer_queue_setup(struct vb2_queue *vq,
> 
>  	*nplanes = 1;
>  	sizes[0] = size;
> -	alloc_ctxs[0] = video->alloc_ctx;
>  	v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev,
>  		 "nbuffers=%d, size=%lu\n", *nbuffers, size);
>  	return 0;
> @@ -1350,12 +1348,6 @@ static int vpfe_reqbufs(struct file *file, void
> *priv, video->memory = req_buf->memory;
> 
>  	/* Initialize videobuf2 queue as per the buffer type */
> -	video->alloc_ctx = vb2_dma_contig_init_ctx(vpfe_dev->pdev);
> -	if (IS_ERR(video->alloc_ctx)) {
> -		v4l2_err(&vpfe_dev->v4l2_dev, "Failed to get the context\n");
> -		return PTR_ERR(video->alloc_ctx);
> -	}
> -
>  	q = &video->buffer_queue;
>  	q->type = req_buf->type;
>  	q->io_modes = VB2_MMAP | VB2_USERPTR;
> @@ -1365,11 +1357,11 @@ static int vpfe_reqbufs(struct file *file, void
> *priv, q->mem_ops = &vb2_dma_contig_memops;
>  	q->buf_struct_size = sizeof(struct vpfe_cap_buffer);
>  	q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
> +	q->dev = vpfe_dev->pdev;
> 
>  	ret = vb2_queue_init(q);
>  	if (ret) {
>  		v4l2_err(&vpfe_dev->v4l2_dev, "vb2_queue_init() failed\n");
> -		vb2_dma_contig_cleanup_ctx(vpfe_dev->pdev);
>  		return ret;
>  	}
> 
> diff --git a/drivers/staging/media/davinci_vpfe/vpfe_video.h
> b/drivers/staging/media/davinci_vpfe/vpfe_video.h index 653334d..aaec440
> 100644
> --- a/drivers/staging/media/davinci_vpfe/vpfe_video.h
> +++ b/drivers/staging/media/davinci_vpfe/vpfe_video.h
> @@ -123,8 +123,6 @@ struct vpfe_video_device {
>  	/* Used to store pixel format */
>  	struct v4l2_format			fmt;
>  	struct vb2_queue			buffer_queue;
> -	/* allocator-specific contexts for each plane */
> -	struct vb2_alloc_ctx *alloc_ctx;
>  	/* Queue of filled frames */
>  	struct list_head			dma_queue;
>  	spinlock_t				irqlock;
> diff --git a/drivers/staging/media/omap4iss/iss_video.c
> b/drivers/staging/media/omap4iss/iss_video.c index cf8da23..3c077e3 100644
> --- a/drivers/staging/media/omap4iss/iss_video.c
> +++ b/drivers/staging/media/omap4iss/iss_video.c
> @@ -310,8 +310,6 @@ static int iss_video_queue_setup(struct vb2_queue *vq,
>  	if (sizes[0] == 0)
>  		return -EINVAL;
> 
> -	alloc_ctxs[0] = video->alloc_ctx;
> -
>  	*count = min(*count, video->capture_mem / PAGE_ALIGN(sizes[0]));
> 
>  	return 0;
> @@ -1017,13 +1015,6 @@ static int iss_video_open(struct file *file)
>  		goto done;
>  	}
> 
> -	video->alloc_ctx = vb2_dma_contig_init_ctx(video->iss->dev);
> -	if (IS_ERR(video->alloc_ctx)) {
> -		ret = PTR_ERR(video->alloc_ctx);
> -		omap4iss_put(video->iss);
> -		goto done;
> -	}
> -
>  	q = &handle->queue;
> 
>  	q->type = video->type;
> @@ -1033,6 +1024,7 @@ static int iss_video_open(struct file *file)
>  	q->mem_ops = &vb2_dma_contig_memops;
>  	q->buf_struct_size = sizeof(struct iss_buffer);
>  	q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
> +	q->dev = video->iss->dev;
> 
>  	ret = vb2_queue_init(q);
>  	if (ret) {
> diff --git a/drivers/staging/media/omap4iss/iss_video.h
> b/drivers/staging/media/omap4iss/iss_video.h index c8bd295..d7e05d0 100644
> --- a/drivers/staging/media/omap4iss/iss_video.h
> +++ b/drivers/staging/media/omap4iss/iss_video.h
> @@ -170,7 +170,6 @@ struct iss_video {
>  	spinlock_t qlock;		/* protects dmaqueue and error */
>  	struct list_head dmaqueue;
>  	enum iss_video_dmaqueue_flags dmaqueue_flags;
> -	struct vb2_alloc_ctx *alloc_ctx;
> 
>  	const struct iss_video_operations *ops;
>  };

-- 
Regards,

Laurent Pinchart


  reply	other threads:[~2016-04-23  0:16 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-22  8:38 [PATCHv3 00/12] vb2: replace allocation context by device pointer Hans Verkuil
2016-04-22  8:38 ` [PATCHv3 01/12] vb2: add a dev field to use for the default allocation context Hans Verkuil
2016-04-22  8:54   ` Philipp Zabel
2016-04-23  0:14   ` Laurent Pinchart
2016-04-23 10:37     ` Hans Verkuil
2016-04-24 21:51       ` Laurent Pinchart
2016-04-25  7:25         ` Hans Verkuil
2016-04-25 14:03           ` Laurent Pinchart
2016-04-22  8:38 ` [PATCHv3 02/12] v4l2-pci-skeleton: set q->dev instead of allocating a context Hans Verkuil
2016-04-22  8:38 ` [PATCHv3 03/12] sur40: " Hans Verkuil
2016-04-22  8:38 ` [PATCHv3 04/12] media/pci: convert drivers to use the new vb2_queue dev field Hans Verkuil
2016-04-22  8:38 ` [PATCHv3 05/12] staging/media: " Hans Verkuil
2016-04-23  0:17   ` Laurent Pinchart [this message]
2016-04-24 20:59   ` Lad, Prabhakar
2016-04-22  8:38 ` [PATCHv3 06/12] media/platform: " Hans Verkuil
2016-04-22  8:54   ` Philipp Zabel
2016-04-22  8:38 ` [PATCHv3 07/12] " Hans Verkuil
2016-04-23  0:20   ` Laurent Pinchart
2016-04-22  8:38 ` [PATCHv3 08/12] " Hans Verkuil
2016-04-23  0:23   ` Laurent Pinchart
2016-04-22  8:38 ` [PATCHv3 09/12] media/.../soc-camera: " Hans Verkuil
2016-04-22  8:38 ` [PATCHv3 10/12] media/platform: " Hans Verkuil
2016-04-22  8:38 ` [PATCHv3 11/12] " Hans Verkuil
2016-04-22  8:38 ` [PATCHv3 12/12] vb2: replace void *alloc_ctxs by struct device *alloc_devs Hans Verkuil

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=4483803.AG7J000loR@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=hans.verkuil@cisco.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=prabhakar.csengg@gmail.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.