Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751265AbdFSNxu (ORCPT ); Mon, 19 Jun 2017 09:53:50 -0400 Received: from fw-tnat.cambridge.arm.com ([217.140.96.140]:53397 "EHLO cam-smtp0.cambridge.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750757AbdFSNxs (ORCPT ); Mon, 19 Jun 2017 09:53:48 -0400 From: Liviu Dudau To: Mali DP Maintainers Cc: Brian Starkey , David Airlie , DRI devel , LKML Subject: [PATCH v2] drm: hdlcd: Update PM code to save/restore console. Date: Mon, 19 Jun 2017 14:53:41 +0100 Message-Id: <20170619135341.4357-1-Liviu.Dudau@arm.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1572 Lines: 51 Update the PM code to suspend/resume the fbdev_cma console. Changelog: - v2: Use drm_fbdev_cma_set_suspend_unlocked() function for taking the console lock (suggested by Noralf Trønnes ) - v1: Initial submission [1] [1] https://lists.freedesktop.org/archives/dri-devel/2017-June/144502.html Signed-off-by: Liviu Dudau --- drivers/gpu/drm/arm/hdlcd_drv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c index d3da87fbd85a..11ecda211f7f 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,11 @@ static int __maybe_unused hdlcd_pm_suspend(struct device *dev) return 0; drm_kms_helper_poll_disable(drm); + drm_fbdev_cma_set_suspend_unlocked(hdlcd->fbdev, 1); hdlcd->state = drm_atomic_helper_suspend(drm); if (IS_ERR(hdlcd->state)) { + drm_fbdev_cma_set_suspend_unlocked(hdlcd->fbdev, 0); drm_kms_helper_poll_enable(drm); return PTR_ERR(hdlcd->state); } @@ -454,8 +457,8 @@ static int __maybe_unused hdlcd_pm_resume(struct device *dev) return 0; drm_atomic_helper_resume(drm, hdlcd->state); + drm_fbdev_cma_set_suspend_unlocked(hdlcd->fbdev, 0); drm_kms_helper_poll_enable(drm); - pm_runtime_set_active(dev); return 0; } -- 2.13.1