diff mbox

[1/2] uxa: When the output is off, report the cached backlight value

Message ID 1403096497-7570-1-git-send-email-hdegoede@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Hans de Goede June 18, 2014, 1:01 p.m. UTC
This is a "backport" of commit b545e10c50cb to uxa, so that users who are
still using uxa, don't end up with a black screen after suspend / resume.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 src/uxa/intel_display.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/src/uxa/intel_display.c b/src/uxa/intel_display.c
index b90061b..e00b9c2 100644
--- a/src/uxa/intel_display.c
+++ b/src/uxa/intel_display.c
@@ -1257,9 +1257,13 @@  intel_output_get_property(xf86OutputPtr output, Atom property)
 		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,