Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1424464 > unrolled thread

[PATCH 0/6] [media] Fixes and improvements for VIDIOC_QUERYCAP in Samsung media drivers

Started byJavier Martinez Canillas <javier@osg.samsung.com>
First post2016-06-16 23:50 +0200
Last post2016-06-16 23:50 +0200
Articles 9 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/6] [media] Fixes and improvements for VIDIOC_QUERYCAP in Samsung media drivers Javier Martinez Canillas <javier@osg.samsung.com> - 2016-06-16 23:50 +0200
    [PATCH 2/6] [media] s5p-mfc: improve v4l2_capability driver and card fields Javier Martinez Canillas <javier@osg.samsung.com> - 2016-06-16 23:50 +0200
    [PATCH 4/6] [media] s5p-jpeg: only fill driver's name in capabilities driver field Javier Martinez Canillas <javier@osg.samsung.com> - 2016-06-16 23:50 +0200
      Re: [PATCH 4/6] [media] s5p-jpeg: only fill driver's name in  capabilities driver field Jacek Anaszewski <j.anaszewski@samsung.com> - 2016-06-17 08:50 +0200
    [PATCH 1/6] [media] s5p-mfc: set capablity bus_info as required by VIDIOC_QUERYCAP Javier Martinez Canillas <javier@osg.samsung.com> - 2016-06-16 23:50 +0200
    [PATCH 3/6] [media] s5p-jpeg: set capablity bus_info as required by VIDIOC_QUERYCAP Javier Martinez Canillas <javier@osg.samsung.com> - 2016-06-16 23:50 +0200
      Re: [PATCH 3/6] [media] s5p-jpeg: set capablity bus_info as required  by VIDIOC_QUERYCAP Jacek Anaszewski <j.anaszewski@samsung.com> - 2016-06-17 08:50 +0200
    [PATCH 6/6] [media] gsc-m2m: improve v4l2_capability driver and card fields Javier Martinez Canillas <javier@osg.samsung.com> - 2016-06-16 23:50 +0200
    [PATCH 5/6] [media] gsc-m2m: add device name sufix to bus_info capatiliby field Javier Martinez Canillas <javier@osg.samsung.com> - 2016-06-16 23:50 +0200

#1424464 — [PATCH 0/6] [media] Fixes and improvements for VIDIOC_QUERYCAP in Samsung media drivers

FromJavier Martinez Canillas <javier@osg.samsung.com>
Date2016-06-16 23:50 +0200
Subject[PATCH 0/6] [media] Fixes and improvements for VIDIOC_QUERYCAP in Samsung media drivers
Message-ID<rKNkJ-5aq-1@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1424468 — [PATCH 2/6] [media] s5p-mfc: improve v4l2_capability driver and card fields

FromJavier Martinez Canillas <javier@osg.samsung.com>
Date2016-06-16 23:50 +0200
Subject[PATCH 2/6] [media] s5p-mfc: improve v4l2_capability driver and card fields
Message-ID<rKNkJ-5aq-15@gated-at.bofh.it>
In reply to#1424464
According to the V4L2 documentation the driver and card fields should be
used to identify the driver and the device but the s5p-mfc 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 all the fields for both the encoder and decoder video devices.

Before this patch:

Driver Info (not using libv4l2):
        Driver name   : 11000000.codec
        Card type     : 11000000.codec
        Bus info      : platform:11000000.codec
        Driver version: 4.7.0

Driver Info (not using libv4l2):
        Driver name   : 11000000.codec
        Card type     : 11000000.codec
        Bus info      : platform:11000000.codec
        Driver version: 4.7.0

After this patch:

Driver Info (not using libv4l2):
        Driver name   : s5p-mfc
        Card type     : s5p-mfc-dec
        Bus info      : platform:11000000.codec
        Driver version: 4.7.0

Driver Info (not using libv4l2):
        Driver name   : s5p-mfc
        Card type     : s5p-mfc-enc
        Bus info      : platform:11000000.codec
        Driver version: 4.7.0

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

 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    | 4 ++--
 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c    | 4 ++--
 4 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c
index 6ee620ee8cd5..a936f89fa54a 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
@@ -35,7 +35,6 @@
 #include "s5p_mfc_cmd.h"
 #include "s5p_mfc_pm.h"
 
-#define S5P_MFC_NAME		"s5p-mfc"
 #define S5P_MFC_DEC_NAME	"s5p-mfc-dec"
 #define S5P_MFC_ENC_NAME	"s5p-mfc-enc"
 
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
index 9eb2481ec292..a10dcd244ff0 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
@@ -25,6 +25,8 @@
 #include "regs-mfc.h"
 #include "regs-mfc-v8.h"
 
