Bug 80182 - [IVB regression] screen not resuming on kernel 3.14.6 and above
Summary: [IVB regression] screen not resuming on kernel 3.14.6 and above
Status: CLOSED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: unspecified
Hardware: Other All
: highest normal
Assignee: Intel GFX Bugs mailing list
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-18 11:43 UTC by marianitn
Modified: 2017-07-24 22:53 UTC (History)
6 users (show)

See Also:
i915 platform:
i915 features:


Attachments
dmesg with drm.debug=0xe (203.27 KB, text/plain)
2014-06-27 14:59 UTC, marianitn
no flags Details
Kernel bisect log (1.50 KB, text/plain)
2014-07-25 14:39 UTC, marianitn
no flags Details
Intel Reg Dump 3.14.5 (14.34 KB, text/plain)
2014-09-02 13:51 UTC, marianitn
no flags Details
Intel Reg Dump 3.14.6 (BAD) (14.34 KB, text/plain)
2014-09-02 13:52 UTC, marianitn
no flags Details
i915_opregion (8.00 KB, application/octet-stream)
2014-09-02 15:25 UTC, marianitn
no flags Details

Description marianitn 2014-06-18 11:43:06 UTC
When screen turns off after some inactivity, it doesn't resume on mouse move or key press. This regression was introduced on kernel 3.14.6, and is present also on 3.14.7 and 3.15.1. Running 3.14.5 works just fine.
This happens only on laptop screen. If there's an external monitor plugged, it works ok.

Some information about my environment:

Ubuntu 12.04 on Lenovo T430
Linux 3.14.6-031406-generic
xserver-xorg-video-intel 2.17.0-1ubuntu4.4
libdrm-intel1 2.4.46-1ubuntu0.0.0.1

00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09) (prog-if 00 [VGA controller])
	Subsystem: Lenovo Device 21f3
	Flags: bus master, fast devsel, latency 0, IRQ 43
	Memory at f0000000 (64-bit, non-prefetchable) [size=4M]
	Memory at e0000000 (64-bit, prefetchable) [size=256M]
	I/O ports at 5000 [size=64]
	Expansion ROM at <unassigned> [disabled]
	Capabilities: <access denied>
	Kernel driver in use: i915
	Kernel modules: i915

And here's the drm.debug=0xe info:

/* Screen lock */
Jun 17 11:27:25 e kernel: [  308.010264] [drm:intel_crtc_cursor_set], cursor off

/* Screen turns off */
Jun 17 11:37:35 e kernel: [  918.467218] [drm:intel_panel_actually_set_backlight], set backlight PWM = 0
Jun 17 11:37:35 e kernel: [  918.746612] [drm:intel_disable_shared_dpll], disable PCH DPLL A (active 1, on? 1) for crtc 3
Jun 17 11:37:35 e kernel: [  918.746621] [drm:intel_disable_shared_dpll], disabling PCH DPLL A
Jun 17 11:37:35 e kernel: [  918.747038] [drm:intel_update_fbc], no output, disabling
Jun 17 11:37:35 e kernel: [  918.747053] [drm:check_encoder_state], [ENCODER:10:LVDS-10]
Jun 17 11:37:35 e kernel: [  918.747056] [drm:check_encoder_state], [ENCODER:16:DAC-16]
Jun 17 11:37:35 e kernel: [  918.747059] [drm:check_encoder_state], [ENCODER:17:TMDS-17]
Jun 17 11:37:35 e kernel: [  918.747061] [drm:check_encoder_state], [ENCODER:21:TMDS-21]
Jun 17 11:37:35 e kernel: [  918.747064] [drm:check_encoder_state], [ENCODER:23:TMDS-23]
Jun 17 11:37:35 e kernel: [  918.747067] [drm:check_encoder_state], [ENCODER:25:TMDS-25]
Jun 17 11:37:35 e kernel: [  918.747069] [drm:check_encoder_state], [ENCODER:27:TMDS-27]
Jun 17 11:37:35 e kernel: [  918.747072] [drm:check_encoder_state], [ENCODER:29:TMDS-29]
Jun 17 11:37:35 e kernel: [  918.747075] [drm:check_crtc_state], [CRTC:3]
Jun 17 11:37:35 e kernel: [  918.747078] [drm:check_crtc_state], [CRTC:5]
Jun 17 11:37:35 e kernel: [  918.747079] [drm:check_crtc_state], [CRTC:7]
Jun 17 11:37:35 e kernel: [  918.747080] [drm:check_shared_dpll_state], PCH DPLL A
Jun 17 11:37:35 e kernel: [  918.747085] [drm:check_shared_dpll_state], PCH DPLL B
Jun 17 11:37:35 e kernel: [  918.747121] [drm:intel_panel_get_backlight], get backlight PWM = 0
Jun 17 11:37:35 e kernel: [  918.747138] [drm:intel_backlight_device_update_status], updating intel_backlight, brightness=0/4437
Jun 17 11:37:35 e kernel: [  918.747189] [drm:intel_backlight_device_update_status], updating intel_backlight, brightness=0/4437

