Linux Samsung SOC development
 help / color / mirror / Atom feed
* [PATCH 0/6] [media] Fixes and improvements for VIDIOC_QUERYCAP in Samsung media drivers
@ 2016-06-16 21:40 Javier Martinez Canillas
  2016-06-16 21:40 ` [PATCH 5/6] [media] gsc-m2m: add device name sufix to bus_info capatiliby field Javier Martinez Canillas
  2016-06-16 21:40 ` [PATCH 6/6] [media] gsc-m2m: improve v4l2_capability driver and card fields Javier Martinez Canillas
  0 siblings, 2 replies; 5+ messages in thread
From: Javier Martinez Canillas @ 2016-06-16 21:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: Javier Martinez Canillas, Junghak Sung, Kukjin Kim, Seung-Woo Kim,
	Mauro Carvalho Chehab, Jacek Anaszewski, Kamil Debski,
	Jeongtae Park, Inki Dae, linux-samsung-soc, Kyungmin Park,
	Krzysztof Kozlowski, Geunyoung Kim, Markus Elfring,
	Andrzej Pietrasiewicz, Hans Verkuil, linux-arm-kernel,
	linux-media

Hello,

This series contains some fixes and improvements for the VIDIOC_QUERYCAP ioctl
handler in different media platform drivers for IP blocks found in Exynos SoCs.

Some of the issues were reported by the v4l2-compliance tool while others are
things I noticed while looking at the Driver name, Card type and Bus info.

Best regards,
Javier


Javier Martinez Canillas (6):
  [media] s5p-mfc: set capablity bus_info as required by VIDIOC_QUERYCAP
  [media] s5p-mfc: improve v4l2_capability driver and card fields
  [media] s5p-jpeg: set capablity bus_info as required by
    VIDIOC_QUERYCAP
  [media] s5p-jpeg: only fill driver's name in capabilities driver field
  [media] gsc-m2m: add device name sufix to bus_info capatiliby field
  [media] gsc-m2m: improve v4l2_capability driver and card fields

 drivers/media/platform/exynos-gsc/gsc-m2m.c     | 7 ++++---
 drivers/media/platform/s5p-jpeg/jpeg-core.c     | 7 ++++---
 drivers/media/platform/s5p-mfc/s5p_mfc.c        | 1 -
 drivers/media/platform/s5p-mfc/s5p_mfc_common.h | 2 ++
 drivers/media/platform/s5p-mfc/s5p_mfc_dec.c    | 7 ++++---
 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c    | 7 ++++---
 6 files changed, 18 insertions(+), 13 deletions(-)

-- 
2.5.5

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 5/6] [media] gsc-m2m: add device name sufix to bus_info capatiliby field
  2016-06-16 21:40 [PATCH 0/6] [media] Fixes and improvements for VIDIOC_QUERYCAP in Samsung media drivers Javier Martinez Canillas
@ 2016-06-16 21:40 ` Javier Martinez Canillas
  2016-06-17  7:13   ` Hans Verkuil
  2016-06-16 21:40 ` [PATCH 6/6] [media] gsc-m2m: improve v4l2_capability driver and card fields Javier Martinez Canillas
  1 sibling, 1 reply; 5+ messages in thread
From: Javier Martinez Canillas @ 2016-06-16 21:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: Javier Martinez Canillas, Junghak Sung, Kukjin Kim, Seung-Woo Kim,
	Mauro Carvalho Chehab, Inki Dae, linux-samsung-soc,
	Krzysztof Kozlowski, Markus Elfring, Hans Verkuil,
	linux-arm-kernel, linux-media

The driver doesn't set the device in the struct v4l2_capability bus_info
field so v4l2-compliance reports the following error for VIDIOC_QUERYCAP:

Required ioctls:
                fail: v4l2-compliance.cpp(537): missing bus_info prefix ('platform')
        test VIDIOC_QUERYCAP: FAIL

This patch fixes this by filling also the device besides the bus.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
---

 drivers/media/platform/exynos-gsc/gsc-m2m.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/exynos-gsc/gsc-m2m.c b/drivers/media/platform/exynos-gsc/gsc-m2m.c
index a600e32e2543..af81383086b8 100644
--- a/drivers/media/platform/exynos-gsc/gsc-m2m.c
+++ b/drivers/media/platform/exynos-gsc/gsc-m2m.c
@@ -281,7 +281,8 @@ static int gsc_m2m_querycap(struct file *file, void *fh,
 
 	strlcpy(cap->driver, gsc->pdev->name, sizeof(cap->driver));
 	strlcpy(cap->card, gsc->pdev->name, sizeof(cap->card));
-	strlcpy(cap->bus_info, "platform", sizeof(cap->bus_info));
+	snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
+		 dev_name(&gsc->pdev->dev));
 	cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M_MPLANE |
 		V4L2_CAP_VIDEO_CAPTURE_MPLANE |	V4L2_CAP_VIDEO_OUTPUT_MPLANE;
 
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 6/6] [media] gsc-m2m: improve v4l2_capability driver and card fields
  2016-06-16 21:40 [PATCH 0/6] [media] Fixes and improvements for VIDIOC_QUERYCAP in Samsung media drivers Javier Martinez Canillas
  2016-06-16 21:40 ` [PATCH 5/6] [media] gsc-m2m: add device name sufix to bus_info capatiliby field Javier Martinez Canillas
