Re: [PATCH 11/16] xilinx: set device_caps in struct video_device

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

 



Hi Hans,

Thank you for the patch.

On Wed, Jun 26, 2019 at 09:44:16AM +0200, Hans Verkuil wrote:
> Instead of filling in the struct v4l2_capability device_caps
> field, fill in the struct video_device device_caps field.
> 
> That way the V4L2 core knows what the capabilities of the
> video device are.
> 
> Signed-off-by: Hans Verkuil <hverkuil-cisco@xxxxxxxxx>
> Cc: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>

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

Please feel free to merge this patch along with the rest of the series.

> ---
>  drivers/media/platform/xilinx/xilinx-dma.c | 16 +++++++---------
>  1 file changed, 7 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/media/platform/xilinx/xilinx-dma.c b/drivers/media/platform/xilinx/xilinx-dma.c
> index c9d5fdb2d407..bcd783d9e5ae 100644
> --- a/drivers/media/platform/xilinx/xilinx-dma.c
> +++ b/drivers/media/platform/xilinx/xilinx-dma.c
> @@ -491,15 +491,8 @@ xvip_dma_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
>  	struct v4l2_fh *vfh = file->private_data;
>  	struct xvip_dma *dma = to_xvip_dma(vfh->vdev);
>  
> -	cap->device_caps = V4L2_CAP_STREAMING;
> -
> -	if (dma->queue.type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
> -		cap->device_caps |= V4L2_CAP_VIDEO_CAPTURE;
> -	else
> -		cap->device_caps |= V4L2_CAP_VIDEO_OUTPUT;
> -
> -	cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS
> -			  | dma->xdev->v4l2_caps;
> +	cap->capabilities = dma->xdev->v4l2_caps | V4L2_CAP_STREAMING |
> +			    V4L2_CAP_DEVICE_CAPS;
>  
>  	strscpy(cap->driver, "xilinx-vipp", sizeof(cap->driver));
>  	strscpy(cap->card, dma->video.name, sizeof(cap->card));
> @@ -700,6 +693,11 @@ int xvip_dma_init(struct xvip_composite_device *xdev, struct xvip_dma *dma,
>  	dma->video.release = video_device_release_empty;
>  	dma->video.ioctl_ops = &xvip_dma_ioctl_ops;
>  	dma->video.lock = &dma->lock;
> +	dma->video.device_caps = V4L2_CAP_STREAMING;
> +	if (type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
> +		dma->video.device_caps |= V4L2_CAP_VIDEO_CAPTURE;
> +	else
> +		dma->video.device_caps |= V4L2_CAP_VIDEO_OUTPUT;
>  
>  	video_set_drvdata(&dma->video, dma);

-- 
Regards,

Laurent Pinchart



[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