Bug 14423 - [945GM] restricted gl in dualhead after VT switch
Summary: [945GM] restricted gl in dualhead after VT switch
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Michael Fu
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords: NEEDINFO, regression
Depends on:
Blocks:
 
Reported: 2008-02-08 08:20 UTC by Tomas Janousek
Modified: 2009-05-08 06:33 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
reproducer (426 bytes, text/plain)
2008-02-08 08:20 UTC, Tomas Janousek
no flags Details
xorg.log (39.41 KB, text/plain)
2008-03-10 16:57 UTC, Tomas Janousek
no flags Details
xorg.conf (4.11 KB, text/plain)
2008-03-10 16:58 UTC, Tomas Janousek
no flags Details
test output (1.82 KB, text/plain)
2008-03-10 16:59 UTC, Tomas Janousek
no flags Details
xrandr output in broken case (6.75 KB, application/octet-stream)
2008-04-26 06:55 UTC, Tomas Janousek
no flags Details
xorg.log (53.63 KB, application/octet-stream)
2008-04-26 06:55 UTC, Tomas Janousek
no flags Details
uDRI1: Update sarea (and other information) when CRTC configuration changes. (673 bytes, patch)
2008-12-05 13:09 UTC, Eric Anholt
no flags Details | Splinter Review

Description Tomas Janousek 2008-02-08 08:20:17 UTC
Created attachment 14215 [details]
reproducer

After using dualhead for a while, switching back to single, switching to console and back and switching to dualhead again, GL apps work in a limited rectange in the top left corner of the screen.

I have a HP Compaq nx7300 notebook (1280x800 display), an LCD (1280x1024) connected to its VGA output.

I have xserver-xorg-core 2:1.4.1~git20080131-1 and todays (2008-02-08) git of intel driver. I'm not sure when this broke, but 2.1.1 works quite well (well, patched for the VT switch hang and brightness).

I'm attaching a reproducer, which is to be run as "startx ./test.sh".
Comment 1 Gordon Jin 2008-02-13 23:21:53 UTC
What's the mesa version you are using? Please attach xorg.conf and Xorg.0.log.
Comment 2 Michael Fu 2008-02-29 16:49:52 UTC
Tomas, any response?
Comment 3 Tomas Janousek 2008-03-10 16:57:15 UTC
Created attachment 15017 [details]
xorg.log
Comment 4 Tomas Janousek 2008-03-10 16:58:00 UTC
Created attachment 15018 [details]
xorg.conf
Comment 5 Tomas Janousek 2008-03-10 16:59:27 UTC
Created attachment 15019 [details]
test output

This is the output of test.sh.
"DRM_I830_CMDBUFFER: -22" seems suspicious.

