mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/msm/dpu: keep vblank enabled when entering self refresh
@ 2026-10-18 15:54 Ramón Jesús Miranda
  2026-10-19 13:27 ` Konrad Dybcio
  0 siblings, 1 reply; 4+ messages in thread
From: Ramón Jesús Miranda @ 2026-10-18 15:54 UTC (permalink / raw)
  To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
	Sean Paul, Marijn Suijten, David Airlie, Simona Vetter
  Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel

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) {

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/msm/dpu: keep vblank enabled when entering self refresh
  2026-10-18 15:54 [PATCH] drm/msm/dpu: keep vblank enabled when entering self refresh Ramón Jesús Miranda
@ 2026-10-19 13:27 ` Konrad Dybcio
  2026-10-25 12:53   ` Ramón Jesús Miranda
  0 siblings, 1 reply; 4+ messages in thread
From: Konrad Dybcio @ 2026-10-19 13:27 UTC (permalink / raw)
  To: Ramón Jesús Miranda, Rob Clark, Dmitry Baryshkov,
	Abhinav Kumar, Jessica Zhang, Sean Paul, Marijn Suijten,
	David Airlie, Simona Vetter
  Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel

On 10/18/26 5:54 PM, Ramón Jesús Miranda wrote:
> 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>
> ---

FWIW this is not enough to get self-refresh to work on the Glymur
Zenbook A16 and the 8280-based x13s, the screen stays black if
there's no updates (it worked on the latter in the past). Dmitry promised
to take a look one day.

Konrad

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/msm/dpu: keep vblank enabled when entering self refresh
  2026-10-19 13:27 ` Konrad Dybcio
@ 2026-10-25 12:53   ` Ramón Jesús Miranda
  0 siblings, 0 replies; 4+ messages in thread
From: Ramón Jesús Miranda @ 2026-10-25 12:53 UTC (permalink / raw)
  To: Konrad Dybcio, Rob Clark, Dmitry Baryshkov, Abhinav Kumar,
	Jessica Zhang, Sean Paul, Marijn Suijten, David Airlie,
	Simona Vetter
  Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel

On 10/19/26 3:27 PM, Konrad Dybcio wrote:
> FWIW this is not enough to get self-refresh to work on the Glymur
> Zenbook A16 and the 8280-based x13s, the screen stays black if
> there's no updates (it worked on the latter in the past). Dmitry promised
> to take a look one day.

Thanks. For the record, I had already withdrawn this patch after the
sashiko-bot review (the self refresh exit path, and the vblank worker
touching DPU registers after the last runtime PM reference is gone). It
was never meant to make self refresh work, only to avoid the atomic
helper warning about vblank being disabled on a self refresh "disable".

I have no fix for the black screen, but I am happy to test whatever
Dmitry comes up with on the Surface Pro 11 (x1e80100, OLED eDP panel).

Ramón

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/msm/dpu: keep vblank enabled when entering self refresh
       [not found] <sashiko-outbox-176261@kernel.org>
@ 2026-10-18 21:56 ` Ramón Jesús Miranda
  0 siblings, 0 replies; 4+ messages in thread
From: Ramón Jesús Miranda @ 2026-10-18 21:56 UTC (permalink / raw)
  To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
	Sean Paul, Marijn Suijten
  Cc: sashiko-bot, linux-arm-msm, dri-devel, freedreno, linux-kernel

Thanks for the review. Both points look right to me: the self refresh
exit path in dpu_crtc_disable() returns early without
drm_crtc_vblank_off(), and with vblank_disable_immediate the vblank
worker can end up touching DPU interrupt registers after the last
runtime PM reference is gone.

Please consider this patch withdrawn. I will look at keeping the vblank
IRQ path consistent with the self refresh entry/exit (and the runtime PM
reference) and send a v2 if I get it right.

Thanks,
Ramón

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-10-25 12:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-18 15:54 [PATCH] drm/msm/dpu: keep vblank enabled when entering self refresh Ramón Jesús Miranda
2026-10-19 13:27 ` Konrad Dybcio
2026-10-25 12:53   ` Ramón Jesús Miranda
     [not found] <sashiko-outbox-176261@kernel.org>
2026-10-18 21:56 ` Ramón Jesús Miranda

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®