From: Kristian Høgsberg Date: Fri, 28 Oct 2011 19:56:15 +0000 (-0400) Subject: dri: Remove dri2.enabled flag X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=03855bc2accbeb508458f70bdbdcef292672b2b8;p=mesa.git dri: Remove dri2.enabled flag DRI2 is always enabled now. --- diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index e42bc84cca3..aa095d8f282 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -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); diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h index e016a238dca..ac0cef03cbf 100644 --- a/src/mesa/drivers/dri/common/dri_util.h +++ b/src/mesa/drivers/dri/common/dri_util.h @@ -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; diff --git a/src/mesa/drivers/dri/radeon/radeon_common.c b/src/mesa/drivers/dri/radeon/radeon_common.c index cc3fed8623d..2ef3fafee08 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common.c +++ b/src/mesa/drivers/dri/radeon/radeon_common.c @@ -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); diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.c b/src/mesa/drivers/dri/radeon/radeon_common_context.c index e0ad9f24a9f..cf647c2b01c 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_common_context.c @@ -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); diff --git a/src/mesa/drivers/dri/radeon/radeon_dma.c b/src/mesa/drivers/dri/radeon/radeon_dma.c index 1f87a0fa16d..b49486f1f92 100644 --- a/src/mesa/drivers/dri/radeon/radeon_dma.c +++ b/src/mesa/drivers/dri/radeon/radeon_dma.c @@ -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; diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index 36e72869251..f53a54727d3 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -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 );