From: "CK Hu (胡俊光)" <ck.hu@mediatek.com>
To: "p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
"airlied@gmail.com" <airlied@gmail.com>,
"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
"daniel@ffwll.ch" <daniel@ffwll.ch>,
"chunkuang.hu@kernel.org" <chunkuang.hu@kernel.org>,
"angelogioacchino.delregno@collabora.com"
<angelogioacchino.delregno@collabora.com>,
"Shuijing Li (李水静)" <Shuijing.Li@mediatek.com>
Cc: "dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"Jitao Shi (石记涛)" <jitao.shi@mediatek.com>,
Project_Global_Chrome_Upstream_Group
<Project_Global_Chrome_Upstream_Group@mediatek.com>
Subject: Re: [PATCH v2] drm/mediatek: dsi: Add mode_valid callback to DSI bridge
Date: Wed, 27 Sep 2023 10:05:15 +0000 [thread overview]
Message-ID: <a119d3e94cff5530ce00c3c5f72fc4fdb3e46ac5.camel@mediatek.com> (raw)
In-Reply-To: <20230823092047.32258-1-shuijing.li@mediatek.com>
Hi, Shuijing:
On Wed, 2023-08-23 at 17:20 +0800, Shuijing Li wrote:
> Support IGT (Intel GPU Tools) in Mediatek DSI driver.
> According to the description of MIPI Alliance Specification for D-
> PHY
> Version 1.1, the maximum supported data rate is 1.5Gbps, so add
> mode_valid
> callback to dsi bridge to filter out the data rate exceeding the
> Specification.
Reviewed-by: CK Hu <ck.hu@mediatek.com>
>
> Signed-off-by: Shuijing Li <shuijing.li@mediatek.com>
> ---
> Changes in v2:
> Correct descriptions of title and commit message.
> ---
> drivers/gpu/drm/mediatek/mtk_dsi.c | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c
> b/drivers/gpu/drm/mediatek/mtk_dsi.c
> index 7d5250351193..a494e04f0ddf 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dsi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
> @@ -806,6 +806,25 @@ static void
> mtk_dsi_bridge_atomic_post_disable(struct drm_bridge *bridge,
> mtk_dsi_poweroff(dsi);
> }
>
> +static enum drm_mode_status
> +mtk_dsi_bridge_mode_valid(struct drm_bridge *bridge,
> + const struct drm_display_info *info,
> + const struct drm_display_mode *mode)
> +{
> + struct mtk_dsi *dsi = bridge_to_dsi(bridge);
> + u32 bpp;
> +
> + if (dsi->format == MIPI_DSI_FMT_RGB565)
> + bpp = 16;
> + else
> + bpp = 24;
> +
> + if (mode->clock * bpp / dsi->lanes > 1500000)
> + return MODE_CLOCK_HIGH;
> +
> + return MODE_OK;
> +}
> +
> static const struct drm_bridge_funcs mtk_dsi_bridge_funcs = {
> .attach = mtk_dsi_bridge_attach,
> .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
> @@ -815,6 +834,7 @@ static const struct drm_bridge_funcs
> mtk_dsi_bridge_funcs = {
> .atomic_pre_enable = mtk_dsi_bridge_atomic_pre_enable,
> .atomic_post_disable = mtk_dsi_bridge_atomic_post_disable,
> .atomic_reset = drm_atomic_helper_bridge_reset,
> + .mode_valid = mtk_dsi_bridge_mode_valid,
> .mode_set = mtk_dsi_bridge_mode_set,
> };
>
prev parent reply other threads:[~2023-09-27 10:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-23 9:20 Shuijing Li
2023-09-12 6:57 ` Shuijing Li (李水静)
2023-09-27 10:05 ` CK Hu (胡俊光) [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=a119d3e94cff5530ce00c3c5f72fc4fdb3e46ac5.camel@mediatek.com \
--to=ck.hu@mediatek.com \
--cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
--cc=Shuijing.Li@mediatek.com \
--cc=airlied@gmail.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=chunkuang.hu@kernel.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=jitao.shi@mediatek.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=p.zabel@pengutronix.de \
/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®