Bug 28988

Summary: xf86RandR12EnterVT overwrites xf86Screens screen ENterVt
Product: xorg Reporter: Alban Browaeys <prahal>
Component: Server/GeneralAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: major    
Priority: medium CC: daniel
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
hack to prevent the randr entervt overwriting the chain.
none
fix glx enter/leavevt wrapping none

Description Alban Browaeys 2010-07-09 09:46:08 UTC
Created attachment 36921 [details] [review]
hack to prevent the randr entervt overwriting the chain.

The fix faeebead7bfcc78535757ca7acc1faf7554c03b7 has the side effect of overwriting any current top EnterVt withrandr one.
Ie here glx EnterVT calls randr one which replace glx entervt at the top of the chain by its own Asd glx was intitialized after randr the orig_EnterVt trick does not help and removes glx from the entervt chain..
I hope this workaround does nto revert the bug the bogus commit was meant to fix.
I bet the whole orig_EnterVt trick is at fault and structure around the current screen the way glx does is the way to go.

If you agree with the latter I will make an initial work on that this week end.
Current workaround is :

diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index 043ceee..7880cfa 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -1778,10 +1778,9 @@ xf86RandR12EnterVT (int screen_index, int flags)
     Bool            ret;
 
     if (randrp->orig_EnterVT) {
-       pScrn->EnterVT = randrp->orig_EnterVT;
-       ret = pScrn->EnterVT (screen_index, flags);
-       randrp->orig_EnterVT = pScrn->EnterVT;
-       pScrn->EnterVT = xf86RandR12EnterVT;
+       ret = randrp->orig_EnterVT (screen_index, flags);
+       if (pScrn->EnterVT == randrp->orig_EnterVT)
+           pScrn->EnterVT = xf86RandR12EnterVT;
        if (!ret)
            return FALSE;
     }
Comment 1 Daniel Stone 2010-07-09 10:07:49 UTC
Created attachment 36922 [details] [review]
fix glx enter/leavevt wrapping

Actually, RandR was completely correct, and GLX broken for not even bothering to rewrap.  Does the attached patch fix it?
Comment 2 Alban Browaeys 2010-07-13 07:02:44 UTC
(In reply to comment #1)
> Created an attachment (id=36922) [details]
> fix glx enter/leavevt wrapping
> 
> Actually, RandR was completely correct, and GLX broken for not even bothering
> to rewrap.  Does the attached patch fix it?

Yes it does. Sorry for the lag. 
Thank you for the review and proper fix.
Comment 3 Alban Browaeys 2012-03-19 17:02:10 UTC
I forgot to close the bug. Doing so.

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.