/* Key press */
Jun 17 11:38:11 e kernel: [  955.090607] [drm:g4x_wait_for_vblank], vblank wait timed out
Jun 17 11:38:11 e kernel: [  955.154645] [drm:g4x_wait_for_vblank], vblank wait timed out
Jun 17 11:38:11 e kernel: [  955.154812] [drm:ivb_manual_fdi_link_train], FDI_RX_IIR before link train 0x0
Jun 17 11:38:11 e kernel: [  955.154821] [drm:ivb_manual_fdi_link_train], FDI_RX_IIR 0x100
Jun 17 11:38:11 e kernel: [  955.154824] [drm:ivb_manual_fdi_link_train], FDI train 1 done, level 0.
Jun 17 11:38:11 e kernel: [  955.154832] [drm:ivb_manual_fdi_link_train], FDI_RX_IIR 0x600
Jun 17 11:38:11 e kernel: [  955.154835] [drm:ivb_manual_fdi_link_train], FDI train 2 done, level 0.
Jun 17 11:38:11 e kernel: [  955.154836] [drm:ivb_manual_fdi_link_train], FDI train done.
Jun 17 11:38:11 e kernel: [  955.154840] [drm:ironlake_enable_shared_dpll], enable PCH DPLL A (active 0, on? 0)for crtc 3
Jun 17 11:38:11 e kernel: [  955.154841] [drm:ironlake_enable_shared_dpll], enabling PCH DPLL A
Jun 17 11:38:11 e kernel: [  955.156213] [drm:intel_update_fbc], disabled per chip default
Jun 17 11:38:11 e kernel: [  955.162653] [drm:intel_panel_enable_backlight], pipe A
Jun 17 11:38:11 e kernel: [  955.162663] [drm:intel_panel_actually_set_backlight], set backlight PWM = 4437
Jun 17 11:38:12 e kernel: [  955.178646] [drm:intel_connector_check_state], [CONNECTOR:9:LVDS-1]
Jun 17 11:38:12 e kernel: [  955.178663] [drm:check_encoder_state], [ENCODER:10:LVDS-10]
Jun 17 11:38:12 e kernel: [  955.178667] [drm:check_encoder_state], [ENCODER:16:DAC-16]
Jun 17 11:38:12 e kernel: [  955.178670] [drm:check_encoder_state], [ENCODER:17:TMDS-17]
Jun 17 11:38:12 e kernel: [  955.178672] [drm:check_encoder_state], [ENCODER:21:TMDS-21]
Jun 17 11:38:12 e kernel: [  955.178675] [drm:check_encoder_state], [ENCODER:23:TMDS-23]
Jun 17 11:38:12 e kernel: [  955.178678] [drm:check_encoder_state], [ENCODER:25:TMDS-25]
Jun 17 11:38:12 e kernel: [  955.178681] [drm:check_encoder_state], [ENCODER:27:TMDS-27]
Jun 17 11:38:12 e kernel: [  955.178684] [drm:check_encoder_state], [ENCODER:29:TMDS-29]
Jun 17 11:38:12 e kernel: [  955.178687] [drm:check_crtc_state], [CRTC:3]
Jun 17 11:38:12 e kernel: [  955.178701] [drm:check_crtc_state], [CRTC:5]
Jun 17 11:38:12 e kernel: [  955.178702] [drm:check_crtc_state], [CRTC:7]
Jun 17 11:38:12 e kernel: [  955.178704] [drm:check_shared_dpll_state], PCH DPLL A
Jun 17 11:38:12 e kernel: [  955.178709] [drm:check_shared_dpll_state], PCH DPLL B
Jun 17 11:38:12 e kernel: [  955.178797] [drm:intel_backlight_device_update_status], updating intel_backlight, brightness=0/4437
Jun 17 11:38:12 e kernel: [  955.178800] [drm:intel_panel_actually_set_backlight], set backlight PWM = 0

