mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: airlied@linux.ie, liviu.dudau@arm.com, dri-devel@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] drm: hdlcd: Suspend/resume only active crtcs
Date: Thu,  5 May 2016 17:13:38 +0100	[thread overview]
Message-ID: <759fe8d3dde95091a9df83018051cba00f494e1e.1462464611.git.robin.murphy@arm.com> (raw)
In-Reply-To: <eeb2a5540f50f5a3dd7f87861be1e9117bc4ed65.1462464611.git.robin.murphy@arm.com>

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 <liviu.dudau@arm.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
 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)
-- 
2.8.1.dirty

  reply	other threads:[~2016-05-05 16:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-05 16:13 [PATCH 1/2] drm: hdlcd: Skip PM callbacks if unbound Robin Murphy
2016-05-05 16:13 ` Robin Murphy [this message]
2016-05-05 16:52   ` [PATCH 2/2] drm: hdlcd: Suspend/resume only active crtcs liviu.dudau
2016-05-05 17:06   ` Daniel Vetter
2016-05-05 17:11     ` liviu.dudau
2016-05-05 18:01     ` Robin Murphy
2016-05-06 14:54 ` [PATCH 1/2] drm: hdlcd: Skip PM callbacks if unbound Thierry Reding
2016-05-06 16:26   ` liviu.dudau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=759fe8d3dde95091a9df83018051cba00f494e1e.1462464611.git.robin.murphy@arm.com \
    --to=robin.murphy@arm.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liviu.dudau@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®