@ 2016-06-16 21:40 ` Javier Martinez Canillas
  2016-06-17  7:13   ` Hans Verkuil
  1 sibling, 1 reply; 5+ messages in thread
From: Javier Martinez Canillas @ 2016-06-16 21:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: Javier Martinez Canillas, Junghak Sung, Kukjin Kim, Seung-Woo Kim,
	Mauro Carvalho Chehab, linux-samsung-soc, Krzysztof Kozlowski,
	Geunyoung Kim, Markus Elfring, Hans Verkuil, linux-arm-kernel,
	linux-media

According to the V4L2 documentation the driver and card fields should be
used to identify the driver and the device but the gsc-m2m driver fills
those field using the platform device name, which in turn is the name of
the device DT node.

So not only the filled information isn't correct but also the same values
are used in the driver, card and bus_info fields.

Before this patch:

Driver Info (not using libv4l2):
        Driver name   : 13e00000.video-
        Card type     : 13e00000.video-scaler
        Bus info      : platform:13e00000.video-scaler
        Driver version: 4.7.0

After this patch:

Driver Info (not using libv4l2):
        Driver name   : exynos-gsc
        Card type     : exynos-gsc gscaler
        Bus info      : platform:13e00000.video-scaler
        Driver version: 4.7.0

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>

---

 drivers/media/platform/exynos-gsc/gsc-m2m.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/exynos-gsc/gsc-m2m.c b/drivers/media/platform/exynos-gsc/gsc-m2m.c
index af81383086b8..274861c27367 100644
--- a/drivers/media/platform/exynos-gsc/gsc-m2m.c
+++ b/drivers/media/platform/exynos-gsc/gsc-m2m.c
@@ -279,8 +279,8 @@ static int gsc_m2m_querycap(struct file *file, void *fh,
 	struct gsc_ctx *ctx = fh_to_ctx(fh);
 	struct gsc_dev *gsc = ctx->gsc_dev;
 
-	strlcpy(cap->driver, gsc->pdev->name, sizeof(cap->driver));
-	strlcpy(cap->card, gsc->pdev->name, sizeof(cap->card));
+	strlcpy(cap->driver, GSC_MODULE_NAME, sizeof(cap->driver));
+	strlcpy(cap->card, GSC_MODULE_NAME " gscaler", sizeof(cap->card));
 	snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
 		 dev_name(&gsc->pdev->dev));
 	cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M_MPLANE |
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 5/6] [media] gsc-m2m: add device name sufix to bus_info capatiliby field
  2016-06-16 21:40 ` [PATCH 5/6] [media] gsc-m2m: add device name sufix to bus_info capatiliby field Javier Martinez Canillas
@ 2016-06-17  7:13   ` Hans Verkuil
  0 siblings, 0 replies; 5+ messages in thread
From: Hans Verkuil @ 2016-06-17  7:13 UTC (permalink / raw)
  To: Javier Martinez Canillas, linux-kernel
  Cc: Junghak Sung, Kukjin Kim, Seung-Woo Kim, Mauro Carvalho Chehab,
	Inki Dae, linux-samsung-soc, Krzysztof Kozlowski, Markus Elfring,
	Hans Verkuil, linux-arm-kernel, linux-media

On 06/16/2016 11:40 PM, Javier Martinez Canillas wrote:
> The driver doesn't set the device in the struct v4l2_capability bus_info
> field so v4l2-compliance reports the following error for VIDIOC_QUERYCAP:
> 
> Required ioctls:
>                 fail: v4l2-compliance.cpp(537): missing bus_info prefix ('platform')
>         test VIDIOC_QUERYCAP: FAIL
> 
> This patch fixes this by filling also the device besides the bus.
> 
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>

Thanks!

Hans

