Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

acpi_video0 backlight vs. intel_backlight #15

Closed
monochromec opened this issue Feb 22, 2014 · 5 comments
Closed

acpi_video0 backlight vs. intel_backlight #15

monochromec opened this issue Feb 22, 2014 · 5 comments

Comments

@monochromec
Copy link
Contributor

On a stock Lubuntu 13.10 running on a MBP 8,1 I noticed that using acpi_video0 in /sys/class/backlight to control the backlight doesn't seem to work (kernel 3.13). In contrast to this, intel_backlight does seem to work.

As a quick workaround, inserting the respective /sys/class files in sysfs_backlight.c does the trick:

--- sysfs_backlight.c.org 2014-02-22 18:32:50.552133444 +0100
+++ sysfs_backlight.c 2014-02-22 18:06:00.186953043 +0100
@@ -70,6 +70,7 @@
"/sys/class/backlight/apple_backlight/actual_brightness",
"/sys/class/backlight/nvidia_backlight/actual_brightness",
"/sys/class/backlight/nv_backlight/actual_brightness",

  • "/sys/class/backlight/intel_backlight/actual_brightness",
    "/sys/class/backlight/acpi_video0/actual_brightness",
    #endif
    };
    @@ -89,6 +90,7 @@
    "/sys/class/backlight/apple_backlight/brightness",
    "/sys/class/backlight/nvidia_backlight/brightness",
    "/sys/class/backlight/nv_backlight/brightness",
  • "/sys/class/backlight/intel_backlight/brightness",
    "/sys/class/backlight/acpi_video0/brightness",
    #endif
    };
    @@ -108,6 +110,7 @@
    "/sys/class/backlight/apple_backlight/max_brightness",
    "/sys/class/backlight/nvidia_backlight/max_brightness",
    "/sys/class/backlight/nv_backlight/max_brightness",
  • "/sys/class/backlight/intel_backlight/max_brightness",
    "/sys/class/backlight/acpi_video0/max_brightness",
    #endif
    };

Caveat: I don't know why yet, but in order to make this work, acpi_video0 cannot
be present in the backlight directory, so acpi_backlight=vendor as a kernel parameter has to be stated during boot.

@bytbox
Copy link
Owner

bytbox commented Feb 24, 2014

You need to modify the bck_driver enum at the top of that file, as well as the selection mechanism (relating to sysfs_backlight_probe). (If you don't want to take this on, I can probably get to it later this week and hand you a patch to test.)

@monochromec
Copy link
Contributor Author

Ok, here's the complete patch including the enum fix:

--- sysfs_backlight.c 2014-02-22 18:32:50.552133444 +0100
+++ sysfs_backlight.c 2014-02-26 23:51:33.034948626 +0100
@@ -46,6 +46,7 @@
SYSFS_DRIVER_APPLE,
SYSFS_DRIVER_NVIDIA,
SYSFS_DRIVER_NOUVEAU,

  • SYSFS_DRIVER_INTEL,
    SYSFS_DRIVER_ACPI,
    #endif
    SYSFS_DRIVER_MAX
    @@ -70,6 +71,7 @@
    "/sys/class/backlight/apple_backlight/actual_brightness",
    "/sys/class/backlight/nvidia_backlight/actual_brightness",
    "/sys/class/backlight/nv_backlight/actual_brightness",
  • "/sys/class/backlight/intel_backlight/actual_brightness",
    "/sys/class/backlight/acpi_video0/actual_brightness",
    #endif
    };
    @@ -89,6 +91,7 @@
    "/sys/class/backlight/apple_backlight/brightness",
    "/sys/class/backlight/nvidia_backlight/brightness",
    "/sys/class/backlight/nv_backlight/brightness",
  • "/sys/class/backlight/intel_backlight/brightness",
    "/sys/class/backlight/acpi_video0/brightness",
    #endif
    };
    @@ -108,6 +111,7 @@
    "/sys/class/backlight/apple_backlight/max_brightness",
    "/sys/class/backlight/nvidia_backlight/max_brightness",
    "/sys/class/backlight/nv_backlight/max_brightness",
  • "/sys/class/backlight/intel_backlight/max_brightness",
    "/sys/class/backlight/acpi_video0/max_brightness",
    #endif
    };

Not sure what should be changed in sysfs_backlight_probe() or friends as they seem to work OOTB - even after closer inspection :-). But maybe I'm missing something here..

@bytbox
Copy link
Owner

bytbox commented Feb 26, 2014

Does this patch work without acpi_backlight=vendor? I was guessing that even with the enum fix, you'd need to change some part of the selection mechanism. However, if this works correctly for you, it's almost certainly correct, and I'll merge it in.

@monochromec
Copy link
Contributor Author

Managed to find some time to give it another spin. After fixing the enum it also now works w/o the kernel boot parameter. Just don't use a step value of 1 in the pommed.conf file with the Intel driver -); otherwise you will be waiting forever as possible values for the backlight driver range from 1 to 1808. A step value of 10 to 20 does the trick though.

@bytbox
Copy link
Owner

bytbox commented Mar 2, 2014

Ok, I've pushed this patch, so I'm closing this issue. Thanks loads!

@bytbox bytbox closed this as completed Mar 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants