dri: Remove dri2.enabled flag
authorKristian Høgsberg <krh@bitplanet.net>
Fri, 28 Oct 2011 19:56:15 +0000 (15:56 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Wed, 2 Nov 2011 15:16:01 +0000 (11:16 -0400)
DRI2 is always enabled now.

src/mesa/drivers/dri/common/dri_util.c
src/mesa/drivers/dri/common/dri_util.h
src/mesa/drivers/dri/radeon/radeon_common.c
src/mesa/drivers/dri/radeon/radeon_common_context.c
src/mesa/drivers/dri/radeon/radeon_dma.c
src/mesa/drivers/dri/radeon/radeon_screen.c

index e42bc84..aa095d8 100644 (file)
@@ -440,7 +440,6 @@ dri2CreateNewScreen(int scrn, int fd,
     psp->extensions = emptyExtensionList;
     psp->fd = fd;
     psp->myNum = scrn;
-    psp->dri2.enabled = GL_TRUE;
 
     psp->DriverAPI = driDriverAPI;
     psp->api_mask = (1 << __DRI_API_OPENGL);
index e016a23..ac0cef0 100644 (file)
@@ -305,7 +305,6 @@ struct __DRIscreenRec {
     struct {
        /* Flag to indicate that this is a DRI2 screen.  Many of the above
         * fields will not be valid or initializaed in that case. */
-       int enabled;
        __DRIdri2LoaderExtension *loader;
        __DRIimageLookupExtension *image;
        __DRIuseInvalidateExtension *useInvalidate;
index cc3fed8..2ef3faf 100644 (file)
@@ -466,9 +466,6 @@ void radeon_viewport(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GL
        void (*old_viewport)(struct gl_context *ctx, GLint x, GLint y,
                             GLsizei w, GLsizei h);
 
-       if (!driContext->driScreenPriv->dri2.enabled)
-               return;
-
        if (ctx->DrawBuffer->Name == 0) {
                if (radeon->is_front_buffer_rendering) {
                        ctx->Driver.Flush(ctx);
index e0ad9f2..cf647c2 100644 (file)
@@ -332,63 +332,6 @@ GLboolean radeonUnbindContext(__DRIcontext * driContextPriv)
 }
 
 
-static void
-radeon_make_renderbuffer_current(radeonContextPtr radeon,
-                                       struct gl_framebuffer *draw)
-{
-       /* if radeon->fake */
-       struct radeon_renderbuffer *rb;
-
-       if ((rb = (void *)draw->Attachment[BUFFER_FRONT_LEFT].Renderbuffer)) {
-               if (!rb->bo) {
-                       rb->bo = radeon_bo_open(radeon->radeonScreen->bom,
-                                               radeon->radeonScreen->frontOffset,
-                                               0,
-                                               0,
-                                               RADEON_GEM_DOMAIN_VRAM,
-                                               0);
-               }
-               rb->cpp = radeon->radeonScreen->cpp;
-               rb->pitch = radeon->radeonScreen->frontPitch * rb->cpp;
-       }
-       if ((rb = (void *)draw->Attachment[BUFFER_BACK_LEFT].Renderbuffer)) {
-               if (!rb->bo) {
-                       rb->bo = radeon_bo_open(radeon->radeonScreen->bom,
-                                               radeon->radeonScreen->backOffset,
-                                               0,
-                                               0,
-                                               RADEON_GEM_DOMAIN_VRAM,
-                                               0);
-               }
-               rb->cpp = radeon->radeonScreen->cpp;
-               rb->pitch = radeon->radeonScreen->backPitch * rb->cpp;
-       }
-       if ((rb = (void *)draw->Attachment[BUFFER_DEPTH].Renderbuffer)) {
-               if (!rb->bo) {
-                       rb->bo = radeon_bo_open(radeon->radeonScreen->bom,
-                                               radeon->radeonScreen->depthOffset,
-                                               0,
-                                               0,
-                                               RADEON_GEM_DOMAIN_VRAM,
-                                               0);
-               }
-               rb->cpp = radeon->radeonScreen->cpp;
-               rb->pitch = radeon->radeonScreen->depthPitch * rb->cpp;
-       }
-       if ((rb = (void *)draw->Attachment[BUFFER_STENCIL].Renderbuffer)) {
-               if (!rb->bo) {
-                       rb->bo = radeon_bo_open(radeon->radeonScreen->bom,
-                                               radeon->radeonScreen->depthOffset,
-                                               0,
-                                               0,
-                                               RADEON_GEM_DOMAIN_VRAM,
-                                               0);
-               }
-               rb->cpp = radeon->radeonScreen->cpp;
-               rb->pitch = radeon->radeonScreen->depthPitch * rb->cpp;
-       }
-}
-
 static unsigned
 radeon_bits_per_pixel(const struct radeon_renderbuffer *rb)
 {
@@ -675,18 +618,14 @@ GLboolean radeonMakeCurrent(__DRIcontext * driContextPriv,
                readfb = driReadPriv->driverPrivate;
        }
 
-       if (driContextPriv->driScreenPriv->dri2.enabled) {
-               if(driDrawPriv)
-                       radeon_update_renderbuffers(driContextPriv, driDrawPriv, GL_FALSE);
-               if (driDrawPriv != driReadPriv)
-                       radeon_update_renderbuffers(driContextPriv, driReadPriv, GL_FALSE);
-               _mesa_reference_renderbuffer(&radeon->state.color.rb,
-                       &(radeon_get_renderbuffer(drfb, BUFFER_BACK_LEFT)->base));
-               _mesa_reference_renderbuffer(&radeon->state.depth.rb,
-                       &(radeon_get_renderbuffer(drfb, BUFFER_DEPTH)->base));
-       } else {
-               radeon_make_renderbuffer_current(radeon, drfb);
-       }
+       if(driDrawPriv)
+          radeon_update_renderbuffers(driContextPriv, driDrawPriv, GL_FALSE);
+       if (driDrawPriv != driReadPriv)
+          radeon_update_renderbuffers(driContextPriv, driReadPriv, GL_FALSE);
+       _mesa_reference_renderbuffer(&radeon->state.color.rb,
+               &(radeon_get_renderbuffer(drfb, BUFFER_BACK_LEFT)->base));
+       _mesa_reference_renderbuffer(&radeon->state.depth.rb,
+               &(radeon_get_renderbuffer(drfb, BUFFER_DEPTH)->base));
 
        if (RADEON_DEBUG & RADEON_DRI)
             fprintf(stderr, "%s ctx %p dfb %p rfb %p\n", __FUNCTION__, radeon->glCtx, drfb, readfb);
index 1f87a0f..b49486f 100644 (file)
@@ -346,9 +346,7 @@ void radeonReleaseDmaRegions(radeonContextPtr rmesa)
                   continue;
                }
                if (!radeon_bo_is_idle(dma_bo->bo)) {
-                       if (rmesa->radeonScreen->driScreen->dri2.enabled)
-                               break;
-                       continue;
+                       break;
                }
                remove_from_list(dma_bo);
                dma_bo->expire_counter = expire_at;
index 36e7286..f53a547 100644 (file)
@@ -1149,8 +1149,6 @@ radeonDestroyScreen( __DRIscreen *sPriv )
 static GLboolean
 radeonInitDriver( __DRIscreen *sPriv )
 {
-   assert(sPriv->dri2.enabled);
-
     sPriv->private = (void *) radeonCreateScreen2( sPriv );
     if ( !sPriv->private ) {
         radeonDestroyScreen( sPriv );