diff mbox

[01/12] drm/tilcdc: disable console switching during pm operations

Message ID c131a6f082302f7f95f4c3b45e3769725cbd2719.1450202735.git.jsarha@ti.com
State Superseded
Headers show

Commit Message

Jyri Sarha Dec. 15, 2015, 7:03 p.m. UTC
From: Darren Etheridge <detheridge@ti.com>

The default behavior of consoles during power management operations is: On
entry to suspend a new console is allocated and switched to. On resume the
original console is restored.

However this isn't the observed behavior and the original console is not
restored. This commit avoids the problem by disabling the switching of
consoles at suspend/resume. This works because the driver already restores
all necessary hardware context during such pm operations.

Signed-off-by: Darren Etheridge <detheridge@ti.com>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 drivers/gpu/drm/tilcdc/tilcdc_drv.c | 9 +++++++++
 1 file changed, 9 insertions(+)
diff mbox

Patch

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index 4ddb21e..02525b2 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -18,6 +18,7 @@ 
 /* LCDC DRM driver, based on da8xx-fb */
 
 #include <linux/component.h>
+#include <linux/suspend.h>
 
 #include "tilcdc_drv.h"
 #include "tilcdc_regs.h"
@@ -229,6 +230,14 @@  static int tilcdc_load(struct drm_device *dev, unsigned long flags)
 	pm_runtime_enable(dev->dev);
 	pm_runtime_irq_safe(dev->dev);
 
+	/*
+	 * disable creation of new console during suspend.
+	 * this works around a problem where a ctrl-c is needed
+	 * to be entered on the VT to actually get the device
+	 * to continue into the suspend state.
+	 */
+	pm_set_vt_switch(0);
+
 	/* Determine LCD IP Version */
 	pm_runtime_get_sync(dev->dev);
 	switch (tilcdc_read(dev, LCDC_PID_REG)) {