mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm: hdlcd: Update PM code to save/restore console.
@ 2017-06-16 13:53 Liviu Dudau
  2017-06-16 16:58 ` Noralf Trønnes
  0 siblings, 1 reply; 10+ messages in thread
From: Liviu Dudau @ 2017-06-16 13:53 UTC (permalink / raw)
  To: Mali DP Maintainers; +Cc: Brian Starkey, David Airlie, DRI devel, LKML

Update the PM code to suspend/resume the fbdev_cma console.

Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
---
 drivers/gpu/drm/arm/hdlcd_drv.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
index d3da87fbd85a..89cd408cde6f 100644
--- a/drivers/gpu/drm/arm/hdlcd_drv.c
+++ b/drivers/gpu/drm/arm/hdlcd_drv.c
@@ -13,6 +13,7 @@
 #include <linux/spinlock.h>
 #include <linux/clk.h>
 #include <linux/component.h>
+#include <linux/console.h>
 #include <linux/list.h>
 #include <linux/of_graph.h>
 #include <linux/of_reserved_mem.h>
@@ -435,9 +436,15 @@ static int __maybe_unused hdlcd_pm_suspend(struct device *dev)
 		return 0;
 
 	drm_kms_helper_poll_disable(drm);
+	console_lock();
+	drm_fbdev_cma_set_suspend(hdlcd->fbdev, 1);
+	console_unlock();
 
 	hdlcd->state = drm_atomic_helper_suspend(drm);
 	if (IS_ERR(hdlcd->state)) {
+		console_lock();
+		drm_fbdev_cma_set_suspend(hdlcd->fbdev, 0);
+		console_unlock();
 		drm_kms_helper_poll_enable(drm);
 		return PTR_ERR(hdlcd->state);
 	}
@@ -454,8 +461,10 @@ static int __maybe_unused hdlcd_pm_resume(struct device *dev)
 		return 0;
 
 	drm_atomic_helper_resume(drm, hdlcd->state);
+	console_lock();
+	drm_fbdev_cma_set_suspend(hdlcd->fbdev, 0);
+	console_unlock();
 	drm_kms_helper_poll_enable(drm);
-	pm_runtime_set_active(dev);
 
 	return 0;
 }
-- 
2.13.1

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

end of thread, other threads:[~2017-06-20 14:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-16 13:53 [PATCH] drm: hdlcd: Update PM code to save/restore console Liviu Dudau
2017-06-16 16:58 ` Noralf Trønnes
2017-06-19 13:17   ` Liviu Dudau
2017-06-19 15:45     ` Noralf Trønnes
2017-06-20  9:37       ` Daniel Vetter
2017-06-20 10:23         ` [PATCH] drm: Convert CMA fbdev console suspend helpers to use bool Liviu Dudau
2017-06-20 14:23           ` Daniel Vetter
2017-06-19 13:53   ` [PATCH v2] drm: hdlcd: Update PM code to save/restore console Liviu Dudau
2017-06-19 15:47     ` Noralf Trønnes
2017-06-19 16:16       ` Liviu Dudau

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®