From: Irui Wang <irui.wang@mediatek.com>
To: Hans Verkuil <hverkuil-cisco@xs4all.nl>,
Tzung-Bi Shih <tzungbi@chromium.org>,
Alexandre Courbot <acourbot@chromium.org>,
"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>, Yong Wu <yong.wu@mediatek.com>,
<angelogioacchino.delregno@collabora.com>
Cc: Hsin-Yi Wang <hsinyi@chromium.org>,
Maoguang Meng <maoguang.meng@mediatek.com>,
Longfei Wang <longfei.wang@mediatek.com>,
Yunfei Dong <yunfei.dong@mediatek.com>,
Fritz Koenig <frkoenig@chromium.org>,
Irui Wang <irui.wang@mediatek.com>, <linux-media@vger.kernel.org>,
<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<srv_heupstream@mediatek.com>,
<linux-mediatek@lists.infradead.org>,
<Project_Global_Chrome_Upstream_Group@mediatek.com>
Subject: [PATCH v2, 01/10] media: mtk-vcodec: Use core type to indicate h264 and vp8 enc
Date: Mon, 17 Jan 2022 20:06:06 +0800 [thread overview]
Message-ID: <20220117120615.21687-2-irui.wang@mediatek.com> (raw)
In-Reply-To: <20220117120615.21687-1-irui.wang@mediatek.com>
use core type variables to indicate h264 and vp8 encoder
Signed-off-by: Irui Wang <irui.wang@mediatek.com>
---
.../platform/mtk-vcodec/mtk_vcodec_drv.h | 4 +--
.../platform/mtk-vcodec/mtk_vcodec_enc_drv.c | 30 ++++++++++---------
2 files changed, 18 insertions(+), 16 deletions(-)
diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h b/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h
index cd2939b47790..f78463ff4551 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h
@@ -419,7 +419,7 @@ struct mtk_vcodec_dec_pdata {
* @num_capture_formats: number of entries in capture_formats
* @output_formats: array of supported output formats
* @num_output_formats: number of entries in output_formats
- * @core_id: stand for h264 or vp8 encode index
+ * @core_type: stand for h264 or vp8 encode
*/
struct mtk_vcodec_enc_pdata {
bool uses_ext;
@@ -429,7 +429,7 @@ struct mtk_vcodec_enc_pdata {
size_t num_capture_formats;
const struct mtk_video_fmt *output_formats;
size_t num_output_formats;
- int core_id;
+ int core_type;
};
#define MTK_ENC_CTX_IS_EXT(ctx) ((ctx)->dev->venc_pdata->uses_ext)
diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c
index 3ac6969c54c0..1f950310a3fb 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c
@@ -95,11 +95,13 @@ static irqreturn_t mtk_vcodec_enc_irq_handler(int irq, void *priv)
ctx = dev->curr_ctx;
spin_unlock_irqrestore(&dev->irqlock, flags);
- mtk_v4l2_debug(1, "id=%d coreid:%d", ctx->id, dev->venc_pdata->core_id);
- addr = dev->reg_base[dev->venc_pdata->core_id] +
+ mtk_v4l2_debug(1, "id: %d core type: %d",
+ ctx->id, dev->venc_pdata->core_type);
+
+ addr = dev->reg_base[dev->venc_pdata->core_type] +
MTK_VENC_IRQ_ACK_OFFSET;
- ctx->irq_status = readl(dev->reg_base[dev->venc_pdata->core_id] +
+ ctx->irq_status = readl(dev->reg_base[dev->venc_pdata->core_type] +
(MTK_VENC_IRQ_STATUS_OFFSET));
clean_irq_status(ctx->irq_status, addr);
@@ -266,10 +268,10 @@ static int mtk_vcodec_probe(struct platform_device *pdev)
pm_runtime_enable(&pdev->dev);
- dev->reg_base[dev->venc_pdata->core_id] =
+ dev->reg_base[dev->venc_pdata->core_type] =
devm_platform_ioremap_resource(pdev, 0);
- if (IS_ERR(dev->reg_base[dev->venc_pdata->core_id])) {
- ret = PTR_ERR(dev->reg_base[dev->venc_pdata->core_id]);
+ if (IS_ERR(dev->reg_base[dev->venc_pdata->core_type])) {
+ ret = PTR_ERR(dev->reg_base[dev->venc_pdata->core_type]);
goto err_res;
}
@@ -287,8 +289,8 @@ static int mtk_vcodec_probe(struct platform_device *pdev)
0, pdev->name, dev);
if (ret) {
dev_err(&pdev->dev,
- "Failed to install dev->enc_irq %d (%d) core_id (%d)",
- dev->enc_irq, ret, dev->venc_pdata->core_id);
+ "Failed to install dev->enc_irq %d (%d) core_type (%d)",
+ dev->enc_irq, ret, dev->venc_pdata->core_type);
ret = -EINVAL;
goto err_res;
}
@@ -357,7 +359,7 @@ static int mtk_vcodec_probe(struct platform_device *pdev)
}
mtk_v4l2_debug(0, "encoder %d registered as /dev/video%d",
- dev->venc_pdata->core_id, vfd_enc->num);
+ dev->venc_pdata->core_type, vfd_enc->num);
return 0;
@@ -384,7 +386,7 @@ static const struct mtk_vcodec_enc_pdata mt8173_avc_pdata = {
.num_output_formats = ARRAY_SIZE(mtk_video_formats_output),
.min_bitrate = 64,
.max_bitrate = 60000000,
- .core_id = VENC_SYS,
+ .core_type = VENC_SYS,
};
static const struct mtk_vcodec_enc_pdata mt8173_vp8_pdata = {
@@ -394,7 +396,7 @@ static const struct mtk_vcodec_enc_pdata mt8173_vp8_pdata = {
.num_output_formats = ARRAY_SIZE(mtk_video_formats_output),
.min_bitrate = 64,
.max_bitrate = 9000000,
- .core_id = VENC_LT_SYS,
+ .core_type = VENC_LT_SYS,
};
static const struct mtk_vcodec_enc_pdata mt8183_pdata = {
@@ -405,7 +407,7 @@ static const struct mtk_vcodec_enc_pdata mt8183_pdata = {
.num_output_formats = ARRAY_SIZE(mtk_video_formats_output),
.min_bitrate = 64,
.max_bitrate = 40000000,
- .core_id = VENC_SYS,
+ .core_type = VENC_SYS,
};
static const struct mtk_vcodec_enc_pdata mt8192_pdata = {
@@ -416,7 +418,7 @@ static const struct mtk_vcodec_enc_pdata mt8192_pdata = {
.num_output_formats = ARRAY_SIZE(mtk_video_formats_output),
.min_bitrate = 64,
.max_bitrate = 100000000,
- .core_id = VENC_SYS,
+ .core_type = VENC_SYS,
};
static const struct mtk_vcodec_enc_pdata mt8195_pdata = {
@@ -427,7 +429,7 @@ static const struct mtk_vcodec_enc_pdata mt8195_pdata = {
.num_output_formats = ARRAY_SIZE(mtk_video_formats_output),
.min_bitrate = 64,
.max_bitrate = 100000000,
- .core_id = VENC_SYS,
+ .core_type = VENC_SYS,
};
static const struct of_device_id mtk_vcodec_enc_match[] = {
--
2.18.0
next prev parent reply other threads:[~2022-01-17 12:06 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-17 12:06 [PATCH v2, 00/10] Enable two H264 encoder cores on MT8195 Irui Wang
2022-01-17 12:06 ` Irui Wang [this message]
2022-01-17 12:06 ` [PATCH v2, 02/10] media: mtk-vcodec: export encoder functions Irui Wang
2022-01-17 12:06 ` [PATCH v2, 03/10] dt-bindings: media: mtk-vcodec: Adds encoder cores dt-bindings for mt8195 Irui Wang
2022-01-17 15:35 ` Rob Herring
2022-02-15 11:31 ` Irui Wang
2022-01-19 13:44 ` Rob Herring
2022-02-15 11:31 ` Irui Wang
2022-03-03 14:53 ` AngeloGioacchino Del Regno
2022-03-04 2:12 ` Irui Wang
2022-01-17 12:06 ` [PATCH v2, 04/10] media: mtk-vcodec: Enable venc dual core usage Irui Wang
2022-03-03 14:27 ` AngeloGioacchino Del Regno
2022-03-04 2:12 ` Irui Wang
2022-03-04 9:07 ` AngeloGioacchino Del Regno
2022-03-12 9:03 ` Irui Wang
2022-01-17 12:06 ` [PATCH v2, 05/10] media: mtk-vcodec: mtk-vcodec: Rewrite venc power manage interface Irui Wang
2022-01-17 12:06 ` [PATCH v2, 06/10] media: mtk-vcodec: Add venc power on/off interface Irui Wang
2022-01-17 12:06 ` [PATCH v2, 07/10] media: mtk-vcodec: Rewrite venc clock interface Irui Wang
2022-01-17 12:06 ` [PATCH v2, 08/10] media: mtk-vcodec: Add more extra processing for dual-core mode Irui Wang
2022-01-17 12:06 ` [PATCH v2, 09/10] media: mtk-vcodec: Add dual core mode encode process Irui Wang
2022-01-17 12:06 ` [PATCH v2, 10/10] media: mtk-vcodec: Done encode result to client Irui Wang
2022-02-23 6:06 ` [PATCH v2, 00/10] Enable two H264 encoder cores on MT8195 Irui Wang
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=20220117120615.21687-2-irui.wang@mediatek.com \
--to=irui.wang@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=devicetree@vger.kernel.org \
--cc=frkoenig@chromium.org \
--cc=hsinyi@chromium.org \
--cc=hverkuil-cisco@xs4all.nl \
--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=longfei.wang@mediatek.com \
--cc=maoguang.meng@mediatek.com \
--cc=matthias.bgg@gmail.com \
--cc=mchehab@kernel.org \
--cc=robh+dt@kernel.org \
--cc=srv_heupstream@mediatek.com \
--cc=tfiga@google.com \
--cc=tiffany.lin@mediatek.com \
--cc=tzungbi@chromium.org \
--cc=yong.wu@mediatek.com \
--cc=yunfei.dong@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;
as well as URLs for NNTP newsgroup(s).