Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753951AbdFPNxl (ORCPT ); Fri, 16 Jun 2017 09:53:41 -0400 Received: from fw-tnat.cambridge.arm.com ([217.140.96.140]:52422 "EHLO cam-smtp0.cambridge.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752464AbdFPNxj (ORCPT ); Fri, 16 Jun 2017 09:53:39 -0400 From: Liviu Dudau To: Mali DP Maintainers Cc: Brian Starkey , David Airlie , DRI devel , LKML Subject: [PATCH] drm: hdlcd: Update PM code to save/restore console. Date: Fri, 16 Jun 2017 14:53:33 +0100 Message-Id: <20170616135333.27796-1-Liviu.Dudau@arm.com> X-Mailer: git-send-email 2.13.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1410 Lines: 49 Update the PM code to suspend/resume the fbdev_cma console. Signed-off-by: Liviu Dudau --- 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 #include #include +#include #include #include #include @@ -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