r128, radeon, r200: Check ctx->WinSysDrawBuffer before calling function that derefere...
authorRoland Scheidegger <sroland@tungstengraphics.com>
Tue, 27 Mar 2007 14:22:00 +0000 (16:22 +0200)
committerRoland Scheidegger <sroland@tungstengraphics.com>
Tue, 27 Mar 2007 14:22:00 +0000 (16:22 +0200)
Same fix as for r300 (which fixed https://bugs.freedesktop.org/show_bug.cgi?id=10417),
since it's likely an issue with those drivers too.

src/mesa/drivers/dri/r128/r128_lock.c
src/mesa/drivers/dri/r200/r200_lock.c
src/mesa/drivers/dri/radeon/radeon_lock.c

index 393dd1ed74c90bb344a0e587a92929076b8573d4..ea23b007f3303c47c14be0bded398b80d4b90c15 100644 (file)
@@ -52,8 +52,10 @@ static void
 r128UpdatePageFlipping( r128ContextPtr rmesa )
 {
    rmesa->doPageFlip = rmesa->sarea->pfAllowPageFlip;
-   driFlipRenderbuffers(rmesa->glCtx->WinSysDrawBuffer,
-                        rmesa->sarea->pfCurrentPage);
+   if (rmesa->glCtx->WinSysDrawBuffer) {
+      driFlipRenderbuffers(rmesa->glCtx->WinSysDrawBuffer,
+                           rmesa->sarea->pfCurrentPage);
+   }
    rmesa->new_state |= R128_NEW_WINDOW;
 }
 
index 9ffdb2b212770ee9d9c3d40903d522f3dbfdb388..b050dd7802be91f5456ef900b72df099fbd0a80b 100644 (file)
@@ -53,8 +53,10 @@ static void
 r200UpdatePageFlipping( r200ContextPtr rmesa )
 {
    rmesa->doPageFlip = rmesa->sarea->pfState;
-   driFlipRenderbuffers(rmesa->glCtx->WinSysDrawBuffer,
-                        rmesa->sarea->pfCurrentPage);
+   if (rmesa->glCtx->WinSysDrawBuffer) {
+      driFlipRenderbuffers(rmesa->glCtx->WinSysDrawBuffer,
+                           rmesa->sarea->pfCurrentPage);
+   }
 }
 
 
index cdf8a19fb13a0be8808d33ca0e0edaf5ba1b97e9..312041e0351961bbb583cd6ed33f56fe0824ba5c 100644 (file)
@@ -56,8 +56,10 @@ static void
 radeonUpdatePageFlipping( radeonContextPtr rmesa )
 {
    rmesa->doPageFlip = rmesa->sarea->pfState;
-   driFlipRenderbuffers(rmesa->glCtx->WinSysDrawBuffer,
-                        rmesa->sarea->pfCurrentPage);
+   if (rmesa->glCtx->WinSysDrawBuffer) {
+      driFlipRenderbuffers(rmesa->glCtx->WinSysDrawBuffer,
+                           rmesa->sarea->pfCurrentPage);
+   }
 }