On Fri, 5 Jul 2002, Jens Owen wrote:

> Leif Delgass wrote:
> 
> > The backtrace from the static server was the same.  BTW, this might help
> > others trying to debug with a dynamic server:  I removed 'Load "GLcore"'
> > from my XF86Config, because I saw that it was being reloaded by the glx
> > module anyway.  Before I did that, I was getting a backtrace that was
> > wrong -- it said something about mipmaps, so I was suspicious :)
> 
> 
> Hmmm, I was wondering how you got such nice line numbers from the back 
> trace of a dynamic server.  I'm also guessing you have the version of 
> gdb with the XFree86 module support.

Oh yeah, I keep forgetting that I installed that. ;)

[...] 
> >>Okay, try the attached patch.  I think I'll do more than this, but it 
> >>would be great if you could test just this, first.
> >>
> > 
> > OK, thanks.  I let you know how it goes.

With one change, this fixes the problem.  The AdjustFrame wrapper was 
already dealt with at the beginning of the function and 
pDRIPriv->wrap.AdjustFrame was set to NULL, so pScrn->AdjustFrame was 
getting NULL when the wrapper was removed the second time.  I just removed 
the first bit of code and kept yours grouped with the other new 
"unwrappings."  The modified patch is attached.  I'll apply this to the 
mach64 branch, but I'll let you patch the trunk.  Thanks for your help!

-- 
Leif Delgass 
http://www.retinalburn.net
Index: xc/programs/Xserver/GL/dri/dri.c
===================================================================
RCS file: /cvsroot/dri/xc/xc/programs/Xserver/GL/dri/dri.c,v
retrieving revision 1.37.20.1
diff -u -r1.37.20.1 dri.c
--- xc/programs/Xserver/GL/dri/dri.c    27 Jun 2002 22:04:20 -0000      1.37.20.1
+++ xc/programs/Xserver/GL/dri/dri.c    5 Jul 2002 23:58:19 -0000
@@ -417,16 +417,13 @@
 DRICloseScreen(ScreenPtr pScreen)
 {
     DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+    DRIInfoPtr       pDRIInfo;
     drmContextPtr    reserved;
     int              reserved_count;
 
     if (pDRIPriv && pDRIPriv->directRenderingSupport) {
 
-       if (pDRIPriv->wrap.AdjustFrame) {
-           ScrnInfoPtr pScrn          = xf86Screens[pScreen->myNum];
-           pScrn->AdjustFrame         = pDRIPriv->wrap.AdjustFrame;
-           pDRIPriv->wrap.AdjustFrame = NULL;
-       }
+        pDRIInfo = pDRIPriv->pDriverInfo;
 
        if (pDRIPriv->pDriverInfo->driverSwapMethod != DRI_KERNEL_SWAP) {
            if (!drmRemoveSIGIOHandler(pDRIPriv->drmFD)) {
@@ -476,6 +473,27 @@
        }
 
        drmClose(pDRIPriv->drmFD);
+
+       /* Unwrap DRI Functions */
+       if (pDRIInfo->wrap.ValidateTree) {
+           pScreen->ValidateTree = pDRIPriv->wrap.ValidateTree;
+               }
+       if (pDRIInfo->wrap.PostValidateTree) {
+           pScreen->PostValidateTree = pDRIPriv->wrap.PostValidateTree;
+       }
+       if (pDRIInfo->wrap.WindowExposures) {
+           pScreen->WindowExposures = pDRIPriv->wrap.WindowExposures;
+       }
+       if (pDRIInfo->wrap.CopyWindow) {
+           pScreen->CopyWindow = pDRIPriv->wrap.CopyWindow;
+       }
+       if (pDRIInfo->wrap.ClipNotify) {
+           pScreen->ClipNotify = pDRIPriv->wrap.ClipNotify;
+       }
+       if (pDRIInfo->wrap.AdjustFrame) {
+           ScrnInfoPtr pScrn          = xf86Screens[pScreen->myNum];
+           pScrn->AdjustFrame         = pDRIPriv->wrap.AdjustFrame;
+       }
 
        xfree(pDRIPriv);
        pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL;

Reply via email to