intel: Replace the non-getBuffersWithFormat compat path with an error message.
authorEric Anholt <eric@anholt.net>
Wed, 4 Jul 2012 17:52:34 +0000 (10:52 -0700)
committerChad Versace <chad.versace@linux.intel.com>
Tue, 17 Jul 2012 15:18:04 +0000 (08:18 -0700)
It's been broken (using NULL getBuffersWithFormat() instead of
getBuffers()) due to a copy and paste error for a year now.
GetBuffersWithFormat has been around since 2009, so I don't feel any
guilt in not supporting it.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/intel/intel_context.c
src/mesa/drivers/dri/intel/intel_screen.c

index 60e93f0dc3ec14272769142a3708d388fea409d4..39a9a858dc429997794f4f71f996be0006b8caf4 100644 (file)
@@ -872,27 +872,6 @@ intel_query_dri2_buffers(struct intel_context *intel,
                                                           drawable->loaderPrivate);
       free(attachments);
 
-   } else if (screen->dri2.loader) {
-
-      int i = 0;
-      const int max_attachments = 4;
-      unsigned *attachments = calloc(max_attachments, sizeof(unsigned));
-
-      if (intel_get_renderbuffer(fb, BUFFER_FRONT_LEFT))
-        attachments[i++] = __DRI_BUFFER_FRONT_LEFT;
-      if (intel_get_renderbuffer(fb, BUFFER_BACK_LEFT))
-        attachments[i++] = __DRI_BUFFER_BACK_LEFT;
-
-      assert(i <= max_attachments);
-
-      *buffers = screen->dri2.loader->getBuffersWithFormat(drawable,
-                                                          &drawable->w,
-                                                          &drawable->h,
-                                                          attachments, i,
-                                                          buffer_count,
-                                                          drawable->loaderPrivate);
-      free(attachments);
-
    } else {
       *buffers = NULL;
       *buffer_count = 0;
index b514d8501ddbb5718a7a765b54574678eecb8de9..e52bf13cfb68818b82325c11516b554ced0a81f7 100644 (file)
@@ -810,6 +810,14 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp)
    int color;
    __DRIconfig **configs = NULL;
 
+   if (psp->dri2.loader->base.version <= 2 ||
+       psp->dri2.loader->getBuffersWithFormat == NULL) {
+      fprintf(stderr,
+             "\nERROR!  DRI2 loader with getBuffersWithFormat() "
+             "support required\n");
+      return false;
+   }
+
    /* Allocate the private area */
    intelScreen = CALLOC(sizeof *intelScreen);
    if (!intelScreen) {