[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220701105237.932332-5-wenst@chromium.org>
Date: Fri, 1 Jul 2022 18:52:35 +0800
From: Chen-Yu Tsai <wenst@...omium.org>
To: Tiffany Lin <tiffany.lin@...iatek.com>,
Andrew-CT Chen <andrew-ct.chen@...iatek.com>,
Yunfei Dong <yunfei.dong@...iatek.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Hans Verkuil <hverkuil-cisco@...all.nl>
Cc: AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>,
Nicolas Dufresne <nicolas.dufresne@...labora.com>,
Chen-Yu Tsai <wenst@...omium.org>, linux-media@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-mediatek@...ts.infradead.org,
Matthias Brugger <matthias.bgg@...il.com>
Subject: [PATCH 4/6] media: mediatek: vcodec: Revert driver name change in encoder capabilities
This partially reverts commit fd9f8050e355d7fd1e126cd207b06c96cde7f783.
The driver name field should contain the actual driver name, not some
otherwise unused string macro from the driver. To make this clear,
copy the name from the driver's name field.
Fixes: fd9f8050e355 ("media: mediatek: vcodec: Change encoder v4l2 capability value")
Signed-off-by: Chen-Yu Tsai <wenst@...omium.org>
---
drivers/media/platform/mediatek/vcodec/mtk_vcodec_drv.h | 1 +
drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c | 6 ++++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_drv.h b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_drv.h
index 4140b4dd85bf..dc6aada882d9 100644
--- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_drv.h
+++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_drv.h
@@ -22,6 +22,7 @@
#define MTK_VCODEC_DRV_NAME "mtk_vcodec_drv"
#define MTK_VCODEC_DEC_NAME "mtk-vcodec-dec"
#define MTK_VCODEC_ENC_NAME "mtk-vcodec-enc"
+#define MTK_PLATFORM_STR "platform:mt8173"
#define MTK_VCODEC_MAX_PLANES 3
#define MTK_V4L2_BENCHMARK 0
diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c
index ccc753074816..30aac54d97fa 100644
--- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c
+++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c
@@ -232,11 +232,13 @@ static int mtk_vcodec_enc_get_chip_name(void *priv)
static int vidioc_venc_querycap(struct file *file, void *priv,
struct v4l2_capability *cap)
{
+ struct mtk_vcodec_ctx *ctx = fh_to_ctx(priv);
+ struct device *dev = &ctx->dev->plat_dev->dev;
int platform_name = mtk_vcodec_enc_get_chip_name(priv);
- strscpy(cap->driver, MTK_VCODEC_DRV_NAME, sizeof(cap->driver));
- strscpy(cap->card, MTK_VCODEC_ENC_NAME, sizeof(cap->card));
+ strscpy(cap->driver, dev->driver->name, sizeof(cap->driver));
snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:mt%d-enc", platform_name);
+ strscpy(cap->card, MTK_PLATFORM_STR, sizeof(cap->card));
return 0;
}
--
2.37.0.rc0.161.g10f37bed90-goog
Powered by blists - more mailing lists