From patchwork Fri Jun 16 13:53:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liviu Dudau X-Patchwork-Id: 105744 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp1315470qgd; Fri, 16 Jun 2017 06:53:41 -0700 (PDT) X-Received: by 10.84.237.2 with SMTP id s2mr12853648plk.176.1497621221863; Fri, 16 Jun 2017 06:53:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497621221; cv=none; d=google.com; s=arc-20160816; b=fMW6vzhT7PxXRc5sog4uhdE7ib6SjbO9tqHRii9xtGNqvVFhOY/pnsSzHedBsNi9a3 L0cPGI125cCCLaAnmHifEeZMsRHPJKXimBBOhzqyVGpwjWN3HpCY7+4xScX/cJAjjXn0 VaIUoYh6B9hy26VDeKTNLx0PBg4WDfgU9cxf9R43DOc+AnMh96K4tW7dgcNbsYCIFq1E NW982lF57NCBvlIYnVgyf072Z5wtHLBdCMBfx2HJGEICUHPHe5F3jynDifjMJ+vtPGFv n4gngdZ0b94P+zOkzjo+kioSkhLU/l5MMT3KvmqSbyL7zWcr0QnNXduQZKVEIqHqtdob 6skA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:message-id:date:subject:to:from:delivered-to :arc-authentication-results; bh=CHLHlcPemx4LleKrZvH6KWBBnuWNx0adJYX3c8erdyc=; b=K7/qZpXQ9IUuUCu5oDK2EZTao9a8Ldf1z9cPv6uv0Ir9ZZ60QOves9aB0Y/NLpzHm8 zJ3wrmazpr5njOzyY+CWHAhfMmhRmdb2/wTLM10gfbak1aIFeeIEPRKohRX63R49A7mc wibSbLsUEUnNMOlmISCZGhZqph9vOmJqsV441x9n/U0jsisjGT4nb7sStql3Wqeyt8E9 7EZncfLYzdqEhAC/B1QjQrJPRJ28PsyxrKrA0mA3ROvyEQM97lcEGk4LJFuIHEVp3xpA raGmeiK3yXy2EuueZgFjL8ydAb/AFd7sNaBtueP+3LA8FmSlS8A65UhEczduRptx2mYU RZwA== 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 p125si1987168pfb.8.2017.06.16.06.53.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Jun 2017 06:53:41 -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 78E7E6E8E7; Fri, 16 Jun 2017 13:53:38 +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 8E60C6E8E7 for ; Fri, 16 Jun 2017 13:53:37 +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 v5GDrXa3030865; Fri, 16 Jun 2017 14:53:33 +0100 From: Liviu Dudau To: Mali DP Maintainers 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 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: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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; }