mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "yunfei.dong@mediatek.com" <yunfei.dong@mediatek.com>
To: Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Alexandre Courbot <acourbot@chromium.org>,
	Nicolas Dufresne <nicolas@ndufresne.ca>,
	AngeloGioacchino Del Regno 
	<angelogioacchino.delregno@collabora.com>,
	Benjamin Gaignard <benjamin.gaignard@collabora.com>,
	Tiffany Lin <tiffany.lin@mediatek.com>,
	Andrew-CT Chen <andrew-ct.chen@mediatek.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Tomasz Figa <tfiga@google.com>
Cc: George Sun <george.sun@mediatek.com>,
	Xiaoyong Lu <xiaoyong.lu@mediatek.com>,
	Hsin-Yi Wang <hsinyi@chromium.org>,
	"Fritz Koenig" <frkoenig@chromium.org>,
	Daniel Vetter <daniel@ffwll.ch>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	Irui Wang <irui.wang@mediatek.com>,
	"Steve Cho" <stevecho@chromium.org>,
	<linux-media@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-mediatek@lists.infradead.org>,
	<Project_Global_Chrome_Upstream_Group@mediatek.com>
Subject: Re: [PATCH 1/4] media: mediatek: vcodec: Fix decoder v4l2 bus_info not correctly
Date: Fri, 10 Jun 2022 09:43:51 +0800	[thread overview]
Message-ID: <b1b4ff47306af5fc0aecf8d2041ffca4c30717b2.camel@mediatek.com> (raw)
In-Reply-To: <3cd958be-41a8-707d-983a-c9950e913ae5@xs4all.nl>

Dear Hans,

Thanks for your suggestion.

I will fix bus_info in patch v2:
decoder: "platform:mt%d" to "platform:mt%d-dec"
encoder: "platform:mt%d" to "platform:mt%d-enc"

Best Regards,
Yunfei Dong

On Thu, 2022-06-09 at 12:08 +0200, Hans Verkuil wrote:
> Hi Yunfei Dong,
> 
> On 5/26/22 11:57, Yunfei Dong wrote:
> > Fix v4l2 capability bus_info value with correct chip name according
> > to compatible.
> > 
> > Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
> > ---
> >  .../platform/mediatek/vcodec/mtk_vcodec_dec.c | 23
> > ++++++++++++++++++-
> >  1 file changed, 22 insertions(+), 1 deletion(-)
> > 
> > diff --git
> > a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c
> > b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c
> > index 52e5d36aa912..ccfa426a34ab 100644
> > --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c
> > +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c
> > @@ -185,11 +185,32 @@ static int vidioc_vdec_dqbuf(struct file
> > *file, void *priv,
> >  	return v4l2_m2m_dqbuf(file, ctx->m2m_ctx, buf);
> >  }
> >  
> > +static int mtk_vcodec_dec_get_chip_name(void *priv)
> > +{
> > +	struct mtk_vcodec_ctx *ctx = fh_to_ctx(priv);
> > +	struct device *dev = &ctx->dev->plat_dev->dev;
> > +
> > +	if (of_device_is_compatible(dev->of_node, "mediatek,mt8173-
> > vcodec-dec"))
> > +		return 8173;
> > +	else if (of_device_is_compatible(dev->of_node,
> > "mediatek,mt8183-vcodec-dec"))
> > +		return 8183;
> > +	else if (of_device_is_compatible(dev->of_node,
> > "mediatek,mt8192-vcodec-dec"))
> > +		return 8192;
> > +	else if (of_device_is_compatible(dev->of_node,
> > "mediatek,mt8195-vcodec-dec"))
> > +		return 8195;
> > +	else if (of_device_is_compatible(dev->of_node,
> > "mediatek,mt8186-vcodec-dec"))
> > +		return 8186;
> > +	else
> > +		return 8173;
> > +}
> 
> Nice, but...
> 
> > +
> >  static int vidioc_vdec_querycap(struct file *file, void *priv,
> >  				struct v4l2_capability *cap)
> >  {
> > +	int platform_name = mtk_vcodec_dec_get_chip_name(priv);
> > +
> >  	strscpy(cap->driver, MTK_VCODEC_DEC_NAME, sizeof(cap->driver));
> > -	strscpy(cap->bus_info, MTK_PLATFORM_STR, sizeof(cap-
> > >bus_info));
> > +	snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:mt%d",
> > platform_name);
> 
> ...this will result in identical bus_info values for the decoder and
> encoder
> video devices. The bus_info field is supposed to be unique, and
> that's now
> no longer the case.
> 
> I suggest changing this to:
> 
> 	snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:mt%d-
> dec", platform_name);
> 
> (and '-enc' for the encoder patch).
> 
> Regards,
> 
> 	Hans
> 
> >  	strscpy(cap->card, MTK_PLATFORM_STR, sizeof(cap->card));
> >  
> >  	return 0;


      reply	other threads:[~2022-06-10  1:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-26  9:57 Yunfei Dong
2022-05-26  9:57 ` [PATCH 2/4] media: mediatek: vcodec: Change decoder v4l2 capability value Yunfei Dong
2022-05-26  9:57 ` [PATCH 3/4] media: mediatek: vcodec: Fix encoder v4l2 bus_info not correctly Yunfei Dong
2022-05-26  9:57 ` [PATCH 4/4] media: mediatek: vcodec: Change encoder v4l2 capability value Yunfei Dong
2022-06-09 10:08 ` [PATCH 1/4] media: mediatek: vcodec: Fix decoder v4l2 bus_info not correctly Hans Verkuil
2022-06-10  1:43   ` yunfei.dong [this message]

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=b1b4ff47306af5fc0aecf8d2041ffca4c30717b2.camel@mediatek.com \
    --to=yunfei.dong@mediatek.com \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=acourbot@chromium.org \
    --cc=andrew-ct.chen@mediatek.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=benjamin.gaignard@collabora.com \
    --cc=daniel@ffwll.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=frkoenig@chromium.org \
    --cc=george.sun@mediatek.com \
    --cc=hsinyi@chromium.org \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=irui.wang@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=mchehab@kernel.org \
    --cc=nicolas@ndufresne.ca \
    --cc=robh+dt@kernel.org \
    --cc=stevecho@chromium.org \
    --cc=tfiga@google.com \
    --cc=tiffany.lin@mediatek.com \
    --cc=xiaoyong.lu@mediatek.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®