Re: [PATCH 1/6] [media] s5p-mfc: 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 bus_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 

I started making the very same changes. Looks good.

Reviewed-by: Shuah Khan 

-- Shuah
> ---
> 
>  drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | 3 ++-
>  drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 3 ++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c 
> b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
> index f2d6376ce618..4a40df22fd63 100644
> --- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
> @@ -267,7 +267,8 @@ static int vidioc_querycap(struct file *file, void *priv,
>  
>   strncpy(cap->driver, dev->plat_dev->name, sizeof(cap->driver) - 1);
>   strncpy(cap->card, dev->plat_dev->name, sizeof(cap->card) - 1);
> - cap->bus_info[0] = 0;
> + snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
> +  dev_name(>plat_dev->dev));
>   /*
>* This is only a mem-to-mem video device. The capture and output
>* device capability flags are left only for backward compatibility
> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c 
> b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
> index 034b5c1d35a1..dd466ea6429e 100644
> --- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
> @@ -945,7 +945,8 @@ static int vidioc_querycap(struct file *file, void *priv,
>  
>   strncpy(cap->driver, dev->plat_dev->name, sizeof(cap->driver) - 1);
>   strncpy(cap->card, dev->plat_dev->name, sizeof(cap->card) - 1);
> - cap->bus_info[0] = 0;
> + snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
> +  dev_name(>plat_dev->dev));
>   /*
>* This is only a mem-to-mem video device. The capture and output
>* device capability flags are left only for backward compatibility
> 

--
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 1/6] [media] s5p-mfc: 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 bus_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-mfc/s5p_mfc_dec.c | 3 ++-
>  drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 3 ++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c 
> b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
> index f2d6376ce618..4a40df22fd63 100644
> --- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
> @@ -267,7 +267,8 @@ static int vidioc_querycap(struct file *file, void *priv,
>  
>   strncpy(cap->driver, dev->plat_dev->name, sizeof(cap->driver) - 1);
>   strncpy(cap->card, dev->plat_dev->name, sizeof(cap->card) - 1);
> - cap->bus_info[0] = 0;
> + snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
> +  dev_name(>plat_dev->dev));
>   /*
>* This is only a mem-to-mem video device. The capture and output
>* device capability flags are left only for backward compatibility
> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c 
> b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
> index 034b5c1d35a1..dd466ea6429e 100644
> --- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
> @@ -945,7 +945,8 @@ static int vidioc_querycap(struct file *file, void *priv,
>  
>   strncpy(cap->driver, dev->plat_dev->name, sizeof(cap->driver) - 1);
>   strncpy(cap->card, dev->plat_dev->name, sizeof(cap->card) - 1);
> - cap->bus_info[0] = 0;
> + snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
> +  dev_name(>plat_dev->dev));
>   /*
>* This is only a mem-to-mem video device. The capture and output
>* device capability flags are left only for backward compatibility
> 
--
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 1/6] [media] s5p-mfc: 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 bus_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-mfc/s5p_mfc_dec.c | 3 ++-
 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c 
b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
index f2d6376ce618..4a40df22fd63 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
@@ -267,7 +267,8 @@ static int vidioc_querycap(struct file *file, void *priv,
 
strncpy(cap->driver, dev->plat_dev->name, sizeof(cap->driver) - 1);
strncpy(cap->card, dev->plat_dev->name, sizeof(cap->card) - 1);
-   cap->bus_info[0] = 0;
+   snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
+dev_name(>plat_dev->dev));
/*
 * This is only a mem-to-mem video device. The capture and output
 * device capability flags are left only for backward compatibility
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c 
b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
index 034b5c1d35a1..dd466ea6429e 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
@@ -945,7 +945,8 @@ static int vidioc_querycap(struct file *file, void *priv,
 
strncpy(cap->driver, dev->plat_dev->name, sizeof(cap->driver) - 1);
strncpy(cap->card, dev->plat_dev->name, sizeof(cap->card) - 1);
-   cap->bus_info[0] = 0;
+   snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
+dev_name(>plat_dev->dev));
/*
 * This is only a mem-to-mem video device. The capture and output
 * device capability flags are left only for backward compatibility
-- 
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