From patchwork Mon Jun 19 13:53:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Liviu Dudau X-Patchwork-Id: 105836 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp886217qgd; Mon, 19 Jun 2017 06:53:50 -0700 (PDT) X-Received: by 10.84.210.106 with SMTP id z97mr30156789plh.6.1497880430696; Mon, 19 Jun 2017 06:53:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497880430; cv=none; d=google.com; s=arc-20160816; b=ZSbfaokYAAa1sIouRVr2QRCsB37t9MCV4RhtpuKNpmHCtm/qMQOR0CYrrf6qO+VlWK hBZTVeL6nJc5tF4o9DkH6CSpVwG8+WElhimgsYTRMTSSijUDarbVXNAUmlP9jgfxdOr1 2ZxE7E7+D50wnrz8DEsqQ4/byCOBFw+h9yf3N0GmsHNCfc/dkh/BoHF+Muq8FPfHpGkO u4dg+oU7la56Xl2qLFwLjlAXhxas67pznry8f9nvTZDI0DJtMrDDGOSOsIG5VpnBj5On ru1VuiLC0WPHj3O9p6FkawuXT8Yh6BfM87OjvmAcVUvGuuFfXdPSxO0TfeHtv7mKu580 zmZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:cc :mime-version:references:in-reply-to:message-id:date:subject:to:from :delivered-to:arc-authentication-results; bh=+HaFvb+u/iftq9RNXcqINRuokyk071J5H+3MDspc0o8=; b=V82zKprPEcTVov6O3irO2/j/01DgsjR43KMuR2fSpN4PkJKzFjdrhqlMQcruZxUVPq 4zip/e4zVGYiwjH4eeU5GBQ+mI64rc5pmbwPXEvVxPv6k1YRhtmACDkOOYI4sLYEG6Qf 5MbnClFugNfArwN6+TF+nFb8bwEszD00sEzedjl0PxrTwLuY19n+q2h1GDbwA6wsKSpe 4YiCOMfR6RdsvG1PprmZTmF4KV0aY7OUDt9nR4eKZ1yvI8aEQlSQCKNLTiysSOUnoC0p xB3+Dg2PXWy6qfJquPhZNhTpvkLOA3Pu9R0DNh2cHM9rNFcTC7W8Jxc4EYd6yD13WXFs FKUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id g2si9225717plk.487.2017.06.19.06.53.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Jun 2017 06:53:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F1F7A6E1A9; Mon, 19 Jun 2017 13:53:47 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from cam-smtp0.cambridge.arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6BD796E1A9 for ; Mon, 19 Jun 2017 13:53:46 +0000 (UTC) Received: from e110455-lin.cambridge.arm.com (e110455-lin.cambridge.arm.com [10.2.131.9]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id v5JDrf0u027336; Mon, 19 Jun 2017 14:53:41 +0100 From: Liviu Dudau To: Mali DP Maintainers 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 Cc: DRI devel , LKML X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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; }