From b24e59ccbbeefe01064f2f7411d387995168d14c Mon Sep 17 00:00:00 2001 From: PulkoMandy Date: Thu, 7 Apr 2022 19:18:26 +0200 Subject: [PATCH] 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 Reviewed-by: waddlesplash Tested-by: Commit checker robot --- src/add-ons/accelerants/intel_extreme/mode.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/add-ons/accelerants/intel_extreme/mode.cpp b/src/add-ons/accelerants/intel_extreme/mode.cpp index 91f65ac524..c926da6892 100644 --- a/src/add-ons/accelerants/intel_extreme/mode.cpp +++ b/src/add-ons/accelerants/intel_extreme/mode.cpp @@ -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 {