+#define S5P_MFC_NAME		"s5p-mfc"
+
 /* Definitions related to MFC memory */
 
 /* Offset base used to differentiate between CAPTURE and OUTPUT
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
index 4a40df22fd63..5793b0d8ee0c 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
@@ -265,8 +265,8 @@ static int vidioc_querycap(struct file *file, void *priv,
 {
 	struct s5p_mfc_dev *dev = video_drvdata(file);
 
-	strncpy(cap->driver, dev->plat_dev->name, sizeof(cap->driver) - 1);
-	strncpy(cap->card, dev->plat_dev->name, sizeof(cap->card) - 1);
+	strncpy(cap->driver, S5P_MFC_NAME, sizeof(cap->driver) - 1);
+	strncpy(cap->card, dev->vfd_dec->name, sizeof(cap->card) - 1);
 	snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
 		 dev_name(&dev->plat_dev->dev));
 	/*
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
index dd466ea6429e..1220559d4874 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
@@ -943,8 +943,8 @@ static int vidioc_querycap(struct file *file, void *priv,
 {
 	struct s5p_mfc_dev *dev = video_drvdata(file);
 
-	strncpy(cap->driver, dev->plat_dev->name, sizeof(cap->driver) - 1);
-	strncpy(cap->card, dev->plat_dev->name, sizeof(cap->card) - 1);
+	strncpy(cap->driver, S5P_MFC_NAME, sizeof(cap->driver) - 1);
+	strncpy(cap->card, dev->vfd_enc->name, sizeof(cap->card) - 1);
 	snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
 		 dev_name(&dev->plat_dev->dev));
 	/*
-- 
2.5.5

[toc] | [prev] | [next] | [standalone]


#1424470 — [PATCH 4/6] [media] s5p-jpeg: only fill driver's name in capabilities driver field

FromJavier Martinez Canillas <javier@osg.samsung.com>
Date2016-06-16 23:50 +0200
Subject[PATCH 4/6] [media] s5p-jpeg: only fill driver's name in capabilities driver field
Message-ID<rKNkJ-5aq-17@gated-at.bofh.it>
In reply to#1424464
The driver fills in both the struct v4l2_capability driver and card fields
the same values, that is the driver's name plus the information if the dev
is a decoder or an encoder.

But the driver field has a fixed length of 16 bytes so the filled data is
truncated:

Driver Info (not using libv4l2):
        Driver name   : s5p-jpeg decode
        Card type     : s5p-jpeg decoder
        Bus info      : platform:11f50000.jpeg
        Driver version: 4.7.0

Also, this field should only contain the driver's name so use just that.
The information if the device is a decoder or an encoder is in the card
type field anyways.

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

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

diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c
index e3ff3d4bd72e..f9fb52a53e79 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
@@ -1246,12 +1246,12 @@ static int s5p_jpeg_querycap(struct file *file, void *priv,
 	struct s5p_jpeg_ctx *ctx = fh_to_ctx(priv);
 
 	if (ctx->mode == S5P_JPEG_ENCODE) {
-		strlcpy(cap->driver, S5P_JPEG_M2M_NAME " encoder",
+		strlcpy(cap->driver, S5P_JPEG_M2M_NAME,
 			sizeof(cap->driver));
 		strlcpy(cap->card, S5P_JPEG_M2M_NAME " encoder",
 			sizeof(cap->card));
 	} else {
-		strlcpy(cap->driver, S5P_JPEG_M2M_NAME " decoder",
+		strlcpy(cap->driver, S5P_JPEG_M2M_NAME,
 			sizeof(cap->driver));
 		strlcpy(cap->card, S5P_JPEG_M2M_NAME " decoder",
 			sizeof(cap->card));
-- 
2.5.5

[toc] | [prev] | [next] | [standalone]


#1424726 — Re: [PATCH 4/6] [media] s5p-jpeg: only fill driver's name in capabilities driver field

FromJacek Anaszewski <j.anaszewski@samsung.com>
Date2016-06-17 08:50 +0200
SubjectRe: [PATCH 4/6] [media] s5p-jpeg: only fill driver's name in capabilities driver field
Message-ID<rKVLj-33B-9@gated-at.bofh.it>
In reply to#1424470
Hi Javier,

On 06/16/2016 11:40 PM, Javier Martinez Canillas wrote:
> The driver fills in both the struct v4l2_capability driver and card fields
> the same values, that is the driver's name plus the information if the dev
> is a decoder or an encoder.
>
> But the driver field has a fixed length of 16 bytes so the filled data is
> truncated:
>
> Driver Info (not using libv4l2):
>          Driver name   : s5p-jpeg decode
>          Card type     : s5p-jpeg decoder
>          Bus info      : platform:11f50000.jpeg
>          Driver version: 4.7.0
>
> Also, this field should only contain the driver's name so use just that.
> The information if the device is a decoder or an encoder is in the card
> type field anyways.
>
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
> ---
>
>   drivers/media/platform/s5p-jpeg/jpeg-core.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c
> index e3ff3d4bd72e..f9fb52a53e79 100644
> --- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
> +++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
> @@ -1246,12 +1246,12 @@ static int s5p_jpeg_querycap(struct file *file, void *priv,
>   	struct s5p_jpeg_ctx *ctx = fh_to_ctx(priv);
>
>   	if (ctx->mode == S5P_JPEG_ENCODE) {
> -		strlcpy(cap->driver, S5P_JPEG_M2M_NAME " encoder",
> +		strlcpy(cap->driver, S5P_JPEG_M2M_NAME,
>   			sizeof(cap->driver));
>   		strlcpy(cap->card, S5P_JPEG_M2M_NAME " encoder",
>   			sizeof(cap->card));
>   	} else {
> -		strlcpy(cap->driver, S5P_JPEG_M2M_NAME " decoder",
> +		strlcpy(cap->driver, S5P_JPEG_M2M_NAME,
>   			sizeof(cap->driver));
>   		strlcpy(cap->card, S5P_JPEG_M2M_NAME " decoder",
>   			sizeof(cap->card));
>

Acked-by: Jacek Anaszewski <j.anaszewski@samsung.com>

-- 
Best regards,
Jacek Anaszewski

[toc] | [prev] | [next] | [standalone]


#1424473 — [PATCH 1/6] [media] s5p-mfc: set capablity bus_info as required by VIDIOC_QUERYCAP

FromJavier Martinez Canillas <javier@osg.samsung.com>
Date2016-06-16 23:50 +0200
Subject[PATCH 1/6] [media] s5p-mfc: set capablity bus_info as required by VIDIOC_QUERYCAP
Message-ID<rKNkK-5aq-21@gated-at.bofh.it>
In reply to#1424464
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 <javier@osg.samsung.com>
---

 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(&dev->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(&dev->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

[toc] | [prev] | [next] | [standalone]


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

FromJavier Martinez Canillas <javier@osg.samsung.com>
Date2016-06-16 23:50 +0200
Subject[PATCH 3/6] [media] s5p-jpeg: set capablity bus_info as required by VIDIOC_QUERYCAP
Message-ID<rKNkK-5aq-33@gated-at.bofh.it>
In reply to#1424464
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 <javier@osg.samsung.com>
---

 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

[toc] | [prev] | [next] | [standalone]


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

FromJacek Anaszewski <j.anaszewski@samsung.com>
Date2016-06-17 08:50 +0200
SubjectRe: [PATCH 3/6] [media] s5p-jpeg: set capablity bus_info as required by VIDIOC_QUERYCAP
Message-ID<rKVLj-33B-3@gated-at.bofh.it>
In reply to#1424478
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 <javier@osg.samsung.com>
> ---
>
>   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 <j.anaszewski@samsung.com>

-- 
Best regards,
Jacek Anaszewski

[toc] | [prev] | [next] | [standalone]


#1424482 — [PATCH 6/6] [media] gsc-m2m: improve v4l2_capability driver and card fields

FromJavier Martinez Canillas <javier@osg.samsung.com>
Date2016-06-16 23:50 +0200
Subject[PATCH 6/6] [media] gsc-m2m: improve v4l2_capability driver and card fields
Message-ID<rKNkK-5aq-53@gated-at.bofh.it>
In reply to#1424464
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

[toc] | [prev] | [next] | [standalone]


#1424487 — [PATCH 5/6] [media] gsc-m2m: add device name sufix to bus_info capatiliby field

FromJavier Martinez Canillas <javier@osg.samsung.com>
Date2016-06-16 23:50 +0200
Subject[PATCH 5/6] [media] gsc-m2m: add device name sufix to bus_info capatiliby field
Message-ID<rKNkL-5aq-57@gated-at.bofh.it>
In reply to#1424464
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web