Re: [PATCH 3/6] [media] s5p-jpeg: set capablity bus_info as required by VIDIOC_QUERYCAP

2016-06-29 Thread Shuah Khan
On 06/16/2016 03:40 PM, Javier Martinez Canillas wrote:
> The driver doesn't set the struct v4l2_capability cap_info field so the
> v4l2-compliance tool reports the following errors for VIDIOC_QUERYCAP:
> 
> Required ioctls:
> VIDIOC_QUERYCAP returned 0 (Success)
> fail: v4l2-compliance.cpp(304): string empty
> fail: v4l2-compliance.cpp(528): check_ustring(vcap.bus_info, 
> sizeof(vcap.bus_info))
> test VIDIOC_QUERYCAP: FAIL
> 
> This patch fixes by setting the field in VIDIOC_QUERYCAP ioctl handler:
> 
> Required ioctls:
> VIDIOC_QUERYCAP returned 0 (Success)
> test VIDIOC_QUERYCAP: OK
> 
> Signed-off-by: Javier Martinez Canillas 
> ---
> 
>  drivers/media/platform/s5p-jpeg/jpeg-core.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c 
> b/drivers/media/platform/s5p-jpeg/jpeg-core.c
> index 17bc94092864..e3ff3d4bd72e 100644
> --- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
> +++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
> @@ -1256,7 +1256,8 @@ static int s5p_jpeg_querycap(struct file *file, void 
> *priv,
>   strlcpy(cap->card, S5P_JPEG_M2M_NAME " decoder",
>   sizeof(cap->card));
>   }
> - cap->bus_info[0] = 0;
> + snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
> +  dev_name(ctx->jpeg->dev));
>   cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M;
>   cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
>   return 0;
> 

Looks good.

Reviewed-by: Shuah Khan 

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


Re: [PATCH 3/6] [media] s5p-jpeg: set capablity bus_info as required by VIDIOC_QUERYCAP

2016-06-17 Thread Hans Verkuil
On 06/16/2016 11:40 PM, Javier Martinez Canillas wrote:
> The driver doesn't set the struct v4l2_capability cap_info field so the
> v4l2-compliance tool reports the following errors for VIDIOC_QUERYCAP:
> 
> Required ioctls:
> VIDIOC_QUERYCAP returned 0 (Success)
> fail: v4l2-compliance.cpp(304): string empty
> fail: v4l2-compliance.cpp(528): check_ustring(vcap.bus_info, 
> sizeof(vcap.bus_info))
> test VIDIOC_QUERYCAP: FAIL
> 
> This patch fixes by setting the field in VIDIOC_QUERYCAP ioctl handler:
> 
> Required ioctls:
> VIDIOC_QUERYCAP returned 0 (Success)
> test VIDIOC_QUERYCAP: OK
> 
> Signed-off-by: Javier Martinez Canillas 

Acked-by: Hans Verkuil 

Thanks!

Hans

> ---
> 
>  drivers/media/platform/s5p-jpeg/jpeg-core.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c 
> b/drivers/media/platform/s5p-jpeg/jpeg-core.c
> index 17bc94092864..e3ff3d4bd72e 100644
> --- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
> +++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
> @@ -1256,7 +1256,8 @@ static int s5p_jpeg_querycap(struct file *file, void 
> *priv,
>   strlcpy(cap->card, S5P_JPEG_M2M_NAME " decoder",
>   sizeof(cap->card));
>   }
> - cap->bus_info[0] = 0;
> + snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
> +  dev_name(ctx->jpeg->dev));
>   cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M;
>   cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
>   return 0;
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/6] [media] s5p-jpeg: set capablity bus_info as required by VIDIOC_QUERYCAP

2016-06-17 Thread Jacek Anaszewski

Hi Javier,

On 06/16/2016 11:40 PM, Javier Martinez Canillas wrote:

The driver doesn't set the struct v4l2_capability cap_info field so the
v4l2-compliance tool reports the following errors for VIDIOC_QUERYCAP:

Required ioctls:
 VIDIOC_QUERYCAP returned 0 (Success)
 fail: v4l2-compliance.cpp(304): string empty
 fail: v4l2-compliance.cpp(528): check_ustring(vcap.bus_info, 
sizeof(vcap.bus_info))
 test VIDIOC_QUERYCAP: FAIL

This patch fixes by setting the field in VIDIOC_QUERYCAP ioctl handler:

Required ioctls:
 VIDIOC_QUERYCAP returned 0 (Success)
 test VIDIOC_QUERYCAP: OK

Signed-off-by: Javier Martinez Canillas 
---

  drivers/media/platform/s5p-jpeg/jpeg-core.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c 
b/drivers/media/platform/s5p-jpeg/jpeg-core.c
index 17bc94092864..e3ff3d4bd72e 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
@@ -1256,7 +1256,8 @@ static int s5p_jpeg_querycap(struct file *file, void 
*priv,
strlcpy(cap->card, S5P_JPEG_M2M_NAME " decoder",
sizeof(cap->card));
}
-   cap->bus_info[0] = 0;
+   snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
+dev_name(ctx->jpeg->dev));
cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M;
cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
return 0;



Acked-by: Jacek Anaszewski 

--
Best regards,
Jacek Anaszewski
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/6] [media] s5p-jpeg: set capablity bus_info as required by VIDIOC_QUERYCAP

2016-06-16 Thread Javier Martinez Canillas
The driver doesn't set the struct v4l2_capability cap_info field so the
v4l2-compliance tool reports the following errors for VIDIOC_QUERYCAP:

Required ioctls:
VIDIOC_QUERYCAP returned 0 (Success)
fail: v4l2-compliance.cpp(304): string empty
fail: v4l2-compliance.cpp(528): check_ustring(vcap.bus_info, 
sizeof(vcap.bus_info))
test VIDIOC_QUERYCAP: FAIL

This patch fixes by setting the field in VIDIOC_QUERYCAP ioctl handler:

Required ioctls:
VIDIOC_QUERYCAP returned 0 (Success)
test VIDIOC_QUERYCAP: OK

Signed-off-by: Javier Martinez Canillas 
---

 drivers/media/platform/s5p-jpeg/jpeg-core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c 
b/drivers/media/platform/s5p-jpeg/jpeg-core.c
index 17bc94092864..e3ff3d4bd72e 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
@@ -1256,7 +1256,8 @@ static int s5p_jpeg_querycap(struct file *file, void 
*priv,
strlcpy(cap->card, S5P_JPEG_M2M_NAME " decoder",
sizeof(cap->card));
}
-   cap->bus_info[0] = 0;
+   snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
+dev_name(ctx->jpeg->dev));
cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M;
cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
return 0;
-- 
2.5.5

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