All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/atomic: Allow vblank-enabled + self-refresh "disable"
@ 2023-01-06  1:40 ` Brian Norris
  0 siblings, 0 replies; 41+ messages in thread
From: Brian Norris @ 2023-01-06  1:40 UTC (permalink / raw)
  To: Heiko Stübner, Sean Paul
  Cc: Sandy Huang, Michel Dänzer, linux-kernel, linux-rockchip,
	dri-devel, Brian Norris, stable

The self-refresh helper framework overloads "disable" to sometimes mean
"go into self-refresh mode," and this mode activates automatically
(e.g., after some period of unchanging display output). In such cases,
the display pipe is still considered "on", and user-space is not aware
that we went into self-refresh mode. Thus, users may expect that
vblank-related features (such as DRM_IOCTL_WAIT_VBLANK) still work
properly.

However, we trigger the WARN_ONCE() here if a CRTC driver tries to leave
vblank enabled here.

Add a new exception, such that we allow CRTCs to be "disabled" (with
self-refresh active) with vblank interrupts still enabled.

Cc: <stable@vger.kernel.org> # dependency for subsequent patch
Signed-off-by: Brian Norris <briannorris@chromium.org>
---

 drivers/gpu/drm/drm_atomic_helper.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index d579fd8f7cb8..7b5eddadebd5 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -1207,6 +1207,12 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state)
 
 		if (!drm_dev_has_vblank(dev))
 			continue;
+		/*
+		 * Self-refresh is not a true "disable"; let vblank remain
+		 * enabled.
+		 */
+		if (new_crtc_state->self_refresh_active)
+			continue;
 
 		ret = drm_crtc_vblank_get(crtc);
 		WARN_ONCE(ret != -EINVAL, "driver forgot to call drm_crtc_vblank_off()\n");
-- 
2.39.0.314.g84b9a713c41-goog


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

end of thread, other threads:[~2023-01-11 15:05 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-06  1:40 [PATCH 1/2] drm/atomic: Allow vblank-enabled + self-refresh "disable" Brian Norris
2023-01-06  1:40 ` Brian Norris
2023-01-06  1:40 ` Brian Norris
2023-01-06  1:40 ` [PATCH 2/2] drm/rockchip: vop: Leave vblank enabled in self-refresh Brian Norris
2023-01-06  1:40   ` Brian Norris
2023-01-06  1:40   ` Brian Norris
2023-01-06 11:42   ` Michel Dänzer
2023-01-06 11:42     ` Michel Dänzer
2023-01-07  1:21     ` Brian Norris
2023-01-07  1:21       ` Brian Norris
2023-01-07  1:21       ` Brian Norris
2023-01-06  7:04 ` [PATCH 1/2] drm/atomic: Allow vblank-enabled + self-refresh "disable" Greg KH
2023-01-06  7:04   ` Greg KH
2023-01-06  7:04   ` Greg KH
2023-01-06 17:49   ` Daniel Vetter
2023-01-06 17:49     ` Daniel Vetter
2023-01-06 17:49     ` Daniel Vetter
2023-01-06 17:53 ` Daniel Vetter
2023-01-06 17:53   ` Daniel Vetter
2023-01-06 17:53   ` Daniel Vetter
2023-01-06 18:08   ` Brian Norris
2023-01-06 18:08     ` Brian Norris
2023-01-06 18:20     ` Daniel Vetter
2023-01-06 18:20       ` Daniel Vetter
2023-01-06 18:20       ` Daniel Vetter
2023-01-06 19:25       ` Brian Norris
2023-01-06 19:25         ` Brian Norris
2023-01-06 18:17   ` Daniel Vetter
2023-01-06 18:17     ` Daniel Vetter
2023-01-06 19:33     ` Brian Norris
2023-01-06 19:33       ` Brian Norris
2023-01-06 20:30       ` Daniel Vetter
2023-01-06 20:30         ` Daniel Vetter
2023-01-06 20:30         ` Daniel Vetter
2023-01-06 21:30         ` Brian Norris
2023-01-06 21:30           ` Brian Norris
2023-01-06 22:44           ` Daniel Vetter
2023-01-06 22:44             ` Daniel Vetter
2023-01-06 22:44             ` Daniel Vetter
2023-01-11 15:03         ` Ville Syrjälä
2023-01-11 15:03           ` Ville Syrjälä

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.