mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ramón Jesús Miranda" <ramonjesusmiranda@gmail.com>
To: Rob Clark <robin.clark@oss.qualcomm.com>,
	Dmitry Baryshkov <lumag@kernel.org>,
	Abhinav Kumar <abhinav.kumar@linux.dev>,
	Jessica Zhang <jesszhan0024@gmail.com>,
	Sean Paul <sean@poorly.run>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>
Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
	freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: [PATCH] drm/msm/dpu: keep vblank enabled when entering self refresh
Date: Sun, 18 Oct 2026 15:54:23 +0000	[thread overview]
Message-ID: <20261018155423.1299629-1-ramonjesusmiranda@gmail.com> (raw)

When the CRTC is disabled to enter self refresh, dpu_crtc_disable() only
checks old_crtc_state->self_refresh_active, which covers leaving self
refresh, and calls drm_crtc_vblank_off() otherwise. The atomic helper
then expects vblank to remain enabled for a self refresh "disable" and
warns:

  driver disabled vblank in self-refresh
  WARNING: drivers/gpu/drm/drm_atomic_helper.c:1296 at
  drm_atomic_helper_commit_crtc_disable+0x1c0/0x1f8 [drm_kms_helper]

Skip drm_crtc_vblank_off() when the new state enters self refresh, as
other drivers supporting self refresh do. drm_crtc_vblank_on() in the
enable path is safe either way, it only drops the reference taken by
drm_crtc_vblank_off().

Seen at every boot on a Microsoft Surface Pro 11 (X1E80100, Samsung OLED
eDP panel) with eDP PSR enabled; with this change the warning is gone and
self refresh keeps working.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramón Jesús Miranda <ramonjesusmiranda@gmail.com>
---
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
@@ -1212,8 +1212,13 @@
 		return;
 	}
 
-	/* Disable/save vblank irq handling */
-	drm_crtc_vblank_off(crtc);
+	/*
+	 * Disable/save vblank irq handling, unless we are entering self
+	 * refresh: the DRM core expects vblank to stay enabled then and
+	 * warns ("driver disabled vblank in self-refresh") otherwise.
+	 */
+	if (!crtc->state->self_refresh_active)
+		drm_crtc_vblank_off(crtc);
 
 	drm_for_each_encoder_mask(encoder, crtc->dev,
 				  old_crtc_state->encoder_mask) {

             reply	other threads:[~2026-10-18 15:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-18 15:54 Ramón Jesús Miranda [this message]
2026-10-19 13:27 ` Konrad Dybcio
     [not found] <sashiko-outbox-176261@kernel.org>
2026-10-18 21:56 ` Ramón Jesús Miranda

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=20261018155423.1299629-1-ramonjesusmiranda@gmail.com \
    --to=ramonjesusmiranda@gmail.com \
    --cc=abhinav.kumar@linux.dev \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=jesszhan0024@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lumag@kernel.org \
    --cc=marijn.suijten@somainline.org \
    --cc=robin.clark@oss.qualcomm.com \
    --cc=sean@poorly.run \
    --cc=simona@ffwll.ch \
    /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®