From: shuahkh@osg.samsung.com (Shuah Khan)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/6] [media] s5p-mfc: improve v4l2_capability driver and card fields
Date: Wed, 29 Jun 2016 13:45:49 -0600 [thread overview]
Message-ID: <5774256D.8090601@osg.samsung.com> (raw)
In-Reply-To: <1466113235-25909-3-git-send-email-javier@osg.samsung.com>
On 06/16/2016 03: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 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>
Looks good.
Reviewed-by: Shuah Khan <shuahkh@osg.samsung.com>
-- Shuah
> ---
>
> 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));
> /*
>
WARNING: multiple messages have this Message-ID (diff)
From: Shuah Khan <shuahkh@osg.samsung.com>
To: Javier Martinez Canillas <javier@osg.samsung.com>,
linux-kernel@vger.kernel.org
Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
Kamil Debski <k.debski@samsung.com>,
Jeongtae Park <jtp.park@samsung.com>,
Kyungmin Park <kyungmin.park@samsung.com>,
linux-arm-kernel@lists.infradead.org,
linux-media@vger.kernel.org
Subject: Re: [PATCH 2/6] [media] s5p-mfc: improve v4l2_capability driver and card fields
Date: Wed, 29 Jun 2016 13:45:49 -0600 [thread overview]
Message-ID: <5774256D.8090601@osg.samsung.com> (raw)
In-Reply-To: <1466113235-25909-3-git-send-email-javier@osg.samsung.com>
On 06/16/2016 03: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 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>
Looks good.
Reviewed-by: Shuah Khan <shuahkh@osg.samsung.com>
-- Shuah
> ---
>
> 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));
> /*
>
next prev parent reply other threads:[~2016-06-29 19:45 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
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-16 21:40 ` [PATCH 1/6] [media] s5p-mfc: set capablity bus_info as required by VIDIOC_QUERYCAP Javier Martinez Canillas
2016-06-16 21:40 ` Javier Martinez Canillas
2016-06-17 7:11 ` Hans Verkuil
2016-06-17 7:11 ` Hans Verkuil
2016-06-29 19:43 ` Shuah Khan
2016-06-29 19:43 ` Shuah Khan
2016-06-16 21:40 ` [PATCH 2/6] [media] s5p-mfc: improve v4l2_capability driver and card fields Javier Martinez Canillas
2016-06-16 21:40 ` Javier Martinez Canillas
2016-06-17 7:12 ` Hans Verkuil
2016-06-17 7:12 ` Hans Verkuil
2016-06-29 19:45 ` Shuah Khan [this message]
2016-06-29 19:45 ` Shuah Khan
2016-06-16 21:40 ` [PATCH 3/6] [media] s5p-jpeg: set capablity bus_info as required by VIDIOC_QUERYCAP Javier Martinez Canillas
2016-06-16 21:40 ` Javier Martinez Canillas
2016-06-17 6:45 ` Jacek Anaszewski
2016-06-17 6:45 ` Jacek Anaszewski
2016-06-17 7:12 ` Hans Verkuil
2016-06-17 7:12 ` Hans Verkuil
2016-06-29 19:46 ` Shuah Khan
2016-06-29 19:46 ` Shuah Khan
2016-06-16 21:40 ` [PATCH 4/6] [media] s5p-jpeg: only fill driver's name in capabilities driver field Javier Martinez Canillas
2016-06-16 21:40 ` Javier Martinez Canillas
2016-06-17 6:45 ` Jacek Anaszewski
2016-06-17 6:45 ` Jacek Anaszewski
2016-06-17 7:13 ` Hans Verkuil
2016-06-17 7:13 ` Hans Verkuil
2016-06-29 19:47 ` Shuah Khan
2016-06-29 19:47 ` Shuah Khan
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
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-16 21:40 ` Javier Martinez Canillas
2016-06-17 7:13 ` Hans Verkuil
2016-06-17 7:13 ` Hans Verkuil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5774256D.8090601@osg.samsung.com \
--to=shuahkh@osg.samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.