display: Query current level after finding max value.

The current backlight value is clamped to the valid range [0, max] and
so as we queried the value before setting the max, we forced the current
backlight to 0 and so set it to be zero on initialising the display.

Fixes:

  Bug 30063 - start X will modify brightness value to zero
  https://bugs.freedesktop.org/show_bug.cgi?id=30063

which is a regression due to 38f940dfea.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2010-09-07 12:57:04 +01:00
parent 53767cc0d0
commit 273d34fbc4
1 changed files with 1 additions and 1 deletions

View File

@ -239,9 +239,9 @@ intel_output_backlight_init(xf86OutputPtr output)
sprintf(path, "%s/%s", BACKLIGHT_CLASS, backlight_interfaces[i]);
if (!stat(path, &buf)) {
intel_output->backlight_iface = backlight_interfaces[i];
intel_output->backlight_active_level = intel_output_backlight_get(output);
intel_output->backlight_max = intel_output_backlight_get_max(output);
if (intel_output->backlight_max > 0) {
intel_output->backlight_active_level = intel_output_backlight_get(output);
xf86DrvMsg(output->scrn->scrnIndex, X_INFO,
"found backlight control interface %s\n", path);
return;