intel_extreme: fix backlight control on generations 9 and 10

I changed the way we decide which registers to use in a previous
patch review but I changed it in only one of two places. As a result
we were using the old code with the new registers, resulting in invalid
backlight settings.

Should fix #17692

Change-Id: I4e977d5700d3a002986beafff5ca511673c86540
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5185
Reviewed-by: Richard Zak <richard.j.zak@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
This commit is contained in:
PulkoMandy 2022-04-07 19:18:26 +02:00 committed by waddlesplash
parent b59abca856
commit b24e59ccbb

View File

@ -615,7 +615,7 @@ intel_set_brightness(float brightness)
// working ACPI keyboard shortcuts for this). So always keep the backlight
// at least a little bit on for now.
if (gInfo->shared_info->device_type.Generation() >= 11) {
if (gInfo->shared_info->pch_info >= INTEL_PCH_CNP) {
uint32_t period = read32(intel_get_backlight_register(true));
uint32_t duty = (uint32_t)(period * brightness);
@ -650,7 +650,7 @@ intel_get_brightness(float* brightness)
uint32_t duty;
uint32_t period;
if (gInfo->shared_info->device_type.Generation() >= 11) {
if (gInfo->shared_info->pch_info >= INTEL_PCH_CNP) {
period = read32(intel_get_backlight_register(true));
duty = read32(intel_get_backlight_register(false));
} else {