dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] drm/imx: disable outputs in lastclose when framebuffer emulation is disabled
@ 2016-06-17 10:13 Lucas Stach
  2016-06-17 10:13 ` [PATCH 2/5] drm/imx: imx-ldb: check return code on panel attach Lucas Stach
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Lucas Stach @ 2016-06-17 10:13 UTC (permalink / raw)
  To: Philipp Zabel; +Cc: kernel, dri-devel, patchwork-lst

If there is no framebuffer mode that can be restored, all outputs should
be disabled in order to avoid information leaks.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 drivers/gpu/drm/imx/imx-drm-core.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c
index 82656654fb21..c63378661e11 100644
--- a/drivers/gpu/drm/imx/imx-drm-core.c
+++ b/drivers/gpu/drm/imx/imx-drm-core.c
@@ -63,7 +63,19 @@ static void imx_drm_driver_lastclose(struct drm_device *drm)
 {
 	struct imx_drm_device *imxdrm = drm->dev_private;
 
-	drm_fbdev_cma_restore_mode(imxdrm->fbhelper);
+	if (imxdrm->fbhelper) {
+		drm_fbdev_cma_restore_mode(imxdrm->fbhelper);
+	} else {
+		struct drm_connector *connector;
+
+		/* no kernel mode to go back to, disable all outputs */
+		drm_modeset_lock_all(drm);
+		drm_for_each_connector(connector, drm)
+			connector->encoder = NULL;
+		drm_modeset_unlock_all(drm);
+
+		drm_helper_disable_unused_functions(drm);
+	}
 }
 
 static int imx_drm_driver_unload(struct drm_device *drm)
-- 
2.8.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2016-07-11 10:25 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-17 10:13 [PATCH 1/5] drm/imx: disable outputs in lastclose when framebuffer emulation is disabled Lucas Stach
2016-06-17 10:13 ` [PATCH 2/5] drm/imx: imx-ldb: check return code on panel attach Lucas Stach
2016-07-11 10:25   ` Philipp Zabel
2016-06-17 10:13 ` [PATCH 3/5] drm/imx: imx-ldb: detach panel on unbind Lucas Stach
2016-06-20 12:03   ` Philipp Zabel
2016-06-17 10:13 ` [PATCH 4/5] drm/imx: drop deprecated load/unload drm_driver ops Lucas Stach
2016-06-17 12:48   ` Daniel Vetter
2016-06-24  7:46     ` Ying Liu
2016-06-17 10:13 ` [PATCH 5/5] drm/imx: don't destroy mode objects manually on driver unbind Lucas Stach
2016-06-20 12:00   ` Philipp Zabel
2016-06-17 12:45 ` [PATCH 1/5] drm/imx: disable outputs in lastclose when framebuffer emulation is disabled Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox