From 2b311fd8024ab20065568236bdc60b9f69706d4c Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 4 Jul 2012 10:52:35 -0700 Subject: intel: Drop other checks for old loader version. Reviewed-by: Chad Versace Reviewed-by: Kenneth Graunke --- src/mesa/drivers/dri/intel/intel_context.c | 64 ++++++++++++------------------ 1 file changed, 26 insertions(+), 38 deletions(-) (limited to 'src/mesa/drivers') diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index 39a9a858dc4..2494ac79457 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -216,9 +216,7 @@ intel_flush_front(struct gl_context *ctx) __DRIscreen *const screen = intel->intelScreen->driScrnPriv; if (_mesa_is_winsys_fbo(ctx->DrawBuffer) && intel->front_buffer_dirty) { - if (screen->dri2.loader && - (screen->dri2.loader->base.version >= 2) - && (screen->dri2.loader->flushFrontBuffer != NULL) && + if (screen->dri2.loader->flushFrontBuffer != NULL && driContext->driDrawablePriv && driContext->driDrawablePriv->loaderPrivate) { (*screen->dri2.loader->flushFrontBuffer)(driContext->driDrawablePriv, @@ -835,47 +833,37 @@ intel_query_dri2_buffers(struct intel_context *intel, { __DRIscreen *screen = intel->intelScreen->driScrnPriv; struct gl_framebuffer *fb = drawable->driverPrivate; + int i = 0; + const int max_attachments = 4; + unsigned *attachments = calloc(2 * max_attachments, sizeof(unsigned)); - if (screen->dri2.loader - && screen->dri2.loader->base.version > 2 - && screen->dri2.loader->getBuffersWithFormat != NULL) { + struct intel_renderbuffer *front_rb; + struct intel_renderbuffer *back_rb; - int i = 0; - const int max_attachments = 4; - unsigned *attachments = calloc(2 * max_attachments, sizeof(unsigned)); + front_rb = intel_get_renderbuffer(fb, BUFFER_FRONT_LEFT); + back_rb = intel_get_renderbuffer(fb, BUFFER_BACK_LEFT); - struct intel_renderbuffer *front_rb; - struct intel_renderbuffer *back_rb; - - front_rb = intel_get_renderbuffer(fb, BUFFER_FRONT_LEFT); - back_rb = intel_get_renderbuffer(fb, BUFFER_BACK_LEFT); - - if ((intel->is_front_buffer_rendering || - intel->is_front_buffer_reading || - !back_rb) && front_rb) { - attachments[i++] = __DRI_BUFFER_FRONT_LEFT; - attachments[i++] = intel_bits_per_pixel(front_rb); - } - - if (back_rb) { - attachments[i++] = __DRI_BUFFER_BACK_LEFT; - attachments[i++] = intel_bits_per_pixel(back_rb); - } + if ((intel->is_front_buffer_rendering || + intel->is_front_buffer_reading || + !back_rb) && front_rb) { + attachments[i++] = __DRI_BUFFER_FRONT_LEFT; + attachments[i++] = intel_bits_per_pixel(front_rb); + } - assert(i <= 2 * max_attachments); + if (back_rb) { + attachments[i++] = __DRI_BUFFER_BACK_LEFT; + attachments[i++] = intel_bits_per_pixel(back_rb); + } - *buffers = screen->dri2.loader->getBuffersWithFormat(drawable, - &drawable->w, - &drawable->h, - attachments, i / 2, - buffer_count, - drawable->loaderPrivate); - free(attachments); + assert(i <= 2 * max_attachments); - } else { - *buffers = NULL; - *buffer_count = 0; - } + *buffers = screen->dri2.loader->getBuffersWithFormat(drawable, + &drawable->w, + &drawable->h, + attachments, i / 2, + buffer_count, + drawable->loaderPrivate); + free(attachments); } /** -- cgit v1.2.3