[Mesa-dev] [PATCH 4/6] intel: Replace the non-getBuffersWithFormat compat path with an error message.
Eric Anholt
eric at anholt.net
Wed Jul 4 10:52:34 PDT 2012
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.
---
src/mesa/drivers/dri/intel/intel_context.c | 21 ---------------------
src/mesa/drivers/dri/intel/intel_screen.c | 8 ++++++++
2 files changed, 8 insertions(+), 21 deletions(-)
diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c
index 27b35ec..f62f0ec 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -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;
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index 7ed4f67..056951e 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -782,6 +782,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) {
--
1.7.10
More information about the mesa-dev
mailing list