alarm-tegra-x1 / patches/kernel-display-hotplug.patch

raw file 1303 bytes
diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c
index 7f25c5062..e57639e36 100644
--- a/drivers/gpu/drm/tegra/dsi.c
+++ b/drivers/gpu/drm/tegra/dsi.c
@@ -1502,8 +1502,27 @@ static int tegra_dsi_host_attach(struct mipi_dsi_host *host,
 		if (IS_ERR(output->panel))
 			output->panel = NULL;
 
+		/*
+		 * ALARM: notify the DRM clients directly.
+		 *
+		 * drm_helper_hpd_irq_event() was used here, but it skips any
+		 * connector without DRM_CONNECTOR_POLL_HPD:
+		 *
+		 *     if (!(connector->polled & DRM_CONNECTOR_POLL_HPD))
+		 *             continue;
+		 *
+		 * The DSI connector is not HPD-polled, so the call was a no-op.
+		 * That mattered because tegra_drm_probe() runs drm_client_setup()
+		 * *before* this attach, when no connector is connected yet -- so
+		 * the fbdev client defers, and the deferred retry only happens on
+		 * a hotplug that never came. Result: a working DSI connector and
+		 * no /dev/fb0, hence no console on the panel.
+		 *
+		 * Calling this directly reaches drm_client_dev_hotplug(), which
+		 * retries the deferred fbdev setup and gives us fb0.
+		 */
 		if (output->panel && output->connector.dev)
-			drm_helper_hpd_irq_event(output->connector.dev);
+			drm_kms_helper_connector_hotplug_event(&output->connector);
 	}
 
 	return 0;