diff options
-rw-r--r-- | src/uxa/intel_display.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/uxa/intel_display.c b/src/uxa/intel_display.c index a4e04ec4..e1b29201 100644 --- a/src/uxa/intel_display.c +++ b/src/uxa/intel_display.c @@ -298,6 +298,14 @@ intel_output_backlight_get_max(xf86OutputPtr output) char path[BACKLIGHT_PATH_LEN], val[BACKLIGHT_VALUE_LEN]; int fd, max = 0; + /* We are used as an initial check to see if we can + * control the backlight, so first test if we can set values. + */ + sprintf(path, "%s/%s/brightness", + BACKLIGHT_CLASS, intel_output->backlight_iface); + if (access(path, R_OK | W_OK)) + return -1; + sprintf(path, "%s/%s/max_brightness", BACKLIGHT_CLASS, intel_output->backlight_iface); fd = open(path, O_RDONLY); |