diff options
author | Aaron Lu <aaron.lu@intel.com> | 2014-05-12 16:55:45 +0800 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2014-05-15 11:32:51 +0300 |
commit | 721e82c08c1afd6b47367b0e0c4a62140b0667f3 (patch) | |
tree | 32d743ff056d600aaab777a9007a5b539f075c38 /drivers/atm/idt77105.c | |
parent | afba0b5a221c0dacbbdf3a778d539fbc90fc6191 (diff) |
drm/i915: restore backlight precision when converting from ACPI
When we set backlight on behalf of ACPI opregion, we will convert the
backlight value in the 0-255 range defined in opregion to the actual
hardware level. Commit 22505b82a2 (drm/i915: avoid brightness overflow
when doing scale) is meant to fix the overflow problem when doing the
conversion, but it also caused a problem that the converted hardware
level doesn't quite represent the intended value: say user wants maximum
backlight level(255 in opregion's range), then we will calculate the
actual hardware level to be: level = freq / max * level, where freq is
the hardware's max backlight level(937 on an user's box), and max and
level are all 255. The converted value should be 937 but the above
calculation will yield 765.
To fix this issue, just use 64 bits to do the calculation to keep the
precision and avoid overflow at the same time.
Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=72491
Reported-by: Nico Schottelius <nico-bugzilla.kernel.org@schottelius.org>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@vger.kernel.org
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers/atm/idt77105.c')
0 files changed, 0 insertions, 0 deletions