dell / libsmbios

library for interacting with Dell SMBIOS tables
Other
192 stars 39 forks source link

doesn't work on 4.4, but works on 3.10.32 #42

Closed imz closed 6 years ago

imz commented 6 years ago

I have a problem on linux 4.4.119, but not on linux 3.10.32:

smbios-lcd-brightness --value=1

has a visible effect on linux 3.10.32, but not on linux 4.4.119, though the saved value is modified indeed.

Do you have some ideas?

python-module-smbios-2.3.3-alt1.0.g4fec2ad.noarch libsmbios-2.3.3-alt1.0.g4fec2ad.x86_64 smbios-utils-2.3.3-alt1.0.g4fec2ad.x86_64

Dell Latitude 6430u

imz commented 6 years ago

See also https://bugs.launchpad.net/altlinux/+source/libsmbios/+bug/331357

imz commented 6 years ago

The situation was the same with older libsmbios-2.2.28-alt1.1

imz commented 6 years ago

It runs like this (but there is no effect):

[root@ovicaa ~]# smbios-lcd-brightness --value=15
Reading current Battery mode setting
    current: 1
        min: 0
        max: 15
Write new Battery mode setting
Reading current Battery mode setting
    current: 15
        min: 0
        max: 15
[root@ovicaa ~]# smbios-lcd-brightness --value=1
Reading current Battery mode setting
    current: 15
        min: 0
        max: 15
Write new Battery mode setting
Reading current Battery mode setting
    current: 1
        min: 0
        max: 15
[root@ovicaa ~]# 
superm1 commented 6 years ago

I would suspect it's related to:

  1. The built-in handling from the dell-laptop kernel driver. or
  2. A move to intel graphics driver handling brightness instead
imz commented 6 years ago

Yes, thanks for the ideas. Perhaps, it's the video driver which can control this now. (Whose "move" has this been? Doesn't dcdbas and smbios work on its own?)

 cat /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight/max_brightness > /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight/brightness

now makes it bright, and

 echo 0 > /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight/brightness

makes it non-bright.

superm1 commented 6 years ago

I would definitely recommend using that interface instead. It means that there doesn't have to be a SMI invoked in order to accomplish changing the backlight. You'll have better performance this way.

imz commented 6 years ago

On 3.10.32, there were 3 interfaces and all worked. (Now, I could remember that I tried them all a long time ago and selected smbios as my choice.)

They all work, i.e., have a visible effect. Their values are in different units. Their values affect each other, but in a funny way:

[root@ovicaa ~]# cat /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight/brightness; cat /sys/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/brightness; smbios-lcd-brightness 
976
100
Reading current Battery mode setting
    current: 15
        min: 0
        max: 15
[root@ovicaa ~]# smbios-lcd-brightness --value=1
Reading current Battery mode setting
    current: 15
        min: 0
        max: 15
Write new Battery mode setting
Reading current Battery mode setting
    current: 1
        min: 0
        max: 15
[root@ovicaa ~]# cat /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight/brightness; cat /sys/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/brightness; smbios-lcd-brightness 
168
100
Reading current Battery mode setting
    current: 1
        min: 0
        max: 15
[root@ovicaa ~]# 
[root@ovicaa ~]# cat /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight/brightness; cat /sys/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/brightness; smbios-lcd-brightness 
976
100
Reading current Battery mode setting
    current: 15
        min: 0
        max: 15
[root@ovicaa ~]# echo 0 > /sys/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/brightness
[root@ovicaa ~]# cat /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight/brightness; cat /sys/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/brightness; smbios-lcd-brightness 
168
0
Reading current Battery mode setting
    current: 1
        min: 0
        max: 15
[root@ovicaa ~]# 
[root@ovicaa ~]# cat /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight/brightness; cat /sys/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/brightness; smbios-lcd-brightness 
976
100
Reading current Battery mode setting
    current: 15
        min: 0
        max: 15
[root@ovicaa ~]# echo 168 > /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight/brightness
[root@ovicaa ~]# cat /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight/brightness; cat /sys/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/brightness; smbios-lcd-brightness 
168
100
Reading current Battery mode setting
    current: 15
        min: 0
        max: 15
[root@ovicaa ~]# 

So, it seems for /sys/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/brightness to have been the best place to set the value so that all reported values are consistent.

However, in linux 4.4, there is no /sys/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/brightness.

superm1 commented 6 years ago

That's a pretty peculiar combination. I would recommend to just stick with the intel one.