Bug 11305

Summary: [855GM] display corruption when switching to text console
Product: xorg Reporter: Samuel Thibault <samuel.thibault>
Component: Driver/intelAssignee: Jesse Barnes <jbarnes>
Status: VERIFIED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: danielllano, michael.fu
Version: git   
Hardware: Other   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 13027, 15000    
Attachments:
Description Flags
X.org log
none
xorg 7.3~rc1 intel 855gm driver 2.1.1 mouse cursor garbled on text console
none
xorg 7.3~rc1 intel 855gm driver 2.1.1 mouse cursor garbled on text console X.org log
none
xorg 7.3 intel 855gm driver 2.2.0.90 mouse cursor garbled on text console X.org log
none
dump at startup before X starts
none
dump after X starts
none
dump after VT switching back to a console from X
none
X log up to VT switch
none
dump after patched X starts
none
dump after VT switching back to a console from patched X
none
patched X log up to VT switch
none
screenshot of the artifact
none
Wait for vblank after disabling cursor
none
Log with patch 16368
none
Save/restore cursor state none

Description Samuel Thibault 2007-06-18 14:48:46 UTC
If for instance I start a bare X, and immediately switch to the first text console, I have a graphical cursor in the bottom-right corner of the screen. It of course doesn't move, but it hides text, and if I kill X and start doing other things, the shape changes randomly and thus hides yet more text :)

This is the git version of today of intel driver, my xorg.conf doesn't have any particular video option.
Comment 1 Samuel Thibault 2007-06-18 14:49:45 UTC
Created attachment 10367 [details]
X.org log
Comment 2 Samuel Thibault 2007-06-19 01:02:32 UTC
Note: I'm using a 8x8 font on the console, hence 80x50 text mode.
Comment 3 danielllano 2007-07-07 04:02:25 UTC
I am using a:
00:02.0 VGA compatible controller: Intel Corporation 82852/855GM Integrated Graphics Device (rev 02)
I am running:
xserver-xorg-video-intel_2.1.0-1 (2007-07-02)

I also happen to see the text cursor on the text console.

And if I log in xdm and change to text console while GNOME is loading it switches to a black screen with the hardware cursor on it.
Comment 4 Gordon Jin 2007-08-07 00:55:32 UTC
I'm not able to reproduce this problem with upstream driver.
Comment 5 Samuel Thibault 2007-08-07 02:33:25 UTC
I am still having the problem with git version of this morning. Some more information that migh be important: I'm booting the kernel with vga=extended and use an 8x8 font. This is on a Dell Latitude X300 laptop with no external CRT, just the internal panel (if I plug an external CRT the problem doesn't appear).  00:02.0 VGA compatible controller: Intel Corporation 82852/855GM Integrated Graphics Device (rev 02) 
Comment 6 Gordon Jin 2007-08-07 06:29:32 UTC
How about if you don't use vga=extended?
Comment 7 Samuel Thibault 2007-08-07 10:00:57 UTC
Without vga=extended and loading a usual 8x16 fonts, the problem is still there. 
Comment 8 danielllano 2007-08-24 13:08:35 UTC
Created attachment 11258 [details]
xorg 7.3~rc1 intel 855gm driver 2.1.1 mouse cursor garbled on text console
Comment 9 danielllano 2007-08-24 13:12:46 UTC
Created attachment 11259 [details]
xorg 7.3~rc1 intel 855gm driver 2.1.1 mouse cursor garbled on text console X.org log
Comment 10 Michael Fu 2007-09-27 18:53:55 UTC
we still can't reproduce this bug....:(   please feel free to reopen if it still bothers you.
Comment 11 Samuel Thibault 2007-09-27 19:24:26 UTC
I've just upgraded my server to 1.4.0, pulled the intel driver git, and... I still can reproduce this bug....:( 
Comment 12 Samuel Thibault 2007-09-27 19:25:54 UTC
(pulled git up to bbf69c7446aa9748dacecccfe0b63d803f865b00)
Comment 13 Gordon Jin 2007-11-15 01:04:08 UTC
There have been some VT patches committed in git recently. Could you retest with the git tip?
Comment 14 Samuel Thibault 2007-11-15 20:36:59 UTC
Seems to be fixed, great!
Comment 15 danielllano 2008-02-09 11:36:36 UTC
Created attachment 14243 [details]
xorg 7.3 intel 855gm driver 2.2.0.90 mouse cursor garbled on text console X.org log

