Bug 14507

Summary: [855GM] laptop resumes into wrong mode
Product: xorg Reporter: Alexey Kuznetsov <axet>
Component: Driver/intelAssignee: Jesse Barnes <jbarnes>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: michael.fu, shuber
Version: unspecifiedKeywords: NEEDINFO
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
xrandr output
none
xorg.log
none
xorg.conf
none
dmesg
none
broken screen
none
normal screen
none
after boot
none
after resume
none
xlog for intel-git, before suspend none

Description Alexey Kuznetsov 2008-02-14 21:32:19 UTC
Created attachment 14328 [details]
xrandr output

[axet@home-laptop ~]$ lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation 82852/855GM Integrated Graphics Device (rev 02)

[axet@home-laptop ~]$ uname -m
i686

[axet@home-laptop ~]$ rpm -qf /usr/lib/xorg/modules/drivers/intel_drv.so
xorg-x11-drv-i810-2.1.1-7.fc8

[axet@home-laptop ~]$ uname -r
2.6.23.15-137.fc8

[axet@home-laptop ~]$ lsb_release  -a
LSB Version:    :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: Fedora
Description:    Fedora release 8 (Werewolf)
Release:        8
Codename:       Werewolf

ASUS Notebook M3N (http://www.overclockers.com/articles1235/)
Comment 1 Alexey Kuznetsov 2008-02-14 21:32:39 UTC
Created attachment 14329 [details]
xorg.log
Comment 2 Alexey Kuznetsov 2008-02-14 21:32:54 UTC
Created attachment 14330 [details]
xorg.conf
Comment 3 Alexey Kuznetsov 2008-02-14 21:33:14 UTC
Created attachment 14331 [details]
dmesg
Comment 4 Alexey Kuznetsov 2008-02-14 21:50:41 UTC
Created attachment 14332 [details]
broken screen
Comment 5 Alexey Kuznetsov 2008-02-14 21:51:11 UTC
Created attachment 14333 [details]
normal screen
Comment 6 Michael Fu 2008-02-15 01:29:55 UTC
Hi, would you able to test a newer driver, e.g. the 2.2.0.90 which was just released a couple of days ago?
Comment 7 Alexey Kuznetsov 2008-02-16 06:46:56 UTC
That version not yet in Fedora development build, i expect several problems to build driver. Please provide detailed instructions for fedora distrib, thanks.
Comment 9 Michael Fu 2008-02-16 18:08:52 UTC
I'm not familiar with how fedora build package, but would you be able to just pull the source code from repository and build , just for verification.
Comment 10 Alexey Kuznetsov 2008-02-17 01:38:33 UTC
Same problem, do u need additional logs?
Comment 11 Michael Fu 2008-02-17 21:06:37 UTC
thanks, Alex. I see the display mode changed for the two screenshot. Is the system still ok? I mean this bug is just about display mode changed after resume, right?
Comment 12 Alexey Kuznetsov 2008-02-17 21:44:05 UTC
I not shure that is only screen resolution bug. Until i killl X by Ctrl+Alt+Backspacek everyting work fine, after that keys system can stucked.
Comment 13 Wang Zhenyu 2008-03-06 23:05:19 UTC
You should try newer drm modules in 2.6.25-rc4 or drm tree, which take care much of resume problems.
Comment 14 Alexey Kuznetsov 2008-03-07 03:56:33 UTC
Same problem
Comment 15 Wang Zhenyu 2008-03-14 00:27:37 UTC
So the problem is that after suspend-to-ram(?) screen mode changed and busted.

Could you try current master branch of intel driver? We don't know how much change fedora made in its intel driver package.
Comment 16 Alexey Kuznetsov 2008-03-14 01:37:40 UTC
I already try it with: 2.2.0.90. That is not enough?
Comment 17 Jesse Barnes 2008-03-18 18:19:17 UTC
Alexey, yeah sorry we'll need you to test the git version of the Intel driver.  The current rawhide packages have lots of changes so it's best not to use them to track down upstream problems.

Also, to clarify the problem you're seeing:  it looks like on resume your display comes back at a much lower resolution than it should.  Is that right?  Does everything work other than that?

It might help to get some register dumps from before the suspend and afterwards:
  1) before suspend, after VT switching to a text console
  2) before suspend, from X
  3) after resume from a text console (so suspend from text console)
  4) after resume, from X

You'll need the 'intel_reg_dumper' program, it's part of the driver sources in src/reg_dumper.
Comment 18 Michael Fu 2008-03-25 17:31:14 UTC
Alexey, ping for reponse....thanks.
Comment 19 Alexey Kuznetsov 2008-03-25 22:51:00 UTC
Created attachment 15467 [details]
after boot
Comment 20 Alexey Kuznetsov 2008-03-25 22:51:59 UTC
Created attachment 15468 [details]
after resume
Comment 21 Alexey Kuznetsov 2008-03-25 22:52:40 UTC
soory for delay, i looking for new job and dont have enought time for debugging
Comment 22 Jesse Barnes 2008-03-26 11:00:18 UTC
Thanks for the register dumps Alexey.  It looks like they're from X running?  Do you have the corresponding X log?  Were you running the git version of the driver?  You could try this patch:

