[PATCH 30/32] drm/mcde: store a pointer to mipi_dsi_host to perform TE requests

Luca Ceresoli luca.ceresoli at bootlin.com
Wed Jun 25 16:45:34 UTC 2025


The MCDE driver stores a struct mipi_dsi_device pointer in struct mcde for
two uses: sending commands via mcde_dsi_te_request() and accessing the DSI
bus format parameters (lanes, channel etc).

We want to get rid of mipi_dsi_device pointers in host drivers. This patch
removes the first usage by additionally storing a pointer to the struct
mipi_dsi_host, and using it in host_to_mcde_dsi().

The second usage is removed in a following patch.

Signed-off-by: Luca Ceresoli <luca.ceresoli at bootlin.com>
---
 drivers/gpu/drm/mcde/mcde_display.c | 2 +-
 drivers/gpu/drm/mcde/mcde_drm.h     | 3 ++-
 drivers/gpu/drm/mcde/mcde_dsi.c     | 9 ++++++---
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/mcde/mcde_display.c b/drivers/gpu/drm/mcde/mcde_display.c
index 52043a12a2e8e5ae2f0d6d279b2314ba31c98b5b..18b8ed1456d436dc8e7b7778461d76a251509ecf 100644
--- a/drivers/gpu/drm/mcde/mcde_display.c
+++ b/drivers/gpu/drm/mcde/mcde_display.c
@@ -1339,7 +1339,7 @@ static void mcde_start_flow(struct mcde *mcde)
 {
 	/* Request a TE ACK only in TE+BTA mode */
 	if (mcde->flow_mode == MCDE_COMMAND_BTA_TE_FLOW)
-		mcde_dsi_te_request(mcde->mdsi);
+		mcde_dsi_te_request(mcde);
 
 	/* Enable FIFO A flow */
 	mcde_enable_fifo(mcde, MCDE_FIFO_A);
diff --git a/drivers/gpu/drm/mcde/mcde_drm.h b/drivers/gpu/drm/mcde/mcde_drm.h
index ecb70b4b737c0e74b93c6f3e81f1170774303f78..4ae32e92d7f36707dfd91adb2cc9c76ec32a677e 100644
--- a/drivers/gpu/drm/mcde/mcde_drm.h
+++ b/drivers/gpu/drm/mcde/mcde_drm.h
@@ -73,6 +73,7 @@ struct mcde {
 	struct drm_bridge *bridge;
 	struct drm_connector *connector;
 	struct drm_simple_display_pipe pipe;
+	struct mipi_dsi_host *dsi_host;
 	struct mipi_dsi_device *mdsi;
 	bool dpi_output;
 	s16 stride;
@@ -104,7 +105,7 @@ static inline bool mcde_flow_is_video(struct mcde *mcde)
 }
 
 bool mcde_dsi_irq(struct mipi_dsi_device *mdsi);
-void mcde_dsi_te_request(struct mipi_dsi_device *mdsi);
+void mcde_dsi_te_request(struct mcde *mcde);
 void mcde_dsi_enable(struct drm_bridge *bridge);
 void mcde_dsi_disable(struct drm_bridge *bridge);
 extern struct platform_driver mcde_dsi_driver;
diff --git a/drivers/gpu/drm/mcde/mcde_dsi.c b/drivers/gpu/drm/mcde/mcde_dsi.c
index 04041ad9231bd53cf4bfa18ad41caa19df3b838a..2df2fdf45bd7d6259c631f1c402191db49336cd0 100644
--- a/drivers/gpu/drm/mcde/mcde_dsi.c
+++ b/drivers/gpu/drm/mcde/mcde_dsi.c
@@ -148,6 +148,7 @@ bool mcde_dsi_irq(struct mipi_dsi_device *mdsi)
 static void mcde_dsi_attach_to_mcde(struct mcde_dsi *d)
 {
 	d->mcde->mdsi = d->mdsi;
+	d->mcde->dsi_host = &d->dsi_host;
 
 	/*
 	 * Select the way the DSI data flow is pushing to the display:
@@ -190,8 +191,10 @@ static int mcde_dsi_host_detach(struct mipi_dsi_host *host,
 	struct mcde_dsi *d = host_to_mcde_dsi(host);
 
 	d->mdsi = NULL;
-	if (d->mcde)
+	if (d->mcde) {
 		d->mcde->mdsi = NULL;
+		d->mcde->dsi_host = NULL;
+	}
 
 	return 0;
 }
@@ -381,12 +384,12 @@ static const struct mipi_dsi_host_ops mcde_dsi_host_ops = {
 };
 
 /* This sends a direct (short) command to request TE */
-void mcde_dsi_te_request(struct mipi_dsi_device *mdsi)
+void mcde_dsi_te_request(struct mcde *mcde)
 {
 	struct mcde_dsi *d;
 	u32 val;
 
-	d = host_to_mcde_dsi(mdsi->host);
+	d = host_to_mcde_dsi(mcde->dsi_host);
 
 	/* Command "nature" TE request */
 	val = DSI_DIRECT_CMD_MAIN_SETTINGS_CMD_NAT_TE_REQ;

-- 
2.49.0



More information about the dri-devel mailing list