summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJyri Sarha <jsarha@ti.com>2016-06-14 08:43:30 (GMT)
committerJyri Sarha <jsarha@ti.com>2016-08-08 20:04:48 (GMT)
commit8fe5616b20e5742bb5fee0e77dffe2fc76ac92a0 (patch)
tree2d844f549f05617227929e765d590625787637cf
parent5c6c201ccbaf9d3901f829441d457293f7ca8ef4 (diff)
downloadlinux-8fe5616b20e5742bb5fee0e77dffe2fc76ac92a0.tar.xz
drm/tilcdc: Restore old dpms state in pm_resume()
Restore old dpms state in pm_resume(). The dpms is turned off in pm_suspend() and it should be restored to its original state in pm_resume(). Without this patch the display is left blanked after a suspend/resume cycle. Fixes commit 614b3cfeb8d2 ("drm/tilcdc: disable the lcd controller/dma engine when suspend invoked") Signed-off-by: Jyri Sarha <jsarha@ti.com>
-rw-r--r--drivers/gpu/drm/tilcdc/tilcdc_crtc.c7
-rw-r--r--drivers/gpu/drm/tilcdc/tilcdc_drv.c3
-rw-r--r--drivers/gpu/drm/tilcdc/tilcdc_drv.h2
3 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
index 107c8bd..1601428 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
@@ -246,6 +246,13 @@ void tilcdc_crtc_dpms(struct drm_crtc *crtc, int mode)
}
}
+int tilcdc_crtc_current_dpms_state(struct drm_crtc *crtc)
+{
+ struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc);
+
+ return tilcdc_crtc->dpms;
+}
+
static bool tilcdc_crtc_mode_fixup(struct drm_crtc *crtc,
const struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index d278093..ed68324 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -597,6 +597,7 @@ static int tilcdc_pm_suspend(struct device *dev)
}
/* Disable the LCDC controller, to avoid locking up the PRCM */
+ priv->saved_dpms_state = tilcdc_crtc_current_dpms_state(priv->crtc);
tilcdc_crtc_dpms(priv->crtc, DRM_MODE_DPMS_OFF);
/* Save register state: */
@@ -627,6 +628,8 @@ static int tilcdc_pm_resume(struct device *dev)
priv->saved_register[n++]);
}
+ tilcdc_crtc_dpms(priv->crtc, priv->saved_dpms_state);
+
drm_kms_helper_poll_enable(ddev);
return 0;
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.h b/drivers/gpu/drm/tilcdc/tilcdc_drv.h
index c1de18b..3b52ce8 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.h
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.h
@@ -67,6 +67,7 @@ struct tilcdc_drm_private {
/* register contents saved across suspend/resume: */
u32 *saved_register;
+ int saved_dpms_state;
bool ctx_valid;
#ifdef CONFIG_CPU_FREQ
@@ -172,5 +173,6 @@ void tilcdc_crtc_set_simulate_vesa_sync(struct drm_crtc *crtc,
int tilcdc_crtc_mode_valid(struct drm_crtc *crtc, struct drm_display_mode *mode);
int tilcdc_crtc_max_width(struct drm_crtc *crtc);
void tilcdc_crtc_dpms(struct drm_crtc *crtc, int mode);
+int tilcdc_crtc_current_dpms_state(struct drm_crtc *crtc);
#endif /* __TILCDC_DRV_H__ */