diff --git a/src/i830_driver.c b/src/i830_driver.c
index d5b260c..9ea14aa 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -2845,7 +2848,7 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc,
     * Also make sure the DRM can handle the swap.
     */
    if (I830LVDSPresent(pScrn) && !IS_I965GM(pI830) && !IS_IGD_GM(pI830) &&
-       (!pI830->directRenderingEnabled ||
+       IS_I9XX(pI830) && (!pI830->directRenderingEnabled ||
        (pI830->directRenderingEnabled && pI830->drmMinor >= 10))) {
        xf86DrvMsg(pScrn->scrnIndex, X_INFO, "adjusting plane->pipe mappings "
                  "to allow for framebuffer compression\n");
Comment 23 Jesse Barnes 2008-03-26 11:00:51 UTC
Ugg, damn mouse keeps making me reassign bugs right before hitting commit.
Comment 24 Alexey Kuznetsov 2008-03-27 04:05:28 UTC
Created attachment 15502 [details]
xlog for intel-git, before suspend
Comment 25 Alexey Kuznetsov 2008-03-27 04:17:13 UTC
Same problem, with patch. After suspend notebook don't wana reboot, and consoles don't work.
Comment 26 Jesse Barnes 2008-03-28 14:01:46 UTC
Alexey, how are you suspending the machine?  Can you try suspending it with just
  $ echo mem > /sys/power/state
rather than closing the lid (if that's what you're doing)?

It's interesting that your boot register dump assigns plane A to pipe B, where LVDS is pointed, and you're not in VGA mode.  If your machine came up in that configuration the driver may have become confused about the current mode...

Are you running any kernel framebuffer drivers like vesafb, uvesafb or intelfb?

Was X running when you captured the "after boot" register dump?
Comment 27 Alexey Kuznetsov 2008-03-29 03:36:18 UTC
for suspend my notebook i press key sequince Fn+F1 that mean "go suspend" on M3N models. i also try your recomendataion "$ echo mem > /sys/power/state" and got same error.

all time i work in X, for dump, and go system to sleep. and don't try to use any consoles and other hackers stuff ;) i don't try to enable framebuffer output, and that drivers not loaded.


i try go my notebook suspend from console after "init 3", and i come back to black screen. but notebook look not dead, i can call commands and reboot it by blind typing "reboot" command in console
Comment 28 Jesse Barnes 2008-05-07 15:52:55 UTC
Alexy, are you still seeing this with the latest 2.6.25 kernel and 2.3.0 Intel driver?
Comment 29 Alexey Kuznetsov 2008-05-08 04:21:16 UTC
same problem with linux/kernel/git/airlied/drm-2.6.git (2.6.26).

two more issues: after resume from sleep i unable to swith to consoles (text consoles, nofb), unable to reboot - system stucked. (one old issues - broken resolution)
Comment 30 Jesse Barnes 2008-05-08 11:32:25 UTC
Please file separate bugs for the new issues you found, also can you attach the X log file from after you resume and you're in the wrong mode?
Comment 31 Alexey Kuznetsov 2008-05-08 11:35:29 UTC
Sorry, i have no idea that is same issue or different one. I think, for now, better keep it here, because one good buf-fix can fix all of them.
Comment 32 Alexey Kuznetsov 2008-05-14 07:01:17 UTC
I switch my notebook to Fedora 9, problem still presents.

X.Org X Server 1.4.99.901

[axet@home-laptop ~]$ lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation 82852/855GM Integrated
Grap
hics Device (rev 02)


[axet@home-laptop ~]$ uname -m
i686


[axet@home-laptop ~]$ rpm -qf /usr/lib/xorg/modules/drivers/vesa_drv.so
xorg-x11-drv-vesa-1.3.0-15.20080404.fc9.i386


[axet@home-laptop ~]$ uname -r
2.6.25-14.fc9.i686



[axet@home-laptop ~]$ lsb_release  -a
LSB Version:   
:core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-no
arch
Distributor ID: Fedora
Description:    Fedora release 9 (Sulphur)
Release:        9
Codename:       Sulphur


ASUS Notebook M3N (http://www.overclockers.com/articles1235/)
Comment 33 Alexey Kuznetsov 2008-05-14 07:09:42 UTC
[axet@home-laptop ~]$ rpm -qf /usr/lib/xorg/modules/drivers/i810_drv.so
xorg-x11-drv-i810-2.2.1-24.fc9.i386
Comment 34 Jesse Barnes 2008-05-21 13:38:25 UTC
I'm a little stuck on this one, Alexy.  Can you attach a log file that includes a suspend/resume cycle?  E.g. start your machine, start X, put it to sleep, wake it up, then attach the X log?  I'm not seeing any VT switch events in the other logs, so I can't tell what's going on after the machine wakes up.

Thanks,
Jesse
Comment 35 Alexey Kuznetsov 2008-05-21 15:09:05 UTC
One more problem, i can't run test with git version of intel driver anymore. Fedora 9 switched to last Xserver, and git intel not compatible with Xorg-1.4.99. I got some X error out put.
Comment 36 Gordon Jin 2008-06-28 21:32:25 UTC
Alexey, if you are not able to use git driver, could you try xf86-video-intel 2.3.2?
For kernel, better try a recent rc kernel (>=2.6.26-rc6).
Comment 37 Alexey Kuznetsov 2008-06-29 02:58:22 UTC
when i tyr to build git version of intel driver i got error:

checking for mprotect... yes
./configure: line 20868: syntax error near unexpected token `XINERAMA,'
./configure: line 20868: `XORG_DRIVER_CHECK_EXT(XINERAMA, xineramaproto)'
[axet@home-laptop xf86-video-intel]$ 


xorg-x11-server-Xorg-1.4.99.902-3.20080612.fc9.i386
kernel-2.6.25.6-55.fc9.i686
Comment 38 Alexey Kuznetsov 2008-06-29 13:30:35 UTC
missing package xorg-x11-server-sdk.

try to build kernel & intel...
Comment 39 Alexey Kuznetsov 2008-06-29 13:41:02 UTC
2.6.25.6-55.fc9.i686 +  xf86-video-intel-2.3.2

X.Org X Server 1.4.99.902 (1.5.0 RC 2)
Release Date: 5 September 2007
X Protocol Version 11, Revision 0
Build Operating System: Linux 2.6.18-53.1.19.el5 i686 
Current Operating System: Linux home-laptop 2.6.25.6-55.fc9.i686 #1 SMP Tue Jun 10 16:27:49 EDT 2008 i686
Build Date: 12 June 2008  01:05:58AM
Build ID: xorg-x11-server 1.4.99.902-3.20080612.fc9 
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Module Loader present
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Mon Jun 30 00:36:42 2008
(==) Using config file: "/etc/X11/xorg.conf"

Fatal server error:
Couldn't bind memory for BO front buffer
Comment 40 Alexey Kuznetsov 2008-06-29 16:12:44 UTC
with git-kernel and intel 2.3.2. x start fine. when i try to suspend/resume my notebook i got same error as in begin.

two more things:

when i resume notebook i can switch to first console then to 7 console and see normal screen.
when i try to switch to console 1 i can see only blank screen (no fb)
when i try to reboot my machine they switch to console 1 (normal process) and stuck with black screen. propably with some error message or ooops. 
Comment 41 Jesse Barnes 2008-08-20 13:13:22 UTC
Does the black screen on resume problem still happen with the latest kernel and the i915 driver loaded?  Let's confirm a few things with the latest kernel and intel driver loaded:
  1) that after booting into text mode (run level 3), loading the i915 DRM driver and doing echo mem > /sys/power/state allows you to suspend/resume properly
  2) after doing the same as the above, but from a "startx" session just running xterm

If (1) fails we have to fix that first, or suspend/resume won't ever work right for you.  It sounds like that's what was happening based on your last message.

This could also be related to video POSTing in your distro's suspend/resume scripts.  If the raw "echo mem > /sys/power/state" works but the distro's suspend scripts don't work that could be the culprit (though I think recent Fedora updates have fixed that).
Comment 42 Alexey Kuznetsov 2008-08-20 20:34:23 UTC
Good news!

With kernel 2.6.26.3 and i915 driver loaded i have no more blackscreen and squished resolution bugs!


But i still have the last one. When system gooing to reboot and i can see final stage of rebooting:

"System rebooted."

How i can see output from kernel, no oops or crashes.

Instead of POST i can hear cooler WOOOOOO sound (100 cpu load) and no keyboard activity (no capslock). To finaly reboot system i must keep power button for 5 sec.
Comment 43 Jesse Barnes 2008-08-20 22:32:04 UTC
Great!  I'll close this one out then.

As for your reboot bug, it sounds like ACPI might be buggy on your platform (or whatever you're using for reboot anyway).  There are a few different reboot options you can try, but a hang at reboot is a more general kernel problem, so you should probably file a bug a bugzilla.kernel.org for that.  FYI, here are some options from the x86 reboot.c file, just boot your kernel with "reboot=<option>" from grub or lilo:

/* reboot=b[ios] | s[mp] | t[riple] | k[bd] | e[fi] [, [w]arm | [c]old]
   warm   Don't set the cold reboot flag
   cold   Set the cold reboot flag
   bios   Reboot by jumping through the BIOS (only for X86_32)
   smp    Reboot by executing reset on BSP or other CPU (only for X86_32)
   triple Force a triple fault (init)
   kbd    Use the keyboard controller. cold reset (default)
   acpi   Use the RESET_REG in the FADT
   efi    Use efi reset_system runtime service
   force  Avoid anything that could hang.
 */

So you could try reboot=acpi, reboot=kbd, reboot=bios or something, maybe one of them will work for you.
Comment 44 Alexey Kuznetsov 2008-08-26 09:22:04 UTC
I seen that screen again. I problems comeback one more time i reponen this bug.
Comment 45 Alexey Kuznetsov 2008-08-27 08:11:25 UTC
my mom choise wrong kernel on boot :D

fedora kernel build 2.6.26.3 still have this bug.

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.