Fix DRIExtensionInit() to not register callbacks when it hasn't been

initialized for the current server generation. Fixes a problem where it
    would use stale private index and blow up in colorful ways if no driver
    called DRIScreenInit() on the second generation (which happens due to a
    bug in radeon that i'll fix separately). Note: clearing the index in
    DRIReset() wouldn't work as DRIReset() is called before the
    CloseScreen() chain
This commit is contained in:
Benjamin Herrenschmidt 2006-03-15 03:18:42 +00:00
parent 02d80a0de9
commit 7314d16cde
2 changed files with 12 additions and 1 deletions

View File

@ -1,3 +1,14 @@
2006-03-15 Benjamin Herrenschmidt <benh@kernel.crashing.org>
* hw/xfree86/dri/dri.c: (DRIExtensionInit):
Fix DRIExtensionInit() to not register callbacks when it hasn't been
initialized for the current server generation. Fixes a problem where
it would use stale private index and blow up in colorful ways if no
driver called DRIScreenInit() on the second generation (which happens
due to a bug in radeon that i'll fix separately). Note: clearing the
index in DRIReset() wouldn't work as DRIReset() is called before the
CloseScreen() chain
2006-03-15 Benjamin Herrenschmidt <benh@kernel.crashing.org>
* hw/xfree86/common/xf86fbman.c: (localAllocateOffscreenLinear):

View File

@ -582,7 +582,7 @@ DRIExtensionInit(void)
int i;
ScreenPtr pScreen;
if (DRIScreenPrivIndex < 0) {
if (DRIScreenPrivIndex < 0 || DRIGeneration != serverGeneration) {
return FALSE;
}