radeon: fixup some segfaults/exit at startup
authorDave Airlie <airlied@redhat.com>
Wed, 4 Mar 2009 08:36:13 +0000 (18:36 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 4 Mar 2009 08:36:13 +0000 (18:36 +1000)
src/mesa/drivers/dri/radeon/radeon_common_context.c
src/mesa/drivers/dri/radeon/radeon_state_init.c

index 4da2055c13d7118730a905e7ebd9b059e919d2e9..7358391097001849bad53451bf5c1cfbe94e1d86 100644 (file)
@@ -545,6 +545,9 @@ GLboolean radeonMakeCurrent(__DRIcontextPrivate * driContextPriv,
        if (RADEON_DEBUG & DEBUG_DRI)
             fprintf(stderr, "%s ctx %p dfb %p rfb %p\n", __FUNCTION__, radeon->glCtx, drfb, readfb);
 
+       if (radeon->dri.readable != driReadPriv)
+               radeon->dri.readable = driReadPriv;
+
        driUpdateFramebufferSize(radeon->glCtx, driDrawPriv);
        if (driReadPriv != driDrawPriv)
                driUpdateFramebufferSize(radeon->glCtx, driReadPriv);
@@ -555,9 +558,6 @@ GLboolean radeonMakeCurrent(__DRIcontextPrivate * driContextPriv,
 
        if (radeon->glCtx->DrawBuffer == &drfb->base) {
 
-               if (radeon->dri.readable != driReadPriv)
-                       radeon->dri.readable = driReadPriv;
-
                if (radeon->dri.drawable != driDrawPriv) {
                        if (driDrawPriv->swap_interval == (unsigned)-1) {
                                int i;
index 7ff0eb450cec1d6aa5d16d93b23b66b6c8e96ca5..26a9c316ce892cd53051c9c984ec91554d89d9b2 100644 (file)
@@ -549,9 +549,7 @@ void radeonInitState( r100ContextPtr rmesa )
       rmesa->radeon.state.stencil.clear = 0xffff0000;
       break;
    default:
-      fprintf( stderr, "Error: Unsupported depth %d... exiting\n",
-              ctx->Visual.depthBits );
-      exit( -1 );
+      break;
    }
 
    /* Only have hw stencil when depth buffer is 24 bits deep */