[kernel/f18] Revert write backlight harder until better solution is found (rhbz 917353)

Justin M. Forbes jforbes at fedoraproject.org
Fri Mar 8 13:41:54 UTC 2013


commit 0a5c26d7c81b2e31826a54998800942baadc1c21
Author: Justin M. Forbes <jforbes at redhat.com>
Date:   Fri Mar 8 07:35:01 2013 -0600

    Revert write backlight harder until better solution is found (rhbz 917353)

 backlight_revert.patch |   61 ++++++++++++++++++++++++++++++++++++++++++++++++
 kernel.spec            |   10 +++++++-
 2 files changed, 70 insertions(+), 1 deletions(-)
---
diff --git a/backlight_revert.patch b/backlight_revert.patch
new file mode 100644
index 0000000..6d2957c
--- /dev/null
+++ b/backlight_revert.patch
@@ -0,0 +1,61 @@
+commit cf0a6584aa6d382f802f2c3cacac23ccbccde0cd
+Author: Daniel Vetter <daniel.vetter at ffwll.ch>
+Date:   Wed Feb 6 11:24:41 2013 +0100
+
+    drm/i915: write backlight harder
+    
+    770c12312ad617172b1a65b911d3e6564fc5aca8 is the first bad commit
+    commit 770c12312ad617172b1a65b911d3e6564fc5aca8
+    Author: Takashi Iwai <tiwai at suse.de>
+    Date:   Sat Aug 11 08:56:42 2012 +0200
+    
+        drm/i915: Fix blank panel at reopening lid
+    
+    changed the register write sequence for restoring the backlight, which
+    helped prevent non-working backlights on some machines. Turns out that
+    the original sequence was the right thing to do for a different set of
+    machines. Worse, setting the backlight level _after_ enabling it seems
+    to reset it somehow. So we need to make that one conditional upon the
+    backlight having been reset to zero, and add the old one back.
+    
+    Cargo-culting at it's best, but it seems to work.
+    
+    Cc: stable at vger.kernel.org
+    Cc: Takashi Iwai <tiwai at suse.de>
+    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=47941
+    Reviewed-by: Jani Nikula <jani.nikula at intel.com>
+    Acked-by: Takashi Iwai <tiwai at suse.de>
+    Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
+
+diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
+index bee8cb6..a3730e0 100644
+--- a/drivers/gpu/drm/i915/intel_panel.c
++++ b/drivers/gpu/drm/i915/intel_panel.c
+@@ -321,6 +321,9 @@ void intel_panel_enable_backlight(struct drm_device *dev,
+ 	if (dev_priv->backlight_level == 0)
+ 		dev_priv->backlight_level = intel_panel_get_max_backlight(dev);
+
++	dev_priv->backlight_enabled = true;
++	intel_panel_actually_set_backlight(dev, dev_priv->backlight_level);
++
+ 	if (INTEL_INFO(dev)->gen >= 4) {
+ 		uint32_t reg, tmp;
+
+@@ -356,12 +359,12 @@ void intel_panel_enable_backlight(struct drm_device *dev,
+ 	}
+
+ set_level:
+-	/* Call below after setting BLC_PWM_CPU_CTL2 and BLC_PWM_PCH_CTL1.
+-	 * BLC_PWM_CPU_CTL may be cleared to zero automatically when these
+-	 * registers are set.
++	/* Check the current backlight level and try to set again if it's zero.
++	 * On some machines, BLC_PWM_CPU_CTL is cleared to zero automatically
++	 * when BLC_PWM_CPU_CTL2 and BLC_PWM_PCH_CTL1 are written.
+ 	 */
+-	dev_priv->backlight_enabled = true;
+-	intel_panel_actually_set_backlight(dev, dev_priv->backlight_level);
++	if (!intel_panel_get_backlight(dev))
++		intel_panel_actually_set_backlight(dev, dev_priv->backlight_level);
+ }
+
+ static void intel_panel_init_backlight(struct drm_device *dev)
diff --git a/kernel.spec b/kernel.spec
index 5cd41df..423793c 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -62,7 +62,7 @@ Summary: The Linux kernel
 # For non-released -rc kernels, this will be appended after the rcX and
 # gitX tags, so a 3 here would become part of release "0.rcX.gitX.3"
 #
-%global baserelease 205
+%global baserelease 206
 %global fedora_build %{baserelease}
 
 # base_sublevel is the kernel version we're starting with and patching
@@ -777,6 +777,8 @@ Patch24100: userns-avoid-recursion-in-put_user_ns.patch
 #rhbz 859346
 Patch24101: fix-destroy_conntrack-GPF.patch
 
+#rhbz 917353
+Patch24102: backlight_revert.patch
 
 # END OF PATCH DEFINITIONS
 
@@ -1503,6 +1505,9 @@ ApplyPatch dmi_scan-fix-missing-check-for-_dmi_-signature-in-smbios_present.patc
 #CVE-2013-1828 rhbz 919315 919316
 ApplyPatch net-sctp-Validate-parameter-size-for-SCTP_GET_ASSOC_.patch
 
+#rhbz 917353
+ApplyPatch backlight_revert.patch -R
+
 # END OF PATCH APPLICATIONS
 
 %endif
@@ -2360,6 +2365,9 @@ fi
 #                 ||----w |
 #                 ||     ||
 %changelog
+* Fri Mar 08 2013 Justin M. Forbes <jforbes at redhat.com>
+- Revert "write backlight harder" until better solution is found (rhbz 917353)
+
 * Fri Mar 08 2013 Josh Boyer <jwboyer at redhat.com>
 - CVE-2013-1828 sctp: SCTP_GET_ASSOC_STATS stack buffer overflow (rhbz 919315 919316)
 


More information about the scm-commits mailing list