[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230823082549.24756-1-shuijing.li@mediatek.com>
Date: Wed, 23 Aug 2023 16:25:49 +0800
From: Shuijing Li <shuijing.li@...iatek.com>
To: <chunkuang.hu@...nel.org>, <p.zabel@...gutronix.de>,
<airlied@...il.com>, <daniel@...ll.ch>, <matthias.bgg@...il.com>,
<angelogioacchino.delregno@...labora.com>
CC: <dri-devel@...ts.freedesktop.org>,
<linux-mediatek@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<Project_Global_Chrome_Upstream_Group@...iatek.com>,
<jitao.shi@...iatek.com>, Shuijing Li <shuijing.li@...iatek.com>
Subject: [PATCH] drm/mediatek: Support IGT in dp driver
Support IGT (Intel GPU Tools) in Mediatek DisplayPort driver
Signed-off-by: Shuijing Li <shuijing.li@...iatek.com>
---
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,
};
--
2.40.1
Powered by blists - more mailing lists