From patchwork Thu May 5 16:13:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Murphy X-Patchwork-Id: 9025881 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E61179F1C1 for ; Thu, 5 May 2016 16:13:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 21721203A4 for ; Thu, 5 May 2016 16:13:54 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 44173201E4 for ; Thu, 5 May 2016 16:13:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E9CF06E9DA; Thu, 5 May 2016 16:13:50 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from foss.arm.com (foss.arm.com [217.140.101.70]) by gabe.freedesktop.org (Postfix) with ESMTP id 64EE46E9DA for ; Thu, 5 May 2016 16:13:49 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A720449; Thu, 5 May 2016 09:13:56 -0700 (PDT) Received: from e104324-lin.cambridge.arm.com (e104324-lin.cambridge.arm.com [10.1.205.154]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 66B193F252; Thu, 5 May 2016 09:13:48 -0700 (PDT) From: Robin Murphy To: airlied@linux.ie, liviu.dudau@arm.com, dri-devel@lists.freedesktop.org Subject: [PATCH 2/2] drm: hdlcd: Suspend/resume only active crtcs Date: Thu, 5 May 2016 17:13:38 +0100 Message-Id: <759fe8d3dde95091a9df83018051cba00f494e1e.1462464611.git.robin.murphy@arm.com> X-Mailer: git-send-email 2.8.1.dirty In-Reply-To: References: Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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" X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The current PM ops simply unconditionally enable/disable the HDLCD, which proves problematic when there is no display plugged in - since without a crtc the hardware itself is still in an uninitialised state, coming out of suspend results in it being enabled without a valid framebuffer address, which typically results in it trying to scan out from bus address 0 and flooding the system with error interrupts. Fix this by checking the crtc state on resume, and only enabling the hardware if it's actually supposed to be. For the sake of consistency, do the same on the suspend path as well, although there it's merely a case of skipping unnecessary work. CC: Liviu Dudau Signed-off-by: Robin Murphy Acked-by: Liviu Dudau --- drivers/gpu/drm/arm/hdlcd_crtc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c index fef1b04c2aab..bf6ff5e48adc 100644 --- a/drivers/gpu/drm/arm/hdlcd_crtc.c +++ b/drivers/gpu/drm/arm/hdlcd_crtc.c @@ -296,12 +296,14 @@ static struct drm_plane *hdlcd_plane_init(struct drm_device *drm) void hdlcd_crtc_suspend(struct drm_crtc *crtc) { - hdlcd_crtc_disable(crtc); + if (crtc->state->active) + hdlcd_crtc_disable(crtc); } void hdlcd_crtc_resume(struct drm_crtc *crtc) { - hdlcd_crtc_enable(crtc); + if (crtc->state->active) + hdlcd_crtc_enable(crtc); } int hdlcd_setup_crtc(struct drm_device *drm)