I'm using the mesa which's in debian testing, that is
OpenGL version string: 1.3 Mesa 7.0.3-rc2
Comment 6 Gordon Jin 2008-03-10 18:55:20 UTC
Fengming, can you reproduce this on 945GM, with the first attached script?
Comment 7 Pi, Fengming 2008-03-10 19:58:00 UTC
(In reply to comment #6)
> Fengming, can you reproduce this on 945GM, with the first attached script?
> 

I using the latest git code and can not reproduce this problem.After running the script in comment #1, I still can pull or push glxgears to any place on my screen.
Comment 8 Gordon Jin 2008-03-11 18:52:06 UTC
Tomas, can you post the xrandr output in the broken case?
Comment 9 Michael Fu 2008-04-01 19:53:31 UTC
ping response from bug reporter.
Comment 10 Gordon Jin 2008-04-08 19:02:47 UTC
Without needinfo I'll have to close this as we're not able to reproduce.
Comment 11 Tomas Janousek 2008-04-26 06:55:07 UTC
Created attachment 16193 [details]
xrandr output in broken case
Comment 12 Tomas Janousek 2008-04-26 06:55:27 UTC
Created attachment 16194 [details]
xorg.log
Comment 13 Tomas Janousek 2008-04-26 07:05:18 UTC
I'm sorry for the late reply, but I simply didn't have time to shut down my X server and do all this testing. But I finally got to it.

I attached the output you wanted, I attached new xorg.log. As of now, I was doing the tests on kernel 2.6.25, xserver 2:1.4.1~git20080131-3 (from debian), intel driver 2:2.3.0-1 (from debian), mesa 7.3.0 (libgl1-mesa-dri 7.0.3-1 from debian, for example). Still not working though.

So I decided to bisect it and I ended up with the first bad commit being 4ca3550fb7d488741f8dc1ba3c8722393277c3b8 (Rework DRI buffer mappings and sarea setup to allow for moving buffers.). I hope this helps.

Just a note... Most of the time, I was just getting a black window when I resized it to cover both screens. Just one times it wrote that "DRM_I830_CMDBUFFER: -22" message and logged something to dmesg:
[drm:i915_emit_box] *ERROR* Bad box 383,803..683,800
[drm:i915_cmdbuffer] *ERROR* i915_dispatch_cmdbuffer failed
Comment 14 Gordon Jin 2008-04-26 22:08:03 UTC
So the reporter says it's introduced by this commit:

4ca3550fb7d488741f8dc1ba3c8722393277c3b8
Author: Eric Anholt <eric@anholt.net>
Date:   Thu Oct 4 17:02:15 2007 -0700

    Rework DRI buffer mappings and sarea setup to allow for moving buffers.
    
    While this has been a desired feature for some time, to allow for reallocation
    of the front buffer, it was made more necessary by the desire to avoid
    requiring a NO_MOVE buffer type in TTM because buffer objects may not be left
    pinned over VT switch.  This is a step towards making those buffers
    movable and resizable.
Comment 15 Tomas Janousek 2008-06-16 13:50:46 UTC
I looked into this a little bit. pScrn->virtualY is 2048 at server init, but it is set to current screen height later. Since i830_update_dri_buffers is called only in I830EnterVT, after switching to dualhead one has to switch to console and back to X to get buffers mapped and for GL to work for whole screen. I have no idea why it works for you though.

Commenting out the call to i830_update_dri_buffers in I830EnterVT seems like a great workaround for me, but I'd like you to look at why this happens. Thanks :)
Comment 16 Eric Anholt 2008-12-05 13:09:13 UTC
Created attachment 20845 [details] [review]
uDRI1: Update sarea (and other information) when CRTC configuration changes.

Does this patch fix the issue?  (only build tested on my end)
Comment 17 Wang Zhenyu 2009-01-11 22:54:10 UTC
Could we verify if Eric's patch is valid to fix this issue?
Comment 18 Tomas Janousek 2009-01-12 00:07:44 UTC
I'll get to that in a week or so, I have no monitor here.
Comment 19 Michael Fu 2009-01-31 23:15:15 UTC
(In reply to comment #18)
> I'll get to that in a week or so, I have no monitor here.
> 

ping...
Comment 20 Eric Anholt 2009-02-21 10:05:49 UTC
I really think that this patch should have fixed the problem, so closing it until we get some word that it didn't.
Comment 21 Eric Anholt 2009-03-06 16:54:31 UTC
oops, hadn't pushed it:

commit 73aa23d9150121a4e4b70a78cab910acd164abf5
Author: Eric Anholt <eric@anholt.net>
Date:   Fri Dec 5 13:06:05 2008 -0800

    DRI1: Update sarea (and other information) when CRTC configuration changes.
    
    Bug #14423.
    
    Signed-off-by: Eric Anholt <eric@anholt.net>\
Comment 22 Tomas Janousek 2009-05-08 06:33:17 UTC
Sorry guys for not replying, I've been quite busy lately, but finally got some time to play with X again. I upgraded to 2.7.0 yesterday and this seems to be fixed, so thanks.

(I feel shame for promising a reply and replying months later, but having a workaround and being busy didn't really push me to test and answer. As an apology, I spent a few hours yesterday debugging another issue (bug 21632) and I hope I've filed a great bugreport :).)

Thanks again.


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.