WinEunuuchs2Unix
WinEunuuchs2Unix

Reputation: 1939

Skylake hardware brightness changes too granular

I'm having a problem with Skylake i7-6700 HQ laptop display (HD 530 graphics) brightness changes:

However on my old Ivybridge laptop i7-3630 QM (HD 4000 graphics) brightness successfully changes in steps of 1.

Here is the script for testing:

#!/bin/bash

# Test all brightness levels from 1 to max_brightness

# For Intel i7-6700 HQ HD 530 graphics:
# - When change is 18 steps brighhness doesn't change at all.
# - When change is 19 steps brightnesss changes on multi-hundred point jumps.
# - When change is 20 steps each change applied as expected.

# For Intel i7-3630QM steps of 1 work fine!

if [[ $(id -u) != 0 ]]; then
    echo >&2 "$0 must be called with sudo powers"
    exit 1
fi

cd /sys/class/backlight/*/
max=$(cat max_brightness)
save=$(cat brightness)

for (( i=1; i < max; i=i+20)); do
    echo $i > brightness
    echo setting brightness level: $i
    sleep .005
done

echo $save > brightness
echo resetting brightness level from $max back to: $save

exit 0

I think my skylake is working fine other than weird temperatures reported for pch_skylake sensor:

$ paste <(cat /sys/class/thermal/thermal_zone*/type) <(cat /sys/class/thermal/thermal_zone*/temp) | column -s $'\t' -t | sed 's/...$/.0°C/'
INT3400 Thermal  20.0°C
SEN1             56.0°C
SEN2             52.0°C
SEN3             57.0°C
SEN4             61.0°C
pch_skylake      -44.0°C
B0D4             50.0°C
x86_pkg_temp     52.0°C

Other than that Linux intel micro-code is definitely activated on old laptop (Ubuntu 16.04) but may not be loaded on new laptop (Ubuntu 16.04.5).

Edit: Rebooted with Ubuntu 18.04.1 LTS, Kernel 4.15.0-36 and the same behaviour is witnessed.

Confirmation: I wonder if others have a Skylake laptop and can confirm hardware brightness works the same way.

Question: For the app I'm developing, do I have to put in a feature for each user to test smallest granular brightness change supported?

Upvotes: 0

Views: 78

Answers (1)

Peter Cordes
Peter Cordes

Reputation: 364160

Backlight brightness is separate from the GPU proper; the iGPU that's part of the CPU chip just produces pixel data for the LCD, e.g. as a DisplayPort output. (Or in laptops, often an eDP lower-voltage signal).

Note that in a desktop, you can't adjust the backlight brightness with software; there's no connection from the normal GPU hardware / drivers with the backlight.

The software backlight control in laptops is pretty much separate from the iGPU, and has nothing to do with whether it's a Skylake or IvyBridge. The backlight control is a separate hardware device with separate I/O ports (or memory-mapped IO registers or whatever).

Finer granularity backlight adjustment is a property of the laptop design, not the CPU. Specifically of the backlight technology and controller hardware.


(This is my understanding, but I haven't actually looked at GPU or backlight / ACPI driver code in enough detail to be 100% sure this is accurate.)


I have no idea if it's possible for software to query the true / meaningful granularity; this answer is only to point out the misconception that it's dependent on the GPU or GPU drivers.

Upvotes: 2

Related Questions