[xorg-x11-drv-intel/f20] Fix laptop lcd backlight being turned off when an external monitor is

Hans de Goede jwrdegoede at fedoraproject.org
Wed Jun 18 13:14:49 UTC 2014


commit ea96742b1371f3743abb599239fc0f07e96e94d6
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Wed Jun 18 15:14:44 2014 +0200

    Fix laptop lcd backlight being turned off when an external monitor is
    
      used and/or after a suspend-resume (rhbz#1032978, rhbz#1103806)

 ...light-off-after-plugging-external-monitor.patch |   43 ++++++++++++++++++
 ...-the-backlight-is-off-report-cached-value.patch |   47 ++++++++++++++++++++
 xorg-x11-drv-intel.spec                            |   13 +++++-
 3 files changed, 102 insertions(+), 1 deletions(-)
---
diff --git a/intel-backlight-off-after-plugging-external-monitor.patch b/intel-backlight-off-after-plugging-external-monitor.patch
new file mode 100644
index 0000000..2f84063
--- /dev/null
+++ b/intel-backlight-off-after-plugging-external-monitor.patch
@@ -0,0 +1,43 @@
+Partial backport of upstream commit c6cd10f536e099277cdc46643725a5a50ea8b525
+to fix rhbz#1032978 / rhbz#1103806
+
+And add the same fix to uxa which upstream does not have (will send upstream
+once confirmed to work)
+
+Signed-off-by: Hans de Goede <hdegoede at redhat.com>
+diff -up xf86-video-intel-2.21.15/src/sna/sna_display.c~ xf86-video-intel-2.21.15/src/sna/sna_display.c
+--- xf86-video-intel-2.21.15/src/sna/sna_display.c~	2013-08-20 22:26:26.000000000 +0200
++++ xf86-video-intel-2.21.15/src/sna/sna_display.c	2014-06-13 14:49:33.620484612 +0200
+@@ -773,6 +773,14 @@ sna_crtc_apply(xf86CrtcPtr crtc)
+ 	for (i = 0; i < xf86_config->num_output; i++) {
+ 		xf86OutputPtr output = xf86_config->output[i];
+ 
++		/* Make sure we mark the output as off (and save the backlight)
++		 * before the kernel turns it off due to changing the pipe.
++		 * This is necessary as the kernel may turn off the backlight
++		 * and we lose track of the user settings.
++		 */
++		if (output->crtc == NULL)
++			output->funcs->dpms(output, DPMSModeOff);
++
+ 		if (output->crtc != crtc)
+ 			continue;
+ 
+diff -up xf86-video-intel-2.21.15/src/uxa/intel_display.c~ xf86-video-intel-2.21.15/src/uxa/intel_display.c
+--- xf86-video-intel-2.21.15/src/uxa/intel_display.c~	2013-07-31 19:57:25.000000000 +0200
++++ xf86-video-intel-2.21.15/src/uxa/intel_display.c	2014-06-13 14:55:08.153246202 +0200
+@@ -464,6 +464,14 @@ intel_crtc_apply(xf86CrtcPtr crtc)
+ 		xf86OutputPtr output = xf86_config->output[i];
+ 		struct intel_output *intel_output;
+ 
++		/* Make sure we mark the output as off (and save the backlight)
++		 * before the kernel turns it off due to changing the pipe.
++		 * This is necessary as the kernel may turn off the backlight
++		 * and we lose track of the user settings.
++		 */
++		if (output->crtc == NULL)
++			output->funcs->dpms(output, DPMSModeOff);
++
+ 		if (output->crtc != crtc)
+ 			continue;
+ 
diff --git a/intel-when-the-backlight-is-off-report-cached-value.patch b/intel-when-the-backlight-is-off-report-cached-value.patch
new file mode 100644
index 0000000..190c360
--- /dev/null
+++ b/intel-when-the-backlight-is-off-report-cached-value.patch
@@ -0,0 +1,47 @@
+Backport of upstream commit b545e10c50cb to fix the other half of
+rhbz#1032978 / rhbz#1103806
+
+And add the same fix to uxa which upstream does not have (will send upstream
+once confirmed to work)
+
+Signed-off-by: Hans de Goede <hdegoede at redhat.com>
+diff -up xf86-video-intel-2.21.15/src/sna/sna_display.c~ xf86-video-intel-2.21.15/src/sna/sna_display.c
+--- xf86-video-intel-2.21.15/src/sna/sna_display.c~	2013-08-20 22:26:26.000000000 +0200
++++ xf86-video-intel-2.21.15/src/sna/sna_display.c	2014-06-12 10:40:00.478580880 +0200
+@@ -2334,9 +2337,13 @@ sna_output_get_property(xf86OutputPtr ou
+ 		if (! sna_output->backlight_iface)
+ 			return FALSE;
+ 
+-		val = sna_output_backlight_get(output);
+-		if (val < 0)
+-			return FALSE;
++                if (sna_output->dpms_mode == DPMSModeOn) {
++        		val = sna_output_backlight_get(output);
++	        	if (val < 0)
++		        	return FALSE;
++                } else {
++                        val = sna_output->backlight_active_level;
++                }
+ 
+ 		err = RRChangeOutputProperty(output->randr_output, property,
+ 					     XA_INTEGER, 32, PropModeReplace, 1, &val,
+diff -up xf86-video-intel-2.21.15/src/uxa/intel_display.c~ xf86-video-intel-2.21.15/src/uxa/intel_display.c
+--- xf86-video-intel-2.21.15/src/uxa/intel_display.c~	2013-07-31 19:57:25.000000000 +0200
++++ xf86-video-intel-2.21.15/src/uxa/intel_display.c	2014-06-12 10:38:42.103088911 +0200
+@@ -1377,9 +1381,13 @@ intel_output_get_property(xf86OutputPtr
+ 		if (! intel_output->backlight_iface)
+ 			return FALSE;
+ 
+-		val = intel_output_backlight_get(output);
+-		if (val < 0)
+-			return FALSE;
++                if (intel_output->dpms_mode == DPMSModeOn) {
++        		val = intel_output_backlight_get(output);
++	        	if (val < 0)
++		        	return FALSE;
++                } else {
++                        val = intel_output->backlight_active_level;
++                }
+ 
+ 		err = RRChangeOutputProperty(output->randr_output, property,
+ 					     XA_INTEGER, 32, PropModeReplace, 1, &val,
diff --git a/xorg-x11-drv-intel.spec b/xorg-x11-drv-intel.spec
index 83ffb65..9361389 100644
--- a/xorg-x11-drv-intel.spec
+++ b/xorg-x11-drv-intel.spec
@@ -25,7 +25,7 @@
 Summary:   Xorg X11 Intel video driver
 Name:      xorg-x11-drv-intel
 Version:   2.21.15
-Release:   6%{?gitrev}%{?dist}
+Release:   7%{?gitrev}%{?dist}
 URL:       http://www.x.org
 License:   MIT
 Group:     User Interface/X Hardware Support
@@ -45,6 +45,10 @@ Patch3: 0001-xwayland-device-isn-t-even-open-that-explains-why-dr.patch
 
 Patch5: intel-fix-pending-flip-count.patch
 
+# For rhbz#1032978 / rhbz#1103806
+Patch6: intel-backlight-off-after-plugging-external-monitor.patch
+Patch7: intel-when-the-backlight-is-off-report-cached-value.patch
+
 ExclusiveArch: %{ix86} x86_64 ia64
 
 BuildRequires: autoconf automake libtool
@@ -94,6 +98,9 @@ Debugging tools for Intel graphics chips
 %patch2 -p1 -b .wl2
 %patch3 -p1 -b .wl3
 %patch5 -p1 -b .pending
+%patch6 -p1
+%patch7 -p1
+
 %build
  
 #export CFLAGS="$RPM_OPT_FLAGS -fno-omit-frame-pointer"
@@ -165,6 +172,10 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man1/intel_*.1*
 
 %changelog
+* Wed Jun 18 2014 Hans de Goede <hdegoede at redhat.com> - 2.21.15-7
+- Fix laptop lcd backlight being turned off when an external monitor is
+  used and/or after a suspend-resume (rhbz#1032978, rhbz#1103806)
+
 * Thu May 22 2014 Dave Airlie <airlied at redhat.com> 2.21.15-6
 - fix pending flip count - triple head flips stalling g-s
 


More information about the scm-commits mailing list