summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2013-11-05 11:41:06 -0800
committerEric Anholt <eric@anholt.net>2013-11-05 11:43:28 -0800
commitd866d29723da38bf9a6cfe7fee159b72c97f190e (patch)
tree488f6b7f7120d9886e8d2225a05fb2026858e62e
parent7e338f5e91fffc5db9de053bd148674416424f99 (diff)
glx: unifdef for dri_interface.h things in mesa 9.2.xserver-driinterface-versions
Thanks to configure.ac's check, we know that we have a new enough dri_interface.h that we don't need to conditionalize all this code.
-rw-r--r--glx/glxdri2.c59
-rw-r--r--glx/glxdricommon.c8
-rw-r--r--glx/glxdriswrast.c27
3 files changed, 1 insertions, 93 deletions
diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index 5034bb16a..f06decfd4 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -56,14 +56,9 @@ typedef struct __GLXDRIcontext __GLXDRIcontext;
typedef struct __GLXDRIdrawable __GLXDRIdrawable;
-#ifdef __DRI2_ROBUSTNESS
#define ALL_DRI_CTX_FLAGS (__DRI_CTX_FLAG_DEBUG \
| __DRI_CTX_FLAG_FORWARD_COMPATIBLE \
| __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS)
-#else
-#define ALL_DRI_CTX_FLAGS (__DRI_CTX_FLAG_DEBUG \
- | __DRI_CTX_FLAG_FORWARD_COMPATIBLE)
-#endif
struct __GLXDRIscreen {
__GLXscreen base;
@@ -222,15 +217,10 @@ __glXDRIdrawableSwapBuffers(ClientPtr client, __GLXdrawable * drawable)
__GLXDRIscreen *screen = priv->screen;
CARD64 unused;
-#if __DRI2_FLUSH_VERSION >= 3
if (screen->flush) {
(*screen->flush->flush) (priv->driDrawable);
(*screen->flush->invalidate) (priv->driDrawable);
}
-#else
- if (screen->flush)
- (*screen->flush->flushInvalidate) (priv->driDrawable);
-#endif
if (DRI2SwapBuffers(client, drawable->pDraw, 0, 0, 0, &unused,
__glXdriSwapEvent, drawable) != Success)
@@ -306,8 +296,6 @@ __glXDRIcontextWait(__GLXcontext * baseContext,
return FALSE;
}
-#ifdef __DRI_TEX_BUFFER
-
static int
__glXDRIbindTexImage(__GLXcontext * baseContext,
int buffer, __GLXdrawable * glxPixmap)
@@ -319,14 +307,12 @@ __glXDRIbindTexImage(__GLXcontext * baseContext,
if (texBuffer == NULL)
return Success;
-#if __DRI_TEX_BUFFER_VERSION >= 2
if (texBuffer->base.version >= 2 && texBuffer->setTexBuffer2 != NULL) {
(*texBuffer->setTexBuffer2) (context->driContext,
glxPixmap->target,
glxPixmap->format, drawable->driDrawable);
}
else
-#endif
{
texBuffer->setTexBuffer(context->driContext,
glxPixmap->target, drawable->driDrawable);
@@ -343,24 +329,6 @@ __glXDRIreleaseTexImage(__GLXcontext * baseContext,
return Success;
}
-#else
-
-static int
-__glXDRIbindTexImage(__GLXcontext * baseContext,
- int buffer, __GLXdrawable * glxPixmap)
-{
- return Success;
-}
-
-static int
-__glXDRIreleaseTexImage(__GLXcontext * baseContext,
- int buffer, __GLXdrawable * pixmap)
-{
- return Success;
-}
-
-#endif
-
static __GLXtextureFromPixmap __glXDRItextureFromPixmap = {
__glXDRIbindTexImage,
__glXDRIreleaseTexImage
@@ -406,11 +374,7 @@ dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs,
*major_ver = 1;
*minor_ver = 0;
-#ifdef __DRI2_ROBUSTNESS
*reset = __DRI_CTX_RESET_NO_NOTIFICATION;
-#else
- (void) reset;
-#endif
for (i = 0; i < num_attribs; i++) {
switch (attribs[i * 2]) {
@@ -441,7 +405,6 @@ dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs,
return False;
}
break;
-#ifdef __DRI2_ROBUSTNESS
case GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB:
if (screen->dri2->base.version >= 4) {
*error = BadValue;
@@ -460,7 +423,6 @@ dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs,
return False;
}
break;
-#endif
default:
/* If an unknown attribute is received, fail.
*/
@@ -501,7 +463,6 @@ create_driver_context(__GLXDRIcontext * context,
{
context->driContext = NULL;
-#if __DRI_DRI2_VERSION >= 3
if (screen->dri2->base.version >= 3) {
uint32_t ctx_attribs[3 * 2];
unsigned num_ctx_attribs = 0;
@@ -533,13 +494,11 @@ create_driver_context(__GLXDRIcontext * context,
ctx_attribs[num_ctx_attribs++] = flags;
}
-#ifdef __DRI2_ROBUSTNESS
if (reset != __DRI_CTX_RESET_NO_NOTIFICATION) {
ctx_attribs[num_ctx_attribs++] =
__DRI_CTX_ATTRIB_RESET_STRATEGY;
ctx_attribs[num_ctx_attribs++] = reset;
}
-#endif
}
context->driContext =
@@ -575,7 +534,6 @@ create_driver_context(__GLXDRIcontext * context,
return;
}
-#endif
if (num_attribs != 0) {
*error = BadValue;
@@ -633,13 +591,11 @@ __glXDRIscreenCreateContext(__GLXscreen * baseScreen,
static void
__glXDRIinvalidateBuffers(DrawablePtr pDraw, void *priv, XID id)
{
-#if __DRI2_FLUSH_VERSION >= 3
__GLXDRIdrawable *private = priv;
__GLXDRIscreen *screen = private->screen;
if (screen->flush)
(*screen->flush->invalidate) (private->driDrawable);
-#endif
}
static __GLXdrawable *
@@ -786,18 +742,14 @@ static const __DRIdri2LoaderExtension loaderExtension = {
dri2GetBuffersWithFormat,
};
-#ifdef __DRI_USE_INVALIDATE
static const __DRIuseInvalidateExtension dri2UseInvalidate = {
{__DRI_USE_INVALIDATE, 1}
};
-#endif
static const __DRIextension *loader_extensions[] = {
&systemTimeExtension.base,
&loaderExtension.base,
-#ifdef __DRI_USE_INVALIDATE
&dri2UseInvalidate.base,
-#endif
NULL
};
@@ -858,8 +810,6 @@ initializeExtensions(__GLXDRIscreen * screen)
__glXEnableExtension(screen->glx_enable_bits, "GLX_MESA_copy_sub_buffer");
LogMessage(X_INFO, "AIGLX: enabled GLX_MESA_copy_sub_buffer\n");
-
-#if __DRI_DRI2_VERSION >= 3
if (screen->dri2->base.version >= 3) {
__glXEnableExtension(screen->glx_enable_bits,
"GLX_ARB_create_context");
@@ -872,7 +822,6 @@ initializeExtensions(__GLXDRIscreen * screen)
LogMessage(X_INFO,
"AIGLX: enabled GLX_EXT_create_context_es2_profile\n");
}
-#endif
if (DRI2HasSwapControl(pScreen)) {
__glXEnableExtension(screen->glx_enable_bits, "GLX_INTEL_swap_event");
@@ -897,32 +846,25 @@ initializeExtensions(__GLXDRIscreen * screen)
}
for (i = 0; extensions[i]; i++) {
-#ifdef __DRI_READ_DRAWABLE
if (strcmp(extensions[i]->name, __DRI_READ_DRAWABLE) == 0) {
__glXEnableExtension(screen->glx_enable_bits,
"GLX_SGI_make_current_read");
LogMessage(X_INFO, "AIGLX: enabled GLX_SGI_make_current_read\n");
}
-#endif
-#ifdef __DRI_TEX_BUFFER
if (strcmp(extensions[i]->name, __DRI_TEX_BUFFER) == 0) {
screen->texBuffer = (const __DRItexBufferExtension *) extensions[i];
/* GLX_EXT_texture_from_pixmap is always enabled. */
LogMessage(X_INFO,
"AIGLX: GLX_EXT_texture_from_pixmap backed by buffer objects\n");
}
-#endif
-#ifdef __DRI2_FLUSH
if (strcmp(extensions[i]->name, __DRI2_FLUSH) == 0 &&
extensions[i]->version >= 3) {
screen->flush = (__DRI2flushExtension *) extensions[i];
}
-#endif
-#ifdef __DRI2_ROBUSTNESS
if (strcmp(extensions[i]->name, __DRI2_ROBUSTNESS) == 0 &&
screen->dri2->base.version >= 3) {
__glXEnableExtension(screen->glx_enable_bits,
@@ -930,7 +872,6 @@ initializeExtensions(__GLXDRIscreen * screen)
LogMessage(X_INFO,
"AIGLX: enabled GLX_ARB_create_context_robustness\n");
}
-#endif
/* Ignore unknown extensions */
}
diff --git a/glx/glxdricommon.c b/glx/glxdricommon.c
index fc902729d..7aa45f447 100644
--- a/glx/glxdricommon.c
+++ b/glx/glxdricommon.c
@@ -248,14 +248,6 @@ glxConvertConfigs(const __DRIcoreExtension * core,
static const char dri_driver_path[] = DRI_DRIVER_PATH;
-/* Temporary define to allow building without a dri_interface.h from
- * updated Mesa. Some day when we don't care about Mesa that old any
- * more this can be removed.
- */
-#ifndef __DRI_DRIVER_GET_EXTENSIONS
-#define __DRI_DRIVER_GET_EXTENSIONS "__driDriverGetExtensions"
-#endif
-
void *
glxProbeDriver(const char *driverName,
void **coreExt, const char *coreName, int coreVersion,
diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c
index 2d5efa03f..8c4955d6b 100644
--- a/glx/glxdriswrast.c
+++ b/glx/glxdriswrast.c
@@ -170,8 +170,6 @@ __glXDRIcontextCopy(__GLXcontext * baseDst, __GLXcontext * baseSrc,
src->driContext, mask);
}
-#ifdef __DRI_TEX_BUFFER
-
static int
__glXDRIbindTexImage(__GLXcontext * baseContext,
int buffer, __GLXdrawable * glxPixmap)
@@ -183,14 +181,12 @@ __glXDRIbindTexImage(__GLXcontext * baseContext,
if (texBuffer == NULL)
return Success;
-#if __DRI_TEX_BUFFER_VERSION >= 2
if (texBuffer->base.version >= 2 && texBuffer->setTexBuffer2 != NULL) {
(*texBuffer->setTexBuffer2) (context->driContext,
glxPixmap->target,
glxPixmap->format, drawable->driDrawable);
}
else
-#endif
texBuffer->setTexBuffer(context->driContext,
glxPixmap->target, drawable->driDrawable);
@@ -205,24 +201,6 @@ __glXDRIreleaseTexImage(__GLXcontext * baseContext,
return Success;
}
-#else
-
-static int
-__glXDRIbindTexImage(__GLXcontext * baseContext,
- int buffer, __GLXdrawable * glxPixmap)
-{
- return Success;
-}
-
-static int
-__glXDRIreleaseTexImage(__GLXcontext * baseContext,
- int buffer, __GLXdrawable * pixmap)
-{
- return Success;
-}
-
-#endif
-
static __GLXtextureFromPixmap __glXDRItextureFromPixmap = {
__glXDRIbindTexImage,
__glXDRIreleaseTexImage
@@ -407,20 +385,17 @@ initializeExtensions(__GLXDRIscreen * screen)
extensions = screen->core->getExtensions(screen->driScreen);
for (i = 0; extensions[i]; i++) {
-#ifdef __DRI_COPY_SUB_BUFFER
if (strcmp(extensions[i]->name, __DRI_COPY_SUB_BUFFER) == 0) {
screen->copySubBuffer =
(const __DRIcopySubBufferExtension *) extensions[i];
/* GLX_MESA_copy_sub_buffer is always enabled. */
}
-#endif
-#ifdef __DRI_TEX_BUFFER
if (strcmp(extensions[i]->name, __DRI_TEX_BUFFER) == 0) {
screen->texBuffer = (const __DRItexBufferExtension *) extensions[i];
/* GLX_EXT_texture_from_pixmap is always enabled. */
}
-#endif
+
/* Ignore unknown extensions */
}
}