Bug 111621 - Suspend/resume brightness issue Debian 8 with i965 integrated video controller
Summary: Suspend/resume brightness issue Debian 8 with i965 integrated video controller
Status: CLOSED MOVED
Alias: None
Product: Drivers
Classification: Unclassified
Component: Video(DRI - Intel) (show other bugs)
Hardware: Intel Linux
: P1 normal
Assignee: intel-gfx-bugs@lists.freedesktop.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-31 15:31 UTC by Riccardo
Modified: 2016-02-06 02:01 UTC (History)
2 users (show)

See Also:
Kernel Version: 3.16.7-ckt20-1+deb8 amd64
Subsystem:
Regression: No
Bisected commit-id:


Attachments
dmesg_after_resume (66.56 KB, text/plain)
2016-02-03 22:04 UTC, Riccardo
Details

Description Riccardo 2016-01-31 15:31:29 UTC
I run a macbook 13'' with Debian Jessie 8.3 (kernel 3.16). I am able to hibernate and resume but I'm not able to resume from suspend. When I try to suspend both from GUI than from terminal (pm-suspend or systemctl suspend) I get only a black screen on resume. The computer works but it seems that the brightness is set to zero and I can not turn it on. If I try to hibernate, on resume all works well.

I try to switch from tt1 to tt6 but nothing changes, the screen remain black. I also tried to use the brightness key but nothing happens.

This is my graphic card:

-----
:~$ lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (primary) (rev 03)
-----

Recently I found that running the old debian stable kernel (3.2.0-4-amd64) both suspend than hibrnate works well. I also tried to run newer kernel from backport (kernel 4.2) but it is still buggy. 

I hope it can be fixed

