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

Message ID c7774d3c091ddc47e97f46d4d0e15cb349bda402.1454577570.git.jsarha@ti.com
State New
Headers show

Commit Message

Jyri Sarha Feb. 4, 2016, 9:30 a.m.
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 --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index d7f5b89..90ed233 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)
+	/*
+	 * 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 */
 	switch (tilcdc_read(dev, LCDC_PID_REG)) {