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 e42bc84cca394d726d284854c502f1d942b470b9..aa095d8f282905fbe31690c198786bcf81830c01 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 e016a238dcadf180894c1cb1f50593d6744ece76..ac0cef03cbfbb37b31661ec0ba440a41e07e7b72 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 cc3fed8623d251b3ee3df27031acf17c8d3fbfb5..2ef3fafee0805174354e25d0b5a093b8f63dae67 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 e0ad9f24a9fea45fe361b76f41e769f0333d8579..cf647c2b01c2ce0a35a6fd7ee728bdc3e7de6cb9 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 1f87a0fa16dc83f193c9c859bd7a777a3042a2bf..b49486f1f924c3682acb6b58e234e910179c6db6 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 36e72869251477642d5e81ee1e9249b0ab74f45b..f53a54727d32f254d4ae0749d7973d49d9a36a7c 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 );