mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/mediatek: Support IGT in dp driver
@ 2023-08-23  8:25 Shuijing Li
  2023-08-23  8:34 ` Chen-Yu Tsai
  0 siblings, 1 reply; 2+ messages in thread
From: Shuijing Li @ 2023-08-23  8:25 UTC (permalink / raw)
  To: chunkuang.hu, p.zabel, airlied, daniel, matthias.bgg,
	angelogioacchino.delregno
  Cc: dri-devel, linux-mediatek, linux-kernel, linux-arm-kernel,
	Project_Global_Chrome_Upstream_Group, jitao.shi, Shuijing Li

Support IGT (Intel GPU Tools) in Mediatek DisplayPort driver

Signed-off-by: Shuijing Li <shuijing.li@mediatek.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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/mediatek: Support IGT in dp driver
  2023-08-23  8:25 [PATCH] drm/mediatek: Support IGT in dp driver Shuijing Li
@ 2023-08-23  8:34 ` Chen-Yu Tsai
  0 siblings, 0 replies; 2+ messages in thread
From: Chen-Yu Tsai @ 2023-08-23  8:34 UTC (permalink / raw)
  To: Shuijing Li
  Cc: chunkuang.hu, p.zabel, airlied, daniel, matthias.bgg,
	angelogioacchino.delregno, jitao.shi, linux-kernel, dri-devel,
	Project_Global_Chrome_Upstream_Group, linux-mediatek,
	linux-arm-kernel

On Wed, Aug 23, 2023 at 4:25 PM Shuijing Li <shuijing.li@mediatek.com> wrote:
>
> Support IGT (Intel GPU Tools) in Mediatek DisplayPort driver

The commit message makes little sense.

First of all, you are changing the DSI driver, not the DisplayPort driver.

Second, the subject should say what was changed. In this case it would be
something like "Add mode_valid callback to DSI bridge". "Support IGT" is
*why* the change was done, should only be mentioned in the commit message
body, and you could be more specific about which test in IGT needs it.

ChenYu

> Signed-off-by: Shuijing Li <shuijing.li@mediatek.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
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-23  8:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-23  8:25 [PATCH] drm/mediatek: Support IGT in dp driver Shuijing Li
2023-08-23  8:34 ` Chen-Yu Tsai

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®