From 7314d16cde4c3f99d9d9f1d539f0c5ff4942e653 Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Wed, 15 Mar 2006 03:18:42 +0000 Subject: [PATCH] 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 --- ChangeLog | 11 +++++++++++ hw/xfree86/dri/dri.c | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d462edabb..bbcb66ab3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2006-03-15 Benjamin Herrenschmidt + + * 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 * hw/xfree86/common/xf86fbman.c: (localAllocateOffscreenLinear): diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c index 8003f0df5..8ac66fdc5 100644 --- a/hw/xfree86/dri/dri.c +++ b/hw/xfree86/dri/dri.c @@ -582,7 +582,7 @@ DRIExtensionInit(void) int i; ScreenPtr pScreen; - if (DRIScreenPrivIndex < 0) { + if (DRIScreenPrivIndex < 0 || DRIGeneration != serverGeneration) { return FALSE; }