From: Moudy Ho <moudy.ho@mediatek.com>
To: Mauro Carvalho Chehab <mchehab@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Chun-Kuang Hu <chunkuang.hu@kernel.org>,
<linux-media@vger.kernel.org>,
<linux-mediatek@lists.infradead.org>,
<linux-kernel@vger.kernel.org>,
<Project_Global_Chrome_Upstream_Group@mediatek.com>,
Moudy Ho <moudy.ho@mediatek.com>
Subject: [PATCH v1 5/6] media: platform: mtk-mdp3: chip config split about resolution limitations
Date: Fri, 7 Oct 2022 11:17:36 +0800 [thread overview]
Message-ID: <20221007031737.5125-6-moudy.ho@mediatek.com> (raw)
In-Reply-To: <20221007031737.5125-1-moudy.ho@mediatek.com>
Due to differences in hardware design, the supported max and min
resolutions and scaling capabilities will vary, and should be
moved and integrated into the chip configuration header file.
Signed-off-by: Moudy Ho <moudy.ho@mediatek.com>
---
.../media/platform/mediatek/mdp3/mt8183_mdp.h | 19 +++++++++++++++++
.../platform/mediatek/mdp3/mtk-mdp3-core.c | 1 +
.../platform/mediatek/mdp3/mtk-mdp3-core.h | 1 +
.../platform/mediatek/mdp3/mtk-mdp3-regs.c | 21 +------------------
4 files changed, 22 insertions(+), 20 deletions(-)
diff --git a/drivers/media/platform/mediatek/mdp3/mt8183_mdp.h b/drivers/media/platform/mediatek/mdp3/mt8183_mdp.h
index 9679af0aab25..4459b6b3937b 100644
--- a/drivers/media/platform/mediatek/mdp3/mt8183_mdp.h
+++ b/drivers/media/platform/mediatek/mdp3/mt8183_mdp.h
@@ -380,4 +380,23 @@ static const struct mdp_format mt8183_formats[] = {
}
};
+static const struct mdp_limit mt8183_mdp_def_limit = {
+ .out_limit = {
+ .wmin = 16,
+ .hmin = 16,
+ .wmax = 8176,
+ .hmax = 8176,
+ },
+ .cap_limit = {
+ .wmin = 2,
+ .hmin = 2,
+ .wmax = 8176,
+ .hmax = 8176,
+ },
+ .h_scale_up_max = 32,
+ .v_scale_up_max = 32,
+ .h_scale_down_max = 20,
+ .v_scale_down_max = 128,
+};
+
#endif // __MT8183_MDP_H__
diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c
index 3e865e3cf64f..58e6fa23ef0c 100644
--- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c
+++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c
@@ -26,6 +26,7 @@ static const struct mtk_mdp_driver_data mt8183_mdp_driver_data = {
.comp_data_len = ARRAY_SIZE(mt8183_mdp_comp_data),
.format = mt8183_formats,
.format_len = ARRAY_SIZE(mt8183_formats),
+ .def_limit = &mt8183_mdp_def_limit,
};
static const struct of_device_id mdp_of_ids[] = {
diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h
index 982438a9ab02..52f87e59ba9e 100644
--- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h
+++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h
@@ -59,6 +59,7 @@ struct mtk_mdp_driver_data {
unsigned int comp_data_len;
const struct mdp_format *format;
unsigned int format_len;
+ const struct mdp_limit *def_limit;
};
struct mdp_dev {
diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-regs.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-regs.c
index cd6afbf53797..bb833ae27531 100644
--- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-regs.c
+++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-regs.c
@@ -11,25 +11,6 @@
#include "mtk-mdp3-regs.h"
#include "mtk-mdp3-m2m.h"
-static const struct mdp_limit mdp_def_limit = {
- .out_limit = {
- .wmin = 16,
- .hmin = 16,
- .wmax = 8176,
- .hmax = 8176,
- },
- .cap_limit = {
- .wmin = 2,
- .hmin = 2,
- .wmax = 8176,
- .hmax = 8176,
- },
- .h_scale_up_max = 32,
- .v_scale_up_max = 32,
- .h_scale_down_max = 20,
- .v_scale_down_max = 128,
-};
-
static const struct mdp_format *mdp_find_fmt(const struct mtk_mdp_driver_data *mdp_data,
u32 pixelformat, u32 type)
{
@@ -485,7 +466,7 @@ int mdp_frameparam_init(struct mdp_dev *mdp, struct mdp_frameparam *param)
return -EINVAL;
INIT_LIST_HEAD(¶m->list);
- param->limit = &mdp_def_limit;
+ param->limit = mdp->mdp_data->def_limit;
param->type = MDP_STREAM_TYPE_BITBLT;
frame = ¶m->output;
--
2.18.0
next prev parent reply other threads:[~2022-10-07 3:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-07 3:17 [PATCH v1 0/6] Add support for multiple chips Moudy Ho
2022-10-07 3:17 ` [PATCH v1 1/6] media: platform: mtk-mdp3: add chip configuration header file Moudy Ho
2022-10-07 9:07 ` AngeloGioacchino Del Regno
2022-10-11 2:02 ` moudy ho
2022-10-07 3:17 ` [PATCH v1 2/6] media: platform: mtk-mdp3: chip config split about component settings Moudy Ho
2022-10-07 3:17 ` [PATCH v1 3/6] media: platform: mtk-mdp3: chip config split about subcomponents Moudy Ho
2022-10-07 3:17 ` [PATCH v1 4/6] media: platform: mtk-mdp3: chip config split about color format Moudy Ho
2022-10-07 3:17 ` Moudy Ho [this message]
2022-10-07 3:17 ` [PATCH v1 6/6] media: platform: mtk-mdp3: chip config split about pipe info Moudy Ho
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=20221007031737.5125-6-moudy.ho@mediatek.com \
--to=moudy.ho@mediatek.com \
--cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
--cc=chunkuang.hu@kernel.org \
--cc=hverkuil-cisco@xs4all.nl \
--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 \
/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).