summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-07-28 13:41:41 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-07-28 13:42:15 +0100
commitb68d4fcab5d671946c187947f5d00aedff939852 (patch)
tree8f30097f00ec1822a28455d9330feaf13b1b7f62 /src
parent938ef4eaec0e406e198105d866f6d2a1be5e0ef8 (diff)
drmmode: Only treat a backlight as connected if it has a non-zero max
Optimistically might help https://bugs.freedesktop.org/show_bug.cgi?id=29273 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/drmmode_display.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 546b8d59..fd433221 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -91,7 +91,7 @@ typedef struct {
drmmode_prop_ptr props;
void *private_data;
int dpms_mode;
- char *backlight_iface;
+ const char *backlight_iface;
int backlight_active_level;
int backlight_max;
xf86OutputPtr output;
@@ -106,7 +106,7 @@ drmmode_output_dpms(xf86OutputPtr output, int mode);
/*
* List of available kernel interfaces in priority order
*/
-static char *backlight_interfaces[] = {
+static const char *backlight_interfaces[] = {
"asus-laptop",
"eeepc",
"thinkpad_screen",
@@ -240,11 +240,13 @@ drmmode_backlight_init(xf86OutputPtr output)
sprintf(path, "%s/%s", BACKLIGHT_CLASS, backlight_interfaces[i]);
if (!stat(path, &buf)) {
drmmode_output->backlight_iface = backlight_interfaces[i];
- xf86DrvMsg(output->scrn->scrnIndex, X_INFO,
- "found backlight control interface %s\n", path);
drmmode_output->backlight_max = drmmode_backlight_get_max(output);
drmmode_output->backlight_active_level = drmmode_backlight_get(output);
- return;
+ if (drmmode_backlight_get_max(output)) {
+ xf86DrvMsg(output->scrn->scrnIndex, X_INFO,
+ "found backlight control interface %s\n", path);
+ return;
+ }
}
}
drmmode_output->backlight_iface = NULL;