intel: Drop other checks for old loader version.
authorEric Anholt <eric@anholt.net>
Wed, 4 Jul 2012 17:52:35 +0000 (10:52 -0700)
committerChad Versace <chad.versace@linux.intel.com>
Tue, 17 Jul 2012 15:18:06 +0000 (08:18 -0700)
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/intel/intel_context.c

index 39a9a858dc429997794f4f71f996be0006b8caf4..2494ac79457e672ae5454d4affdaf8aef197ab71 100644 (file)
@@ -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);
 }
 
 /**