All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] HACK: drm: Allow encoders to be reenabled
@ 2012-11-07 22:06 Thierry Reding
  2012-11-08 17:48 ` Alex Deucher
  0 siblings, 1 reply; 10+ messages in thread
From: Thierry Reding @ 2012-11-07 22:06 UTC (permalink / raw)
  To: dri-devel

When running the xf86-video-modesetting driver on top of a KMS driver,
leaving X causes the active encoder's DPMS mode to be set to off by the
drm_crtc_helper_disable() function. This doesn't set the connector's
DPMS mode to off, however, which results in subsequent calls to the
drm_helper_connector_dpms() function to not enable the encoder because
the connector's DPMS mode hasn't changed.

This patch works around this by forcing the connector's DPMS mode to off
if the encoder has changed, which always happens when a new mode is set
after drm_crtc_helper_disable(). The code that sets the connector DPMS
mode to on will then also enable the CRTC and encoder because the mode
actually changed.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
---
 drivers/gpu/drm/drm_crtc_helper.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index 1227adf..1b5ebf1 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -649,6 +649,12 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
 			 */
 			if (connector->encoder)
 				connector->encoder->crtc = NULL;
+			/*
+			 * HACK: Force DPMS mode to off so that the encoder
+			 * has a chance of being reenabled along with the
+			 * connector later on.
+			 */
+			connector->dpms = DRM_MODE_DPMS_OFF;
 			connector->encoder = new_encoder;
 		}
 	}
-- 
1.8.0

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

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

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-07 22:06 [PATCH] HACK: drm: Allow encoders to be reenabled Thierry Reding
2012-11-08 17:48 ` Alex Deucher
2012-11-08 19:01   ` Thierry Reding
2012-11-09 21:26     ` Daniel Vetter
2012-11-12  9:04       ` Ville Syrjälä
2012-11-12 14:11         ` Rob Clark
2012-11-12 14:17           ` Daniel Vetter
2012-11-12 14:25             ` Rob Clark
2012-11-12 14:29               ` Daniel Vetter
2012-11-12 15:01                 ` Rob Clark

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.