Hi everyone,

would you mind putting something along the following into xf86-video-intel?

Thanks!
Helge Bahmann

---
Deactivate unused CRTCs

Have intel_crtc_dpms actually do something and deactivate CRTCs
on demand. This allows the X-Server to actually deactivate all
unused CRTCs, avoiding the following bug scenario:

- boot system with only internal LVDS display
- start X
- attach external display
- use xrandr to turn off internal LVDS, and turn on external display
- switch to console
- switch back to X
- use xrandr to turn off external display, turn an internal LVDS

At this point X believes that internal LVDS is active, when in fact it is not 
displaying any image. The root cause appears to be that X and kernel disagree 
on CRTC states.

This problem is verifiable on some notebooks (e.g. ThinkPad T400) but not all. 
I guess this is due to varying crtc selection logic.
---
 src/intel_display.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/intel_display.c b/src/intel_display.c
index b6592c4..f771df8 100644
--- a/src/intel_display.c
+++ b/src/intel_display.c
@@ -324,9 +324,15 @@ mode_to_kmode(ScrnInfoPtr scrn,
 }
 
 static void
-intel_crtc_dpms(xf86CrtcPtr intel_crtc, int mode)
+intel_crtc_dpms(xf86CrtcPtr crtc, int mode)
 {
-
+       struct intel_crtc *intel_crtc = crtc->driver_private;
+       struct intel_mode *modeset = intel_crtc->mode;
+       if (mode == DPMSModeOff) {
+               drmModeSetCrtc(modeset->fd, crtc_id(intel_crtc),
+                               0, 0, 0, NULL, 0,
+                               NULL);
+       }
 }
 
 static Bool
-- 
1.7.2.5
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to