> ---
> 
>  drivers/media/platform/exynos-gsc/gsc-m2m.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/exynos-gsc/gsc-m2m.c b/drivers/media/platform/exynos-gsc/gsc-m2m.c
> index a600e32e2543..af81383086b8 100644
> --- a/drivers/media/platform/exynos-gsc/gsc-m2m.c
> +++ b/drivers/media/platform/exynos-gsc/gsc-m2m.c
> @@ -281,7 +281,8 @@ static int gsc_m2m_querycap(struct file *file, void *fh,
>  
>  	strlcpy(cap->driver, gsc->pdev->name, sizeof(cap->driver));
>  	strlcpy(cap->card, gsc->pdev->name, sizeof(cap->card));
> -	strlcpy(cap->bus_info, "platform", sizeof(cap->bus_info));
> +	snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
> +		 dev_name(&gsc->pdev->dev));
>  	cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M_MPLANE |
>  		V4L2_CAP_VIDEO_CAPTURE_MPLANE |	V4L2_CAP_VIDEO_OUTPUT_MPLANE;
>  
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 6/6] [media] gsc-m2m: improve v4l2_capability driver and card fields
  2016-06-16 21:40 ` [PATCH 6/6] [media] gsc-m2m: improve v4l2_capability driver and card fields Javier Martinez Canillas
@ 2016-06-17  7:13   ` Hans Verkuil
  0 siblings, 0 replies; 5+ messages in thread
From: Hans Verkuil @ 2016-06-17  7:13 UTC (permalink / raw)
  To: Javier Martinez Canillas, linux-kernel
  Cc: Junghak Sung, Kukjin Kim, Seung-Woo Kim, Mauro Carvalho Chehab,
	linux-samsung-soc, Krzysztof Kozlowski, Geunyoung Kim,
	Markus Elfring, Hans Verkuil, linux-arm-kernel, linux-media

On 06/16/2016 11:40 PM, Javier Martinez Canillas wrote:
> According to the V4L2 documentation the driver and card fields should be
> used to identify the driver and the device but the gsc-m2m driver fills
> those field using the platform device name, which in turn is the name of
> the device DT node.
> 
> So not only the filled information isn't correct but also the same values
> are used in the driver, card and bus_info fields.
> 
> Before this patch:
> 
> Driver Info (not using libv4l2):
>         Driver name   : 13e00000.video-
>         Card type     : 13e00000.video-scaler
>         Bus info      : platform:13e00000.video-scaler
>         Driver version: 4.7.0
> 
> After this patch:
> 
> Driver Info (not using libv4l2):
>         Driver name   : exynos-gsc
>         Card type     : exynos-gsc gscaler
>         Bus info      : platform:13e00000.video-scaler
>         Driver version: 4.7.0
> 
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>

Thanks!

Hans

> 
> ---
> 
>  drivers/media/platform/exynos-gsc/gsc-m2m.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/platform/exynos-gsc/gsc-m2m.c b/drivers/media/platform/exynos-gsc/gsc-m2m.c
> index af81383086b8..274861c27367 100644
> --- a/drivers/media/platform/exynos-gsc/gsc-m2m.c
> +++ b/drivers/media/platform/exynos-gsc/gsc-m2m.c
> @@ -279,8 +279,8 @@ static int gsc_m2m_querycap(struct file *file, void *fh,
>  	struct gsc_ctx *ctx = fh_to_ctx(fh);
>  	struct gsc_dev *gsc = ctx->gsc_dev;
>  
> -	strlcpy(cap->driver, gsc->pdev->name, sizeof(cap->driver));
> -	strlcpy(cap->card, gsc->pdev->name, sizeof(cap->card));
> +	strlcpy(cap->driver, GSC_MODULE_NAME, sizeof(cap->driver));
> +	strlcpy(cap->card, GSC_MODULE_NAME " gscaler", sizeof(cap->card));
>  	snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
>  		 dev_name(&gsc->pdev->dev));
>  	cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M_MPLANE |
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-06-17  7:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-16 21:40 [PATCH 0/6] [media] Fixes and improvements for VIDIOC_QUERYCAP in Samsung media drivers Javier Martinez Canillas
2016-06-16 21:40 ` [PATCH 5/6] [media] gsc-m2m: add device name sufix to bus_info capatiliby field Javier Martinez Canillas
2016-06-17  7:13   ` Hans Verkuil
2016-06-16 21:40 ` [PATCH 6/6] [media] gsc-m2m: improve v4l2_capability driver and card fields Javier Martinez Canillas
2016-06-17  7:13   ` Hans Verkuil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox