Bug 1090860 - system-backlight fails to set backlight level when using native driver
Summary: system-backlight fails to set backlight level when using native driver
Keywords:
Status: CLOSED DUPLICATE of bug 1032978
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 20
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-04-24 10:18 UTC by Jiri Eischmann
Modified: 2014-06-16 12:11 UTC (History)
40 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-11 10:17:13 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jiri Eischmann 2014-04-24 10:18:50 UTC
Description of problem:
system-backlight fails to set the backlight level when booting and and the initial backlight level is set to 0, so the user ends with a black screen.
This happens when the native driver is used for example by adding video.use_native_backlight=1 to the kernel command line to fix the problem the default driver has. See https://bugzilla.gnome.org/show_bug.cgi?id=728354 and https://bugzilla.kernel.org/show_bug.cgi?id=67031

Version-Release number of selected component (if applicable):
208

How reproducible:

Add video.use_native_backlight=1 to boot parameters and boot the system.

Actual results:
The system boots into a black screen, you have to increase the backlight manually in GDM. You log in and you have to increase the backlight from 0 again in GNOME.

Expected results:
systemd-backlight should remember the backlight level from the last session and set in when booting.

Comment 1 Lennart Poettering 2014-05-24 10:59:27 UTC
We do that actually. Maybe the driver exposes 0 during shutdown as brightness for a moment? Sounds like a driver issue though... Reassigning.

Comment 2 Hans de Goede 2014-05-24 12:13:13 UTC
Ok, so lets start with verifying that the problem is that systemd-backlight somehow reads 0 as backlight brightness value on shutdown and restores that on the next boot.

Lennart, where does systemd-backlight store the backlight settings it restores ?

Comment 3 Kay Sievers 2014-05-24 22:29:24 UTC
/var/lib/systemd/backlight/

Comment 4 Hans de Goede 2014-05-25 09:46:33 UTC
(In reply to Kay Sievers from comment #3)
> /var/lib/systemd/backlight/

Thanks, Jiri can you please check the files in there after a boot where the backlight started all dark, and confirm that the 0 setting of the backlight comes from there ?

After that can you remove all files in there, and retry ? maybe some stale file there is causing this ?

Comment 5 Jiri Eischmann 2014-06-09 11:33:26 UTC
If I understand it corrently there are two interfaces which can be used to set backlight: a generic one and vendor specific. The generic one didn't work for me to adjust backlight, so I went for the other one by adding video.use_native_backlight=1 to boot parameters. That's what systemd-backlight had problems with. It never received any value, the file in /var/lib/systemd/backlight was empty.

I'm now using the default generic interface because the original problem was solved and systemd-backlight sets and saves the level of backlight correctly.

The problem is solved for me and I think it's a candidate for closing because it only occurs when you enable an option that is not enabled by default and an average user is not supposed to enable it.

Comment 6 Hans de Goede 2014-06-09 13:42:18 UTC
Jiri,

video.use_native_backlight=1 is going to be the default for kernel-3.16. So if things are broken with that, now would be a good time to find out.

Thinking more about this, this sounds like it might be related to an xorg-x11-drv-intel bug. Can you try this scratch build together with video.use_native_backlight=1 and see if that helps ?  :

http://koji.fedoraproject.org/koji/taskinfo?taskID=6929186

Thanks,

Hans

Comment 7 Jiri Eischmann 2014-06-10 08:33:27 UTC
The proposed build fixed the issue with a blackscreen, but didn't fix it correctly because now the backlight is set to 100% and it doesn't honor the value saved in /var/lib/systemd/backlight.

Meanwhile we were able to produce the bug on three different laptops (all were with Intel cards though).

Comment 8 Hans de Goede 2014-06-10 09:06:54 UTC
(In reply to Jiri Eischmann from comment #7)
> The proposed build fixed the issue with a blackscreen, but didn't fix it
> correctly because now the backlight is set to 100% and it doesn't honor the
> value saved in /var/lib/systemd/backlight.
> 
> Meanwhile we were able to produce the bug on three different laptops (all
> were with Intel cards though).

Thanks for the input. Have you checked the value in /var/lib/systemd/backlight/intel_backlight ?

Try doing:

cat /sys/class/backlight/intel_backlight/brightness

When you've put the backlight at the desired level, and compare that with the value saved in
/var/lib/systemd/backlight/intel_backlight

If they don't match then something is going wrong with the saving side of things.

Also can you do an ls /sys/class/backlight and confirm that you've only intel_backlight there ?

Which model(s) laptop are you seeing this on ?

Comment 9 Jiri Eischmann 2014-06-10 10:23:04 UTC
There is no /var/lib/systemd/backlight/intel_backlight file. The only file there is acpi_video0 which contains a value that was saved from the last time I used the default interface, not intel_backlight. systemd-backlight doesn't honor this value while using intel_backlight, but apparently doesn't create another file for intel_backlight.

/sys/class/backlight contains both acpi_video0 and intel_backlight.

We reproduced it on Thinkpads X220, X230, and X240.

Comment 10 Hans de Goede 2014-06-10 13:53:24 UTC
Hi Jiri,

Once more thanks for the input. Did you boot with "video.use_native_backlight=1" on the kernel commandline? That will become the default in 3.16, so its best to test with this set to true.

If not please retest with  "video.use_native_backlight=1" on the kernel commandline.

I would expect that to make /sys/class/backlight/acpi_video0 go away, at least on the x230 and x240.

Also do the laptops have an external monitor plugged in when this is happening ?

Regards,

Hans

Comment 11 Jiri Eischmann 2014-06-10 22:04:35 UTC
(In reply to Hans de Goede from comment #10)
> Hi Jiri,
> 
> Once more thanks for the input. Did you boot with
> "video.use_native_backlight=1" on the kernel commandline? That will become
> the default in 3.16, so its best to test with this set to true.
> 
> If not please retest with  "video.use_native_backlight=1" on the kernel
> commandline.

Yes, we did boot with this parameter. In fact without it it worked well.

> I would expect that to make /sys/class/backlight/acpi_video0 go away, at
> least on the x230 and x240.
> 
> Also do the laptops have an external monitor plugged in when this is
> happening ?

Yes, all of the tested laptops had an external monitor plugged in. I will try it without an external monitor at work tomorrow.

BTW I couldn't reproduce it on my home ThinkPad T400s, so it seems to be specific for certain Intel chipsets.

Comment 12 Hans de Goede 2014-06-10 22:39:27 UTC
(In reply to Jiri Eischmann from comment #11)
> (In reply to Hans de Goede from comment #10)
> > Hi Jiri,
> > 
> > Once more thanks for the input. Did you boot with
> > "video.use_native_backlight=1" on the kernel commandline? That will become
> > the default in 3.16, so its best to test with this set to true.
> > 
> > If not please retest with  "video.use_native_backlight=1" on the kernel
> > commandline.
> 
> Yes, we did boot with this parameter. In fact without it it worked well.

So the parameter causes a change in behavior, in that case I would expd ect there to be no acpi_video0 in /sys/class/backlight only intel_backlight. Maybe you did the ls of /sys/class/backlight without the option?

Also after you applied the option, the brightness not being restored is expected on the first boot, since the backlight interface has changed, the question is if it will get restored on a second boot with the "video.use_native_backlight=1"  kernel commandline option.

> > I would expect that to make /sys/class/backlight/acpi_video0 go away, at
> > least on the x230 and x240.
> > 
> > Also do the laptops have an external monitor plugged in when this is
> > happening ?
> 
> Yes, all of the tested laptops had an external monitor plugged in. I will
> try it without an external monitor at work tomorrow.

Ah, ok, yes that is known to cause issues, which are fixed by the xorg-x11-drv-intel update, so that explains most of the issue, this only leaves the problem of the backlight setting not being restored on boot.

Comment 13 Jiri Eischmann 2014-06-11 09:00:29 UTC
Yes, the parameter changes behavior. Without it, systemd-backlight remembers the last level of backlight and corretly sets it when you boot next time.

With the parameter, systemd-backlight doesn't remember the last level of backlist and sets it to 0%  when you boot next time. That's how it behaves with the driver that is currently available in F20. The only difference in behavior with the driver you gave me is that the backlight is set to 100% instead of 0%. systemd-backlight still doesn't remember the last level of backlight.

I tested it on my work X240 today and it behaves the same with an external monitor unplugged. The only difference is that there is no longer /sys/class/backlight/acpi_video0, only intel_backlight. systemd-backlight still doesn't create /var/lib/systemd/backlight/intel_backlight and doesn't remember the last level of backlight for the next boot.

Comment 14 Hans de Goede 2014-06-11 10:17:13 UTC
Hi Jiri,

Thanks your last comment makes everything fall into place. So we've 2 bugs here:

1) The intel driver causing the backlight to go off / the screen dark in certain cases when using "video.use_native_backlight=1", this is a know issue and I'm going to mark this bug as a duplicate of the bug which is tracking that.

2) systemd-backlight not saving / restoring the intel_backlight brightness setting even if it is the only backlight interface. I've filed a new bug for this, see bug 1108019

Thanks once more for all your input.

Regards,

Hans

*** This bug has been marked as a duplicate of bug 1032978 ***

Comment 15 Jiri Eischmann 2014-06-16 11:58:17 UTC
It didn't work for me :-( It behaves the same: systemd-backlight remembers the last level of backlight using the default interface, but after switching to the native driver it doesn't and always sets the backlight to 100%.

Comment 16 Hans de Goede 2014-06-16 12:02:22 UTC
(In reply to Jiri Eischmann from comment #15)
> It didn't work for me :-( It behaves the same: systemd-backlight remembers
> the last level of backlight using the default interface, but after switching
> to the native driver it doesn't and always sets the backlight to 100%.

Right, that is what I filed bug 1108019 for. Bug 1032978 is for the screen going black or to its lowest backlight setting in some cases, something you mentioned as a problem too in comment 7: "the proposed build fixed the issue with a blackscreen". So this bug report was dealing with 2 different issues:

1) screen going black
2) backlight setting not saved

Since 1) is by far the worst problem I decided to keep this but for tracking that, and that is resolved in bug 1032978, and I've opened a new bug for 2).

Comment 17 Jiri Eischmann 2014-06-16 12:11:53 UTC
Sorry, I accidentally clicked on a different tab in the browser and answered in a wrong report. I just put feedback in the correct one.


Note You need to log in before you can comment on or make changes to this bug.