From b804c1223a00d9b046158a5ca5c98c0e18fe624a Mon Sep 17 00:00:00 2001 From: Tiago Vignatti Date: Wed, 12 May 2010 13:21:12 +0300 Subject: [PATCH] xfree86: vgaarb: disable VGA decoding after POST In general Xorg doesn't need to have VGA decoding enabled while displaying a graphics mode. The idea is to disable VGA decoding when X is in the OPERATING state. We might want to undo if X switched back out to a text console, doing VT switch. Therefore, calling xf86VGAarbiterDeviceDecodes here will decrease the cards refcount in a way that xf86VGAarbiterWrapFunctions will return before the actual wrapping functions are set. (xf86VGAarbiterWrapFunctions is a total failure. It's totally prone to deadlocks everywhere. In theory all screen procedures inside ScreenRec should have a 1:1 mapping with the ones in VGAarbiterScreenRec. For instance, if I'd be calling VGAarbiterCreatePixmap, then in the theory, I should call VGAarbiterDestroyPixmap either, which is not being the case now. Victory!) Signed-off-by: Tiago Vignatti --- hw/xfree86/common/xf86Init.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index db88f70..2cbde8d 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -792,6 +792,14 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) xf86Info.disableRandR ? "disabled" : "enabled"); #endif } + /* + * In general Xorg doesn't need to have VGA decoding enabled while + * displaying a graphics mode. The idea is to disable VGA decoding when X is + * in the OPERATING state. We might want to undo if X switched back out to a + * text console, doing VT switch. Thus, disables VGA decoding after POST it. + */ + for (i = 0; i < xf86NumScreens; i++) + xf86VGAarbiterDeviceDecodes(xf86Screens[i], VGA_ARB_RSRC_NONE); xf86PostScreenInit(); -- 1.6.0.4