summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2012-07-04 10:52:35 -0700
committerChad Versace <[email protected]>2012-07-17 08:18:06 -0700
commit2b311fd8024ab20065568236bdc60b9f69706d4c (patch)
tree16c4839f62b8b67bdc7efa32712ec1ee4c4e6b47 /src/mesa/drivers
parent1b4374d364f877d1b7d01e1231adeee2e0f63a4d (diff)
intel: Drop other checks for old loader version.
Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/intel/intel_context.c64
1 files changed, 26 insertions, 38 deletions
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);
}
/**