I can see the same glitch in the text console with the 2.2.0.90-3 driver using X.Org 1.4.1~git20080131-1 from Debian.
Comment 16 danielllano 2008-02-09 11:38:15 UTC
I am reopening this bug as it seems it is not fixed.
I also sometimes see minor text console font corruption.
Comment 17 Samuel Thibault 2008-02-11 03:16:42 UTC
Same behavior here with git 8c8ca16120927fc2d3cf8bcd5212a4227a280708, same symptoms as before.
Comment 18 Gordon Jin 2008-02-14 00:28:00 UTC
Samuel, do you mean it's fixed with git around 2007-11-15 (in comment#14), but re-appears with the latest git?
Comment 19 Samuel Thibault 2008-02-14 02:03:49 UTC
Yes.  When I have the time, I'll try to bisect it.
Comment 20 Michael Fu 2008-02-20 16:49:15 UTC
Samuel, any update?
Comment 21 Samuel Thibault 2008-02-22 16:47:22 UTC
I still don't have time to do this :)

I'll probably have it next week.
Comment 22 Michael Fu 2008-02-29 16:10:18 UTC
(In reply to comment #16)
> I am reopening this bug as it seems it is not fixed.
> I also sometimes see minor text console font corruption.
> 

Daniel, are you able to help us to confirm the latest status on git repository on your machine? thanks.
Comment 23 Samuel Thibault 2008-03-16 06:03:37 UTC
bisect showed that this bug was reintroduced in f69b48fe24ef94dac44b8123884ca71df675be4b
Comment 24 Jesse Barnes 2008-03-18 19:07:17 UTC
Ok, interesting.  Thanks for bisecting.  I'll have to double check the LeaveVT code and make sure we're doing everything in the right order for 855 chips...
Comment 25 Jesse Barnes 2008-03-19 16:17:46 UTC
Samuel, can you capture some register dumps with the latest git tree (assuming it still fails for you).  You can use the 'intel_reg_dumper' tool from src/reg_dumper in the tree to grab them.  I'd like to see:
  - at startup before X starts
  - after X starts
  - after VT switching back to a console from X
Also please attach the X log from all of this, with the "modedebug" option enabled in your intel driver section.

Thanks,
Jesse
Comment 26 Samuel Thibault 2008-03-19 16:34:50 UTC
Created attachment 15315 [details]
dump at startup before X starts
Comment 27 Samuel Thibault 2008-03-19 16:35:13 UTC
Created attachment 15316 [details]
dump after X starts
Comment 28 Samuel Thibault 2008-03-19 16:35:36 UTC
Created attachment 15317 [details]
dump after VT switching back to a console from X
Comment 29 Samuel Thibault 2008-03-19 16:36:34 UTC
Created attachment 15318 [details]
X log up to VT switch
Comment 30 Jesse Barnes 2008-03-19 16:40:10 UTC
Thanks.  I don't suppose this patch helps by itself?

--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -2024,7 +2024,7 @@ SaveHWState(ScrnInfoPtr pScrn)
    }

    vgaHWUnlock(hwp);
-   vgaHWSave(pScrn, vgaReg, VGA_SR_FONTS);
+   vgaHWSave(pScrn, vgaReg, VGA_SR_ALL);

    return TRUE;
 }
@@ -2233,7 +2233,7 @@ RestoreHWState(ScrnInfoPtr pScrn)
        OUTREG(FBC_CONTROL, pI830->saveFBC_CONTROL);
    }

-   vgaHWRestore(pScrn, vgaReg, VGA_SR_FONTS);
+   vgaHWRestore(pScrn, vgaReg, VGA_SR_ALL);
    vgaHWLock(hwp);

    return TRUE;
