From 1543e317f1da31b75942316931e8f491a8920811 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Thu, 04 Jan 2024 10:08:02 +0000
Subject: [PATCH] disable FB

---
 kernel/drivers/gpu/drm/rockchip/rk628/rk628_dsi.c |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/kernel/drivers/gpu/drm/rockchip/rk628/rk628_dsi.c b/kernel/drivers/gpu/drm/rockchip/rk628/rk628_dsi.c
index 296b19a..fc7da77 100644
--- a/kernel/drivers/gpu/drm/rockchip/rk628/rk628_dsi.c
+++ b/kernel/drivers/gpu/drm/rockchip/rk628/rk628_dsi.c
@@ -15,9 +15,8 @@
 #include <linux/reset.h>
 #include <linux/phy/phy.h>
 
-#include <drm/drmP.h>
 #include <drm/drm_atomic_helper.h>
-#include <drm/drm_crtc_helper.h>
+#include <drm/drm_probe_helper.h>
 #include <drm/drm_mipi_dsi.h>
 #include <drm/drm_of.h>
 #include <drm/drm_panel.h>
@@ -638,6 +637,9 @@
 	u32 val;
 	int ret;
 
+	if (!vrefresh)
+		return -EINVAL;
+
 	ret = regmap_read_poll_timeout(dsi->regmap,
 				       dsi->reg_base + DSI_CMD_PKT_STATUS,
 				       val, !(val & GEN_RD_CMD_BUSY),
@@ -863,7 +865,7 @@
 {
 	struct rk628_dsi *dsi = connector_to_dsi(connector);
 
-	return drm_panel_get_modes(dsi->panel);
+	return drm_panel_get_modes(dsi->panel, connector);
 }
 
 static struct drm_connector_helper_funcs rk628_dsi_connector_helper_funcs = {
@@ -1121,7 +1123,7 @@
 		bus_width |= COMBTXPHY_MODULEA_EN;
 	phy_set_bus_width(dsi->phy, bus_width);
 
-	ret = phy_set_mode(dsi->phy, PHY_MODE_VIDEO_MIPI);
+	ret = phy_set_mode(dsi->phy, PHY_MODE_MIPI_DPHY);
 	if (ret) {
 		dev_err(dsi->dev, "failed to set phy mode: %d\n", ret);
 		return;
@@ -1150,8 +1152,8 @@
 }
 
 static void rk628_dsi_bridge_mode_set(struct drm_bridge *bridge,
-				      struct drm_display_mode *mode,
-				      struct drm_display_mode *adj)
+				      const struct drm_display_mode *mode,
+				      const struct drm_display_mode *adj)
 {
 	struct rk628_dsi *dsi = bridge_to_dsi(bridge);
 
@@ -1162,7 +1164,8 @@
 	}
 }
 
-static int rk628_dsi_bridge_attach(struct drm_bridge *bridge)
+static int rk628_dsi_bridge_attach(struct drm_bridge *bridge,
+				   enum drm_bridge_attach_flags flags)
 {
 	struct rk628_dsi *dsi = bridge_to_dsi(bridge);
 	struct drm_connector *connector = &dsi->connector;
@@ -1171,6 +1174,9 @@
 
 	if (!dsi->panel)
 		return -EPROBE_DEFER;
+
+	if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)
+		return 0;
 
 	ret = drm_connector_init(drm, connector, &rk628_dsi_connector_funcs,
 				 DRM_MODE_CONNECTOR_DSI);
@@ -1181,12 +1187,6 @@
 
 	drm_connector_helper_add(connector, &rk628_dsi_connector_helper_funcs);
 	drm_connector_attach_encoder(connector, bridge->encoder);
-
-	ret = drm_panel_attach(dsi->panel, connector);
-	if (ret) {
-		dev_err(dsi->dev, "Failed to attach panel\n");
-		return ret;
-	}
 
 	return 0;
 }

--
Gitblit v1.6.2