Bug 28988 - xf86RandR12EnterVT overwrites xf86Screens screen ENterVt
Summary: xf86RandR12EnterVT overwrites xf86Screens screen ENterVt
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/General (show other bugs)
Version: git
Hardware: Other All
: medium major
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-09 09:46 UTC by Alban Browaeys
Modified: 2012-03-19 17:02 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
hack to prevent the randr entervt overwriting the chain. (655 bytes, patch)
2010-07-09 09:46 UTC, Alban Browaeys
no flags Details | Splinter Review
fix glx enter/leavevt wrapping (3.20 KB, patch)
2010-07-09 10:07 UTC, Daniel Stone
no flags Details | Splinter Review

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.