Comment 31 Samuel Thibault 2008-03-19 16:49:09 UTC
Created attachment 15319 [details]
dump after patched X starts
Comment 32 Samuel Thibault 2008-03-19 16:49:56 UTC
Created attachment 15320 [details]
dump after VT switching back to a console from patched X
Comment 33 Samuel Thibault 2008-03-19 16:50:30 UTC
Created attachment 15321 [details]
patched X log up to VT switch
Comment 34 Samuel Thibault 2008-03-19 16:51:21 UTC
Still the same symptoms yes.
Comment 35 Jesse Barnes 2008-03-19 18:30:47 UTC
Ok, thanks.  I went through our restore code again and it seems like we're following the rules, but I'm obviously missing something.  I'll check again.  Btw, do you have a picture of what your text console looks like when you switch to it?
Comment 36 Samuel Thibault 2008-03-19 18:46:47 UTC
Created attachment 15323 [details]
screenshot of the artifact

Here is a screenshot. Notice the cursor-shaped artifact at the bottom right of the screen, covering some of the 'a's I have typed.
Comment 37 Wang Zhenyu 2008-03-25 00:27:57 UTC
I did see same screen like in comment #8, but can't reproduce it now.

Could you try current master tip or 2.2.99.901 driver?
Comment 38 Samuel Thibault 2008-03-25 05:03:39 UTC
Still there with c02ab432dd7058c700c35eecf6215daf5f262c51
Comment 39 danielllano 2008-03-29 09:06:55 UTC
(In reply to comment #36)
> Here is a screenshot. Notice the cursor-shaped artifact at the bottom right of
> the screen, covering some of the 'a's I have typed.

I also have the exact same artifact at the bottom right of the screen with current driver.
I also think this bug may be related to the random lock up of my laptop when I switch to the text console.
I would like to have this bug fixed. How may I help?
Comment 40 Jesse Barnes 2008-03-29 11:26:42 UTC
I don't have any new test patches yet, but once I do (hopefully next week) you can help out by testing.  Thanks.
Comment 41 Jesse Barnes 2008-05-05 16:36:59 UTC
Created attachment 16368 [details] [review]
Wait for vblank after disabling cursor

Can you give this patch a shot?  It fixes what I think are a couple of bugs in our VT switch code, and adds a vblank wait to the cursor disable path, which I think is necessary.
Comment 42 Samuel Thibault 2008-05-05 17:38:08 UTC
Created attachment 16371 [details]
Log with patch 16368

Still no luck :/
Comment 43 Samuel Thibault 2008-05-05 17:39:04 UTC
Still exactly the same behavior
Comment 44 Jesse Barnes 2008-05-07 10:29:11 UTC
Created attachment 16412 [details] [review]
Save/restore cursor state

Ok, I think we need to enable/disable both cursor planes on your machine for some reason.  Can you give this patch a try?  It should at least return things to the way we found them at VT switch/exit time...
Comment 45 Samuel Thibault 2008-05-07 12:31:13 UTC
Yes, it does work!

(while git tip a7188b1f2dd9a69fa7daefe478d283735226f9f3 does not)
Comment 46 Jesse Barnes 2008-05-07 14:48:51 UTC
Well that only took, what, about a year to fix? :)  Thanks for your patience and testing, Samuel, I pushed the fix as 33f033cbf346c13a687e469e8879579fcd5bb2fb.
Comment 47 danielllano 2008-05-21 08:38:34 UTC
The patch seems to fix the mouse pointer on text console problem. Great!

But I still see occasional text console minor font corruption.

Samuel, Could you confirm you are not seeing any text console minor font corruption?
Comment 48 Samuel Thibault 2008-05-21 16:29:23 UTC
It is quite rare and can be fixed by reloading the font, but I indeed
sometimes see that (it impacts a few letters only for instance).
Comment 49 danielllano 2008-05-22 02:08:41 UTC
(In reply to comment #48)
> It is quite rare and can be fixed by reloading the font, but I indeed
> sometimes see that (it impacts a few letters only for instance).

Since you can confirm it, should we reopen or file a new bug report? (I do not know if it is related to the original cause of this bug)
Comment 50 Samuel Thibault 2008-05-22 02:39:07 UTC
It looks to me like the font issue is not related to the cursor issue,
so a new bug should be opened.

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.