From mboxrd@z Thu Jan 1 00:00:00 1970 From: Helge Bahmann Subject: [PATCH] xf86-video-intel: deactivate unused CRTCs Date: Thu, 15 Dec 2011 13:46:28 +0100 Message-ID: <201112151346.28917.helge.bahmann@secunet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from a.mx.secunet.com (a.mx.secunet.com [195.81.216.161]) by gabe.freedesktop.org (Postfix) with ESMTP id EFE899EB41 for ; Thu, 15 Dec 2011 05:06:26 -0800 (PST) Received: from localhost (alg1 [127.0.0.1]) by a.mx.secunet.com (Postfix) with ESMTP id D7B381A0081 for ; Thu, 15 Dec 2011 13:49:46 +0100 (CET) Received: from mail-srv1.secumail.de (unknown [10.53.40.200]) by a.mx.secunet.com (Postfix) with ESMTP id 30D521A0080 for ; Thu, 15 Dec 2011 13:49:46 +0100 (CET) Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org 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