All the best
Comment 1 Aaron Lu 2016-02-01 08:34:23 UTC
Do I understand correctly that after resume, the system is working, only the backlight level is 0?
And can you try a recent kernel, say v4.4? Thanks.
Comment 2 Riccardo 2016-02-01 13:46:15 UTC
(In reply to Aaron Lu from comment #1)
> Do I understand correctly that after resume, the system is working, only the
> backlight level is 0?
> And can you try a recent kernel, say v4.4? Thanks.

Yes, you understand the problem. Where do I find the 4.4. kernel? Is it from the backports repo? Or should I compile it by myself from kernel.org? Thanks
Comment 3 Aaron Lu 2016-02-02 02:35:51 UTC
Compile it if possible, or you may be able to find it in debian's package pool, but I'm not sure(I do not use debian personally, sorry)

BTW, with the current kernel v3.16, can you please show me the output of:
$ ls /sys/class/backlight

And dmesg after system resumed. I think you can get the dmesg like this:
1 boot
2 # cd /root
2 # echo mem > /sys/power/state; dmesg > dmesg_after_resume; reboot

then attach the dmesg_after_resume file under /root.
Comment 4 Riccardo 2016-02-02 09:13:59 UTC
Hi, the kernel 4.4. is not yet in the debian repos, the newest one is the 4.2 and the suspend/resume is still buggy (I have already tried). It is the first time I compile a kernel so can you please give me a .config file or could I use a .config file from kernel 3.16? 

How can I get the information from resume if the screen is completely black? Should I write a script to perform your instruction?
Comment 5 Aaron Lu 2016-02-03 01:53:08 UTC
You just need to type:
# echo mem > /sys/power/state; dmesg > dmesg_after_resume; reboot
after boot and then resume the machine, once the machine rebooted, the dmesg_after_resume should be under /root.
Comment 6 Riccardo 2016-02-03 22:03:36 UTC
Hi this is the output you asked, 

r@mb:~$ uname -r
3.16.0-4-amd64

r@mb:~$ ls -l /sys/class/backlight/apple_backlight/
total 0
-r--r--r-- 1 root root 4096 Feb  3 22:49 actual_brightness
-rw-r--r-- 1 root root 4096 Feb  3 22:49 bl_power
-rw-r--r-- 1 root root 4096 Feb  3 22:45 brightness
-r--r--r-- 1 root root 4096 Feb  3 22:45 max_brightness
drwxr-xr-x 2 root root    0 Feb  3 22:49 power
lrwxrwxrwx 1 root root    0 Feb  3 22:45 subsystem ->
../../../../class/backlight
-r--r--r-- 1 root root 4096 Feb  3 22:45 type
-rw-r--r-- 1 root root 4096 Feb  3 22:45 uevent

In attachment you will find the dmesg_after_resume. I'm also working to compile my own kernel 4.4.
Comment 7 Riccardo 2016-02-03 22:04:10 UTC
Created attachment 202911 [details]
dmesg_after_resume
Comment 8 Aaron Lu 2016-02-04 01:58:45 UTC
apple_backlight, this is the 1st time I've heard of that, interesting.
Does that interface work? You can try doing this:
# cd /sys/class/backlight/apple_backlight
# cat max_brightness
  XXX
# echo a_value_between_0_and_XXX > brightness
to see if backlight changes.

And on the working kernel v3.2, which backlight interface do you have there?
Comment 9 Riccardo 2016-02-04 14:01:23 UTC
Yes, the brightness work well and change according tho the vaule I write

# cat max_brightness
15

The range is from 0(min) to 15(max).

# uname -r
3.2.0-4-amd64

# ls -l /sys/class/backlight/
total 0
lrwxrwxrwx 1 root root 0 Feb  3 23:09 apple_backlight -> ../../devices/virtual/backlight/apple_backlight
lrwxrwxrwx 1 root root 0 Feb  3 23:09 intel_backlight -> ../../devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight

and

# ls -l /sys/class/backlight/apple_backlight/
total 0
-r--r--r-- 1 root root 4096 Feb  4 14:47 actual_brightness
-rw-r--r-- 1 root root 4096 Feb  4 14:47 bl_power
-rw-r--r-- 1 root root 4096 Feb  3 23:09 brightness
-r--r--r-- 1 root root 4096 Feb  3 23:09 max_brightness
drwxr-xr-x 2 root root    0 Feb  4 14:47 power
lrwxrwxrwx 1 root root    0 Feb  3 23:09 subsystem -> ../../../../class/backlight
-r--r--r-- 1 root root 4096 Feb  3 23:09 type
-rw-r--r-- 1 root root 4096 Feb  3 23:09 uevent

# cd /sys/class/backlight/apple_backlight
# cat max_brightness
# 15
# echo 5 > brightness

The interface works.


# ls -l /sys/class/backlight/intel_backlight/
total 0
-r--r--r-- 1 root root 4096 Feb  3 23:09 actual_brightness
-rw-r--r-- 1 root root 4096 Feb  4 14:48 bl_power
-rw-r--r-- 1 root root 4096 Feb  3 23:09 brightness
lrwxrwxrwx 1 root root    0 Feb  4 14:48 device -> ../../card0-LVDS-1
-r--r--r-- 1 root root 4096 Feb  3 23:09 max_brightness
drwxr-xr-x 2 root root    0 Feb  4 14:48 power
lrwxrwxrwx 1 root root    0 Feb  3 23:09 subsystem -> ../../../../../../../class/backlight
-r--r--r-- 1 root root 4096 Feb  3 23:09 type
-rw-r--r-- 1 root root 4096 Feb  3 23:09 uevent

# cd /sys/class/backlight/intel_backlight
# cat max_brightness
# 494
# echo 200 > brightness

This works too...

I notice the 5 in the apple_backlight seems equivalent to 200 in intel_backlight.
Comment 10 Aaron Lu 2016-02-05 02:17:18 UTC
I tend to think the backlight should be turned on by the GPU driver after resume, so I'll move this bug to GPU category to see if they have an idea. But I guess they will also need you to test the latest kernel first :-)
Comment 11 Jani Nikula 2016-02-05 08:46:45 UTC
(In reply to Aaron Lu from comment #5)
> You just need to type:
> # echo mem > /sys/power/state; dmesg > dmesg_after_resume; reboot
> after boot and then resume the machine, once the machine rebooted, the
> dmesg_after_resume should be under /root.

Please boot with drm.debug=14 module parameter and try this:

# echo mem > /sys/power/state; sleep 5; echo 300 > /sys/class/backlight/intel_backlight/brightness; dmesg > dmesg_with_debug; sleep 10; reboot

You can ^C at the sleep 10 if the echo there brings the backlight back.

(In reply to Aaron Lu from comment #10)
> I tend to think the backlight should be turned on by the GPU driver after
> resume, so I'll move this bug to GPU category to see if they have an idea.

Let's see. It may be a userspace bug, and there may be a bad interaction with the two backlight drivers.

> But I guess they will also need you to test the latest kernel first :-)

Preferrably yes. v4.4 or later.
Comment 12 Riccardo 2016-02-05 21:44:34 UTC
I compiled my own kernel 4.4.1 and all seems to work well! The machine suspend and resume.

The next days I will try the operation suggested. Should I do this running the 3.16 kernel?
Comment 13 Aaron Lu 2016-02-06 02:01:28 UTC
If everything works well, I don't see the need to attach debug dmesg.
You probably should file the bug to debian and tell them the upstream kernel works while the distro kernel doesn't.

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