/* Screen still off */


I think this is a kernel issue. If this is not the right place for reporting it, please let me know where should I report.


Mariano
Comment 1 Daniel Vetter 2014-06-18 13:46:34 UTC
Can you please try to bisect where the regression has been introduced in 3.14.5-7? Not that many commits so shouldn't be to onerous.

Also please boot with drm.debug=0xe added to your kernel cmdline and attach dmesg (just for system information).

Any chance you can ssh into your machine once the screen is off and check logs for error?
Comment 2 marianitn 2014-06-18 14:12:03 UTC
I don't know how to bisect, but reading 3.14.6 changelog shows 5 or 6 patches regarding i915. Should't be hard to find it.

Regarding drm.debug logs, they're posted on the original report, have you read it?
Comment 3 Daniel Vetter 2014-06-18 14:18:31 UTC
https://wiki.ubuntu.com/Kernel/KernelBisection
Comment 4 Jani Nikula 2014-06-23 11:15:34 UTC
(In reply to comment #2)
> I don't know how to bisect, but reading 3.14.6 changelog shows 5 or 6
> patches regarding i915. Should't be hard to find it.

10 patches touching i915, but it might be acpi too. Please bisect, otherwise it's just guesswork.

> Regarding drm.debug logs, they're posted on the original report, have you
> read it?

Which original report? This bug only has a snippet; please post full dmesg all the way from boot to the problem, with drm.debug=0xe module parameter set.

Another thing to try would be xf86-video-intel version 2.99.912 or later.
Comment 5 Jani Nikula 2014-06-23 11:16:07 UTC
(In reply to comment #4)
> Which original report? This bug only has a snippet; please post full dmesg

please _attach_ the dmesg.
Comment 6 marianitn 2014-06-27 14:59:26 UTC
Created attachment 101873 [details]
dmesg with drm.debug=0xe
Comment 7 marianitn 2014-06-27 15:00:58 UTC
Bisecting will take some time, as I'm not a developer and have to learn all that stuff.
Comment 8 marianitn 2014-07-25 14:39:55 UTC
Created attachment 103447 [details]
Kernel bisect log

OK, I could finally bisect the kernel. This is what I found:

3e873234bf01413486c9d7151dea202a7ffc6a43 is the first bad commit
commit 3e873234bf01413486c9d7151dea202a7ffc6a43
Author: Hans de Goede <hdegoede@redhat.com>
Date:   Mon May 5 11:38:08 2014 +0200

    ACPI / video: Add use_native_backlight quirks for more systems
    
    commit 43d9490244254d2d6adb0f3c6275c7b8d032a2dd upstream.
    
    ThinkPad T430: extend the T430s entry to also cover the T430 (note we also
    have another entry for T430's with a different DMI_PRODUCT_VERSION).
    
    ThinkPad T430
    Reported-and-tested-by: edm <fuffi.il.fuffo@gmail.com>
    References: https://bugzilla.kernel.org/show_bug.cgi?id=51231
    
    Thinkpad T530
    Reported-and-tested-by: Balint Szigeti <balint.szgt@gmail.com>
    References: https://bugzilla.redhat.com/show_bug.cgi?id=1089545
    
    Acer Aspire 5742G
    Reported-and-tested-by: AnAkkk <anakin.cs@gmail.com>
    References: https://bugzilla.kernel.org/show_bug.cgi?id=35622
    
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

:040000 040000 85432e27049c051e697efaba250c8a8a9ffe7db5 73799e73b77b3ed3e00010159d460787d82f870d M	drivers
Comment 9 Mika Kuoppala 2014-08-20 09:51:33 UTC
To be sure could you revert this bad commit by:

git revert 3e873234bf01413486c9d7151dea202a7ffc6a43

and test to see if it really was this one?
Comment 10 marianitn 2014-08-20 20:44:32 UTC
OK, I reverted the bad commit and can confirm the issue is gone without it, screen resumes OK
Comment 11 marianitn 2014-08-21 12:18:33 UTC
Sorry, spoke too soon. Using 3.14.6 with that commit reverted I had the issue again. Maybe I'm doing something wrong, here's what I did:

git revert 3e873234bf01413486c9d7151dea202a7ffc6a43
git checkout v3.14.6

I get a message about the reverted patch not being applied. Built the kernel and now it fails. Is it OK or should I try something else?
Comment 12 Mika Kuoppala 2014-08-26 10:35:32 UTC
(In reply to comment #11)
> Sorry, spoke too soon. Using 3.14.6 with that commit reverted I had the
> issue again. Maybe I'm doing something wrong, here's what I did:
> 
> git revert 3e873234bf01413486c9d7151dea202a7ffc6a43
> git checkout v3.14.6
> 
> I get a message about the reverted patch not being applied. Built the kernel
> and now it fails. Is it OK or should I try something else?

Do the revert after checkouting the version that has the bug.
Comment 13 marianitn 2014-08-27 14:25:42 UTC
$ git checkout v3.14.6
$ git revert 3e873234bf01413486c9d7151dea202a7ffc6a43
error: could not revert 3e87323... ACPI / video: Add use_native_backlight quirks for more systems
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'

:/
Comment 14 Jani Nikula 2014-09-02 12:07:59 UTC
(In reply to comment #8)
> 3e873234bf01413486c9d7151dea202a7ffc6a43 is the first bad commit
> commit 3e873234bf01413486c9d7151dea202a7ffc6a43
> Author: Hans de Goede <hdegoede@redhat.com>
> Date:   Mon May 5 11:38:08 2014 +0200
> 
>     ACPI / video: Add use_native_backlight quirks for more systems

CC: Hans and Aaron

Any thoughts before I close this as NOTOURBUG on i915 side?
Comment 15 marianitn 2014-09-02 12:17:24 UTC
Just FYI, I tried whith "thinkpad-acpi.brightness_enable=1 acpi_backlight=vendor" boot options on kernel 3.14.5, and the bug triggers on that version, that works fine otherwise.
Comment 16 Hans de Goede 2014-09-02 12:29:38 UTC
(In reply to comment #14)
> (In reply to comment #8)
> > 3e873234bf01413486c9d7151dea202a7ffc6a43 is the first bad commit
> > commit 3e873234bf01413486c9d7151dea202a7ffc6a43
> > Author: Hans de Goede <hdegoede@redhat.com>
> > Date:   Mon May 5 11:38:08 2014 +0200
> > 
> >     ACPI / video: Add use_native_backlight quirks for more systems
> 
> CC: Hans and Aaron
> 
> Any thoughts before I close this as NOTOURBUG on i915 side?

What the commit to which this was bisected does, is change the used backlight driver from acpi to the intel_backlight driver. So I'm not entirely sure it is fair to say NOTOURBUG on i915 side.

Clearly something is not working right on the i915 side if the backlight does not come up after suspend/resume when the acpi backlight code is not involved. Things happened to work before since the acpi code path likely poked some register which the i915 code forgets to poke ...

If you read: https://bugzilla.kernel.org/show_bug.cgi?id=51231 then you will see that there are lots of problems with the Thinkpad T?30 / X230 series and acpi-video, related to win8 support in the BIOS.

Also while the switch from acpi-video to intel as the backlight driver of choice was done with a quirk in 3.14, but in 3.16 this behavior (video.use_native_backlight) now is the default.

This also makes me wonder if there is anything special with Mariano's laptop, or if this maybe is already fixed in 3.16, otherwise we should have a lot more bug reports as the T430 is a quite popular model.

Mariano, any chance you could try with a 3.16 kernel ?

Also can you please try adding: "video.use_native_backlight=0" the the kernel commandline with 3.14.6? That should fix things if your bisect has found the right commit as the culprit.
Comment 17 Hans de Goede 2014-09-02 12:30:45 UTC
(In reply to comment #15)
> Just FYI, I tried whith "thinkpad-acpi.brightness_enable=1
> acpi_backlight=vendor" boot options on kernel 3.14.5, and the bug triggers
> on that version, that works fine otherwise.

Hmm,

Can you do: "ls /sys/class/backlight" and copy and paste the output here both on a working kernel and on a troublesome kernel (without any special commandline arguments) ?

Thanks,

Hans
Comment 18 marianitn 2014-09-02 13:16:55 UTC
First, thanks Hans for your help!

> This also makes me wonder if there is anything special with Mariano's
> laptop, or if this maybe is already fixed in 3.16, otherwise we should have
> a lot more bug reports as the T430 is a quite popular model.
> 

Maybe BIOS version? I've upgraded original BIOS to this version:

        Vendor: LENOVO
        Version: G1ETA1WW (2.61 )
        Release Date: 12/03/2013
        BIOS Revision: 2.61
        Firmware Revision: 1.12

> Mariano, any chance you could try with a 3.16 kernel ?
> 

Yes, I tried 3.16.1 and the bug IS present

> Also can you please try adding: "video.use_native_backlight=0" the the
> kernel commandline with 3.14.6? That should fix things if your bisect has
> found the right commit as the culprit.

Adding that boot option to 3.14.6, screen resumes OK
Comment 19 marianitn 2014-09-02 13:17:59 UTC
> Can you do: "ls /sys/class/backlight" and copy and paste the output here
> both on a working kernel and on a troublesome kernel (without any special
> commandline arguments) ?
> 

3.14.5 (OK)
ls /sys/class/backlight
acpi_video0  intel_backlight

3.14.6 (BAD)
ls /sys/class/backlight
intel_backlight
Comment 20 Jani Nikula 2014-09-02 13:33:12 UTC
Hmm, please provide intel_reg_dumper output on both the good and bad kernels. It's part of the intel-gpu-tools package.
Comment 21 marianitn 2014-09-02 13:51:29 UTC
Created attachment 105611 [details]
Intel Reg Dump 3.14.5
Comment 22 marianitn 2014-09-02 13:52:28 UTC
Created attachment 105612 [details]
Intel Reg Dump 3.14.6 (BAD)
Comment 23 Hans de Goede 2014-09-02 14:48:03 UTC
(In reply to comment #18)
> > Also can you please try adding: "video.use_native_backlight=0" the the
> > kernel commandline with 3.14.6? That should fix things if your bisect has
> > found the right commit as the culprit.
> 
> Adding that boot option to 3.14.6, screen resumes OK

Ok, so that patch really is the culprit. I'm afraid though that reverting it for <= 3.15 may cause regressions for other T430 users, and with 3.16 we would actually need to add a quirk for your model to force video.use_native_backlight=0 there, as video.use_native_backlight=1 is the default there now.

So first lets see if Jani can make any sense of the regdumps you've attached, and then we'll go from there.
Comment 24 Jani Nikula 2014-09-02 15:06:39 UTC
Please try setting the backlight brightness to 4335 on the non-working kernel using the intel_backlight interface.

# echo 4335 > /sys/class/backlight/intel_backlight/brightness
Comment 25 Jani Nikula 2014-09-02 15:18:22 UTC
Also please attach /sys/kernel/debug/dri/0/i915_opregion
Comment 26 marianitn 2014-09-02 15:22:19 UTC
(In reply to comment #24)
> Please try setting the backlight brightness to 4335 on the non-working
> kernel using the intel_backlight interface.
> 
> # echo 4335 > /sys/class/backlight/intel_backlight/brightness

OK, here's what I did:

# cat /sys/class/backlight/intel_backlight/brightness
4437

# echo 4335 > /sys/class/backlight/intel_backlight/brightness

Then I closed the lid and opened again, with the screen not resuming. On secondary screen I did:

# cat /sys/class/backlight/intel_backlight/brightness
0
# echo 4335 > /sys/class/backlight/intel_backlight/brightness

And after that screen turned ON
Comment 27 marianitn 2014-09-02 15:25:52 UTC
Created attachment 105617 [details]
i915_opregion
Comment 28 Jani Nikula 2014-09-04 12:33:21 UTC
(In reply to comment #26)
> # cat /sys/class/backlight/intel_backlight/brightness
> 0
> # echo 4335 > /sys/class/backlight/intel_backlight/brightness
> 
> And after that screen turned ON

Can you change brightness normally after that? Does max_brightness work?
Comment 29 marianitn 2014-09-04 12:51:57 UTC
(In reply to comment #28)
> (In reply to comment #26)
> > # cat /sys/class/backlight/intel_backlight/brightness
> > 0
> > # echo 4335 > /sys/class/backlight/intel_backlight/brightness
> > 
> > And after that screen turned ON
> 
> Can you change brightness normally after that? Does max_brightness work?

Yes, I can increase/decrease brightness normally, up to max_brightness (4437)
Comment 30 marianitn 2014-09-04 14:21:54 UTC
(In reply to comment #29)
> (In reply to comment #28)
> > (In reply to comment #26)
> > > # cat /sys/class/backlight/intel_backlight/brightness
> > > 0
> > > # echo 4335 > /sys/class/backlight/intel_backlight/brightness
> > > 
> > > And after that screen turned ON
> > 
> > Can you change brightness normally after that? Does max_brightness work?
> 
> Yes, I can increase/decrease brightness normally, up to max_brightness (4437)

Just found that I can also increase brightness directly after resuming. I didn't notice it before because there's a screen locker. But if I blindly put the password, then I can raise brightness with the keys.
Comment 31 Jani Nikula 2014-09-08 13:59:03 UTC
Do you use systemd?
Comment 32 marianitn 2014-09-08 14:22:16 UTC
(In reply to comment #31)
> Do you use systemd?

Nope. Elementary Luna, Ubunu 12.04 based, no systemd.
Comment 33 Hans de Goede 2014-10-02 13:25:43 UTC
I think that the problem is that unlike the acpi-video backlight driver, the intel driver does not restore the backlight level on a resume.

drivers/acpi/video.c has this:

static int acpi_video_resume(struct notifier_block *nb,
                                unsigned long val, void *ign)
{
<snip>
        dev_info(&video->device->dev, "Restoring backlight state\n");

        for (i = 0; i < video->attached_count; i++) {
                video_device = video->attached_array[i].bind_info;
                if (video_device && video_device->backlight)
                        acpi_video_set_brightness(video_device->backlight);
        }
}

The intel backlight code lacks similar code (AFAIK), perhaps similar code should be added to the intel-panel.c, esp. now that the intel-backlight driver has become the preferred way to control the backlight on newer machines.
Comment 34 Jani Nikula 2014-10-02 18:20:36 UTC
(In reply to Hans de Goede from comment #33)
> I think that the problem is that unlike the acpi-video backlight driver, the
> intel driver does not restore the backlight level on a resume.

We do. intel_panel_enable_backlight() gets called on resume, and it restores the backlight setting from panel->backlight.level.
Comment 35 Jani Nikula 2014-10-02 18:23:25 UTC
Indeed the logs have plenty of

[  873.096139] [drm:intel_backlight_device_update_status], updating intel_backlight, brightness=0/4437

indicating userspace wishing to dim the backlight.
Comment 36 Hans de Goede 2014-10-03 07:15:06 UTC
(In reply to Jani Nikula from comment #35)
> Indeed the logs have plenty of
> 
> [  873.096139] [drm:intel_backlight_device_update_status], updating
> intel_backlight, brightness=0/4437
> 
> indicating userspace wishing to dim the backlight.

Hmm, so this may not be a kernel bug at all. Actually with this info, this sounds a lot like an xf86-video-intel bug which I fixed a while back, specifically see:

http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/commit/?id=b545e10c50cbb2dd6f9fd53369667bed0d8f1b51

Without that commit when userspace does a dpms off and then a read/modify/write of the backlight level things may end up with a backlight level of 0.

Also possibly relevant is:

http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/commit/?id=c6cd10f536e099277cdc46643725a5a50ea8b525

And then specifically this bit:

@@ -820,6 +949,14 @@ sna_crtc_apply(xf86CrtcPtr crtc)
for (i = 0; i < config->num_output; i++) {
xf86OutputPtr output = config->output[i];
+ /* Make sure we mark the output as off (and save the backlight)
+ * before the kernel turns it off due to changing the pipe.
+ * This is necessary as the kernel may turn off the backlight
+ * and we lose track of the user settings.
+ */
+ if (output->crtc == NULL)
+ output->funcs->dpms(output, DPMSModeOff);
+
if (output->crtc != crtc)
continue;

Marian, can you please try upgrading your intel driver to the 2.99.916 release ? (you can download the tarbal and build it from source), and please make sure you're using sna and not uxa.
Comment 37 Lukas Zapletal 2014-10-03 08:32:42 UTC
Hello,

adding me in the CC. Got the same problem on Lenovo T430s, Fedora 20.

[lzap@lzapx ~]$ ls /sys/class/backlight
intel_backlight

[lzap@lzapx ~]$ uname -a
Linux lzapx.brq.redhat.com 3.16.3-200.fc20.x86_64 #1 SMP Wed Sep 17 22:34:21 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

[lzap@lzapx ~]$ rpm -q xorg-x11-drv-intel
xorg-x11-drv-intel-2.21.15-7.fc20.x86_64

I can test the http://koji.fedoraproject.org/koji/buildinfo?buildID=576596 package if this helps.
Comment 38 Hans de Goede 2014-10-03 08:40:32 UTC
Hi,

(In reply to Lukas Zapletal from comment #37)
> Hello,
> 
> adding me in the CC. Got the same problem on Lenovo T430s, Fedora 20.
> 
> [lzap@lzapx ~]$ ls /sys/class/backlight
> intel_backlight
> 
> [lzap@lzapx ~]$ uname -a
> Linux lzapx.brq.redhat.com 3.16.3-200.fc20.x86_64 #1 SMP Wed Sep 17 22:34:21
> UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
> 
> [lzap@lzapx ~]$ rpm -q xorg-x11-drv-intel
> xorg-x11-drv-intel-2.21.15-7.fc20.x86_64
> 
> I can test the http://koji.fedoraproject.org/koji/buildinfo?buildID=576596
> package if this helps.

Hmm, the Fedora 2.21.15-7 package already has the 2 backlight fixes I mentioned, still if you could test a newer version that would be great, perhaps we will get lucky.
Comment 39 Lukas Zapletal 2014-10-03 08:58:37 UTC
Not sure if it helps, but I have issues only with the laptop screen.

When I have a secondary LCD connected, it always wake-ups just fine.

It does not matter if the secondary one is connected or not. Laptop screens *sometimes* does not restore the backlight. There are few cases (I'd say 1 out of 10) when it does restore. Wasn't able to find the pattern tho.
Comment 40 marianitn 2014-10-03 12:18:44 UTC
(In reply to Hans de Goede from comment #36)
> 
> Hmm, so this may not be a kernel bug at all. Actually with this info, this
> sounds a lot like an xf86-video-intel bug which I fixed a while back,
> specifically see:
> 
...
> 
> Marian, can you please try upgrading your intel driver to the 2.99.916
> release ? (you can download the tarbal and build it from source), and please
> make sure you're using sna and not uxa.

Hmm, while I *could* try with a new driver, I don't think that's the right thing to do. Quoting Linus "If a change results in user programs breaking, it's a bug in the kernel. We never EVER blame the user programs" seems pretty clear to me that this should be fixed on kernel. I've been using almost every stable kernel release since 3.2 with the same userspace, and the problem clearly started when I upgraded from 3.14.5 to 3.14.6
Comment 41 Jani Nikula 2014-10-07 06:29:37 UTC
I hope you're not proposing we should never ever fix bugs in the userspace?

In any case, please *try* the new driver. How it behaves will impact what should be done kernel side.
Comment 42 marianitn 2014-10-07 13:38:59 UTC
(In reply to Jani Nikula from comment #41)
> I hope you're not proposing we should never ever fix bugs in the userspace?
> 

Clearly not. 

> In any case, please *try* the new driver. How it behaves will impact what
> should be done kernel side.

I built and tried xf86-video-intel-2.99.916 as suggested, and the screen resumes OK
Comment 43 Jani Nikula 2014-10-08 07:24:44 UTC
Thanks.

Apparently intel_backlight does what the userspace wants, mechanism not policy and all that, while acpi_backlight, for some reason, did not obey 0 backlight in this scenario. And we moved from acpi_backlight to intel_backlight on your hardware. Technically there's no regression in i915, as it works with a sane userspace, and I'm obviously reluctant to adding hacks in i915 to replicate policy in acpi.

However we've changed a few things related to backlight power sequencing and minimum backlight brightness; please see if those help with the old userspace. The branch to try is drm-intel-nightly at http://cgit.freedesktop.org/drm-intel.
Comment 44 marianitn 2014-10-08 19:42:26 UTC
(In reply to Jani Nikula from comment #43)
> Thanks.
> 
> Apparently intel_backlight does what the userspace wants, mechanism not
> policy and all that, while acpi_backlight, for some reason, did not obey 0
> backlight in this scenario. And we moved from acpi_backlight to
> intel_backlight on your hardware. Technically there's no regression in i915,
> as it works with a sane userspace, and I'm obviously reluctant to adding
> hacks in i915 to replicate policy in acpi.
> 

OK, I understand your position here, I don't like hacks either. I think I'll just stick with acpi_backlight until I can upgrade my userland.

> However we've changed a few things related to backlight power sequencing and
> minimum backlight brightness; please see if those help with the old
> userspace. The branch to try is drm-intel-nightly at
> http://cgit.freedesktop.org/drm-intel.

Maybe someone else can test this, I'm done for now
Comment 45 Lukas Zapletal 2014-10-09 11:26:44 UTC
Hello,

I've tested Fedora 21 LiveCD nightly build and it seems to resume fine.
Comment 46 Daniel Vetter 2014-11-27 16:38:55 UTC
(In reply to Lukas Zapletal from comment #45)
> I've tested Fedora 21 LiveCD nightly build and it seems to resume fine.

Sounds like this has been resolved, thanks for the feedback.

In case this is still busted on latest upstream kernels please reopen.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.