Re: [PATCH v4 04/13] media: platform: pxa_camera: convert to vb2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Robert Jarzmik <robert.jarzmik@xxxxxxx> writes:

> Convert pxa_camera from videobuf to videobuf2.
>
> As the soc_camera was already compatible with videobuf2, the port is
> quite straightforward.
>
> The special case of this code in which the vb2 to prepare is "too
> big" in terms of size for the new capture format, the pxa_camera will
> fail.
>
> Signed-off-by: Robert Jarzmik <robert.jarzmik@xxxxxxx>
...zip...

> diff --git a/drivers/media/platform/soc_camera/pxa_camera.c b/drivers/media/platform/soc_camera/pxa_camera.c
> index 2aaf4a8f71a0..5bf97c6b6810 100644
> --- a/drivers/media/platform/soc_camera/pxa_camera.c
> +++ b/drivers/media/platform/soc_camera/pxa_camera.c
> -static void pxa_camera_init_videobuf(struct videobuf_queue *q,
> -			      struct soc_camera_device *icd)
> +static int pxa_camera_init_videobuf2(struct vb2_queue *vq,
> +				     struct soc_camera_device *icd)
>  {
>  	struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
>  	struct pxa_camera_dev *pcdev = ici->priv;
> +	int ret;
>  
> -	/*
> -	 * We must pass NULL as dev pointer, then all pci_* dma operations
> -	 * transform to normal dma_* ones.
> -	 */
> -	videobuf_queue_sg_init(q, &pxa_videobuf_ops, NULL, &pcdev->lock,
> -				V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_FIELD_NONE,
> -				sizeof(struct pxa_buffer), icd, &ici->host_lock);
> +	vq->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
> +	vq->io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF;
> +	vq->drv_priv = pcdev;
> +	vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
> +	vq->buf_struct_size = sizeof(struct pxa_buffer);
> +	vq->dev = pcdev->v4l2_dev.dev;

This last line breaks bisectability as the v4l2_dev only appears in patch 10
... I'm afraid at least this will trigger a v5 respin of the patches.

Cheers.

--
Robert
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux