Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/39158 )
Change subject: drivers/intel/gma/acpi: Prevent DivideByZero error ......................................................................
drivers/intel/gma/acpi: Prevent DivideByZero error
In case backlight control isn't enabled the register is zero. Return early instead of running into a DivideByZero error.
This is seen on devices that doesn't have backlight control, like desktops and servers. The proper fix is to not include those ACPI methods, but that requires a much bigger refactoring.
Change-Id: Ie9bdb00949d6d44fd99321db556d6008d2d12a7f Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/drivers/intel/gma/acpi/configure_brightness_levels.asl 1 file changed, 5 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/58/39158/1
diff --git a/src/drivers/intel/gma/acpi/configure_brightness_levels.asl b/src/drivers/intel/gma/acpi/configure_brightness_levels.asl index 3ec7411..21f0b23 100644 --- a/src/drivers/intel/gma/acpi/configure_brightness_levels.asl +++ b/src/drivers/intel/gma/acpi/configure_brightness_levels.asl @@ -122,6 +122,11 @@ /* Find value closest to BCLV in BRIG (which must be ordered) */ Method (XBQC, 0, NotSerialized) { + /* Prevent DivideByZero if backlight control isn't enabled */ + If (BCLM == 0) + { + Return (Zero) + } /* Local0: current percentage */ Store (DRCL (Multiply (BCLV, 100), BCLM), Local0)
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39158 )
Change subject: drivers/intel/gma/acpi: Prevent DivideByZero error ......................................................................
Patch Set 1: Code-Review+2
(3 comments)
Thanks!
Just a few nits on the commit message.
https://review.coreboot.org/c/coreboot/+/39158/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/39158/1//COMMIT_MSG@9 PS1, Line 9: the register Which register? BCLM?
https://review.coreboot.org/c/coreboot/+/39158/1//COMMIT_MSG@12 PS1, Line 12: is seen maybe use `happens` instead?
https://review.coreboot.org/c/coreboot/+/39158/1//COMMIT_MSG@12 PS1, Line 12: doesn't don't
Patrick Georgi has uploaded a new patch set (#2) to the change originally created by Patrick Rudolph. ( https://review.coreboot.org/c/coreboot/+/39158 )
Change subject: drivers/intel/gma/acpi: Prevent DivideByZero error ......................................................................
drivers/intel/gma/acpi: Prevent DivideByZero error
In case backlight control isn't enabled BCLM is zero. Return early instead of running into a DivideByZero error.
This happens on devices that don't have backlight control, like desktops and servers. The proper fix is to not include those ACPI methods, but that requires a much bigger refactoring.
Change-Id: Ie9bdb00949d6d44fd99321db556d6008d2d12a7f Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/drivers/intel/gma/acpi/configure_brightness_levels.asl 1 file changed, 5 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/58/39158/2
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39158 )
Change subject: drivers/intel/gma/acpi: Prevent DivideByZero error ......................................................................
Patch Set 2:
(3 comments)
https://review.coreboot.org/c/coreboot/+/39158/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/39158/1//COMMIT_MSG@9 PS1, Line 9: the register
Which register? BCLM?
Done
https://review.coreboot.org/c/coreboot/+/39158/1//COMMIT_MSG@12 PS1, Line 12: doesn't
don't
Done
https://review.coreboot.org/c/coreboot/+/39158/1//COMMIT_MSG@12 PS1, Line 12: is seen
maybe use `happens` instead?
Done
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/39158 )
Change subject: drivers/intel/gma/acpi: Prevent DivideByZero error ......................................................................
drivers/intel/gma/acpi: Prevent DivideByZero error
In case backlight control isn't enabled BCLM is zero. Return early instead of running into a DivideByZero error.
This happens on devices that don't have backlight control, like desktops and servers. The proper fix is to not include those ACPI methods, but that requires a much bigger refactoring.
Change-Id: Ie9bdb00949d6d44fd99321db556d6008d2d12a7f Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/39158 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Angel Pons th3fanbus@gmail.com --- M src/drivers/intel/gma/acpi/configure_brightness_levels.asl 1 file changed, 5 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, approved
diff --git a/src/drivers/intel/gma/acpi/configure_brightness_levels.asl b/src/drivers/intel/gma/acpi/configure_brightness_levels.asl index 3ec7411..21f0b23 100644 --- a/src/drivers/intel/gma/acpi/configure_brightness_levels.asl +++ b/src/drivers/intel/gma/acpi/configure_brightness_levels.asl @@ -122,6 +122,11 @@ /* Find value closest to BCLV in BRIG (which must be ordered) */ Method (XBQC, 0, NotSerialized) { + /* Prevent DivideByZero if backlight control isn't enabled */ + If (BCLM == 0) + { + Return (Zero) + } /* Local0: current percentage */ Store (DRCL (Multiply (BCLV, 100), BCLM), Local0)
9elements QA has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39158 )
Change subject: drivers/intel/gma/acpi: Prevent DivideByZero error ......................................................................
Patch Set 3:
Automatic boot test returned (PASS/FAIL/TOTAL): 3/0/3 Emulation targets: EMULATION_QEMU_X86_Q35 using payload TianoCore : SUCCESS : https://lava.9esec.io/r/1256 EMULATION_QEMU_X86_Q35 using payload SeaBIOS : SUCCESS : https://lava.9esec.io/r/1255 EMULATION_QEMU_X86_I440FX using payload SeaBIOS : SUCCESS : https://lava.9esec.io/r/1254
Please note: This test is under development and might not be accurate at all!