glx: unifdef for DRI2 dri_interface.h things in mesa 9.2.
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. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
parent
2ea973e12f
commit
4ab1a2797b
|
@ -55,14 +55,9 @@ typedef struct __GLXDRIscreen __GLXDRIscreen;
|
||||||
typedef struct __GLXDRIcontext __GLXDRIcontext;
|
typedef struct __GLXDRIcontext __GLXDRIcontext;
|
||||||
typedef struct __GLXDRIdrawable __GLXDRIdrawable;
|
typedef struct __GLXDRIdrawable __GLXDRIdrawable;
|
||||||
|
|
||||||
#ifdef __DRI2_ROBUSTNESS
|
|
||||||
#define ALL_DRI_CTX_FLAGS (__DRI_CTX_FLAG_DEBUG \
|
#define ALL_DRI_CTX_FLAGS (__DRI_CTX_FLAG_DEBUG \
|
||||||
| __DRI_CTX_FLAG_FORWARD_COMPATIBLE \
|
| __DRI_CTX_FLAG_FORWARD_COMPATIBLE \
|
||||||
| __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS)
|
| __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS)
|
||||||
#else
|
|
||||||
#define ALL_DRI_CTX_FLAGS (__DRI_CTX_FLAG_DEBUG \
|
|
||||||
| __DRI_CTX_FLAG_FORWARD_COMPATIBLE)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct __GLXDRIscreen {
|
struct __GLXDRIscreen {
|
||||||
__GLXscreen base;
|
__GLXscreen base;
|
||||||
|
@ -210,15 +205,10 @@ __glXDRIdrawableSwapBuffers(ClientPtr client, __GLXdrawable * drawable)
|
||||||
__GLXDRIscreen *screen = priv->screen;
|
__GLXDRIscreen *screen = priv->screen;
|
||||||
CARD64 unused;
|
CARD64 unused;
|
||||||
|
|
||||||
#if __DRI2_FLUSH_VERSION >= 3
|
|
||||||
if (screen->flush) {
|
if (screen->flush) {
|
||||||
(*screen->flush->flush) (priv->driDrawable);
|
(*screen->flush->flush) (priv->driDrawable);
|
||||||
(*screen->flush->invalidate) (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,
|
if (DRI2SwapBuffers(client, drawable->pDraw, 0, 0, 0, &unused,
|
||||||
__glXdriSwapEvent, drawable) != Success)
|
__glXdriSwapEvent, drawable) != Success)
|
||||||
|
@ -294,8 +284,6 @@ __glXDRIcontextWait(__GLXcontext * baseContext,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __DRI_TEX_BUFFER
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
__glXDRIbindTexImage(__GLXcontext * baseContext,
|
__glXDRIbindTexImage(__GLXcontext * baseContext,
|
||||||
int buffer, __GLXdrawable * glxPixmap)
|
int buffer, __GLXdrawable * glxPixmap)
|
||||||
|
@ -307,14 +295,12 @@ __glXDRIbindTexImage(__GLXcontext * baseContext,
|
||||||
if (texBuffer == NULL)
|
if (texBuffer == NULL)
|
||||||
return Success;
|
return Success;
|
||||||
|
|
||||||
#if __DRI_TEX_BUFFER_VERSION >= 2
|
|
||||||
if (texBuffer->base.version >= 2 && texBuffer->setTexBuffer2 != NULL) {
|
if (texBuffer->base.version >= 2 && texBuffer->setTexBuffer2 != NULL) {
|
||||||
(*texBuffer->setTexBuffer2) (context->driContext,
|
(*texBuffer->setTexBuffer2) (context->driContext,
|
||||||
glxPixmap->target,
|
glxPixmap->target,
|
||||||
glxPixmap->format, drawable->driDrawable);
|
glxPixmap->format, drawable->driDrawable);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
texBuffer->setTexBuffer(context->driContext,
|
texBuffer->setTexBuffer(context->driContext,
|
||||||
glxPixmap->target, drawable->driDrawable);
|
glxPixmap->target, drawable->driDrawable);
|
||||||
|
@ -331,24 +317,6 @@ __glXDRIreleaseTexImage(__GLXcontext * baseContext,
|
||||||
return Success;
|
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 = {
|
static __GLXtextureFromPixmap __glXDRItextureFromPixmap = {
|
||||||
__glXDRIbindTexImage,
|
__glXDRIbindTexImage,
|
||||||
__glXDRIreleaseTexImage
|
__glXDRIreleaseTexImage
|
||||||
|
@ -398,11 +366,7 @@ dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs,
|
||||||
|
|
||||||
*major_ver = 1;
|
*major_ver = 1;
|
||||||
*minor_ver = 0;
|
*minor_ver = 0;
|
||||||
#ifdef __DRI2_ROBUSTNESS
|
|
||||||
*reset = __DRI_CTX_RESET_NO_NOTIFICATION;
|
*reset = __DRI_CTX_RESET_NO_NOTIFICATION;
|
||||||
#else
|
|
||||||
(void) reset;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for (i = 0; i < num_attribs; i++) {
|
for (i = 0; i < num_attribs; i++) {
|
||||||
switch (attribs[i * 2]) {
|
switch (attribs[i * 2]) {
|
||||||
|
@ -433,7 +397,6 @@ dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs,
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#ifdef __DRI2_ROBUSTNESS
|
|
||||||
case GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB:
|
case GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB:
|
||||||
if (screen->dri2->base.version >= 4) {
|
if (screen->dri2->base.version >= 4) {
|
||||||
*error = BadValue;
|
*error = BadValue;
|
||||||
|
@ -452,7 +415,6 @@ dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs,
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
/* If an unknown attribute is received, fail.
|
/* If an unknown attribute is received, fail.
|
||||||
*/
|
*/
|
||||||
|
@ -493,7 +455,6 @@ create_driver_context(__GLXDRIcontext * context,
|
||||||
{
|
{
|
||||||
context->driContext = NULL;
|
context->driContext = NULL;
|
||||||
|
|
||||||
#if __DRI_DRI2_VERSION >= 3
|
|
||||||
if (screen->dri2->base.version >= 3) {
|
if (screen->dri2->base.version >= 3) {
|
||||||
uint32_t ctx_attribs[3 * 2];
|
uint32_t ctx_attribs[3 * 2];
|
||||||
unsigned num_ctx_attribs = 0;
|
unsigned num_ctx_attribs = 0;
|
||||||
|
@ -525,13 +486,11 @@ create_driver_context(__GLXDRIcontext * context,
|
||||||
ctx_attribs[num_ctx_attribs++] = flags;
|
ctx_attribs[num_ctx_attribs++] = flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __DRI2_ROBUSTNESS
|
|
||||||
if (reset != __DRI_CTX_RESET_NO_NOTIFICATION) {
|
if (reset != __DRI_CTX_RESET_NO_NOTIFICATION) {
|
||||||
ctx_attribs[num_ctx_attribs++] =
|
ctx_attribs[num_ctx_attribs++] =
|
||||||
__DRI_CTX_ATTRIB_RESET_STRATEGY;
|
__DRI_CTX_ATTRIB_RESET_STRATEGY;
|
||||||
ctx_attribs[num_ctx_attribs++] = reset;
|
ctx_attribs[num_ctx_attribs++] = reset;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
context->driContext =
|
context->driContext =
|
||||||
|
@ -567,7 +526,6 @@ create_driver_context(__GLXDRIcontext * context,
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (num_attribs != 0) {
|
if (num_attribs != 0) {
|
||||||
*error = BadValue;
|
*error = BadValue;
|
||||||
|
@ -625,13 +583,11 @@ __glXDRIscreenCreateContext(__GLXscreen * baseScreen,
|
||||||
static void
|
static void
|
||||||
__glXDRIinvalidateBuffers(DrawablePtr pDraw, void *priv, XID id)
|
__glXDRIinvalidateBuffers(DrawablePtr pDraw, void *priv, XID id)
|
||||||
{
|
{
|
||||||
#if __DRI2_FLUSH_VERSION >= 3
|
|
||||||
__GLXDRIdrawable *private = priv;
|
__GLXDRIdrawable *private = priv;
|
||||||
__GLXDRIscreen *screen = private->screen;
|
__GLXDRIscreen *screen = private->screen;
|
||||||
|
|
||||||
if (screen->flush)
|
if (screen->flush)
|
||||||
(*screen->flush->invalidate) (private->driDrawable);
|
(*screen->flush->invalidate) (private->driDrawable);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static __GLXdrawable *
|
static __GLXdrawable *
|
||||||
|
@ -778,18 +734,14 @@ static const __DRIdri2LoaderExtension loaderExtension = {
|
||||||
dri2GetBuffersWithFormat,
|
dri2GetBuffersWithFormat,
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef __DRI_USE_INVALIDATE
|
|
||||||
static const __DRIuseInvalidateExtension dri2UseInvalidate = {
|
static const __DRIuseInvalidateExtension dri2UseInvalidate = {
|
||||||
{__DRI_USE_INVALIDATE, 1}
|
{__DRI_USE_INVALIDATE, 1}
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
static const __DRIextension *loader_extensions[] = {
|
static const __DRIextension *loader_extensions[] = {
|
||||||
&systemTimeExtension.base,
|
&systemTimeExtension.base,
|
||||||
&loaderExtension.base,
|
&loaderExtension.base,
|
||||||
#ifdef __DRI_USE_INVALIDATE
|
|
||||||
&dri2UseInvalidate.base,
|
&dri2UseInvalidate.base,
|
||||||
#endif
|
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -850,8 +802,6 @@ initializeExtensions(__GLXDRIscreen * screen)
|
||||||
__glXEnableExtension(screen->glx_enable_bits, "GLX_MESA_copy_sub_buffer");
|
__glXEnableExtension(screen->glx_enable_bits, "GLX_MESA_copy_sub_buffer");
|
||||||
LogMessage(X_INFO, "AIGLX: enabled GLX_MESA_copy_sub_buffer\n");
|
LogMessage(X_INFO, "AIGLX: enabled GLX_MESA_copy_sub_buffer\n");
|
||||||
|
|
||||||
|
|
||||||
#if __DRI_DRI2_VERSION >= 3
|
|
||||||
if (screen->dri2->base.version >= 3) {
|
if (screen->dri2->base.version >= 3) {
|
||||||
__glXEnableExtension(screen->glx_enable_bits,
|
__glXEnableExtension(screen->glx_enable_bits,
|
||||||
"GLX_ARB_create_context");
|
"GLX_ARB_create_context");
|
||||||
|
@ -864,7 +814,6 @@ initializeExtensions(__GLXDRIscreen * screen)
|
||||||
LogMessage(X_INFO,
|
LogMessage(X_INFO,
|
||||||
"AIGLX: enabled GLX_EXT_create_context_es2_profile\n");
|
"AIGLX: enabled GLX_EXT_create_context_es2_profile\n");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (DRI2HasSwapControl(pScreen)) {
|
if (DRI2HasSwapControl(pScreen)) {
|
||||||
__glXEnableExtension(screen->glx_enable_bits, "GLX_INTEL_swap_event");
|
__glXEnableExtension(screen->glx_enable_bits, "GLX_INTEL_swap_event");
|
||||||
|
@ -889,32 +838,25 @@ initializeExtensions(__GLXDRIscreen * screen)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; extensions[i]; i++) {
|
for (i = 0; extensions[i]; i++) {
|
||||||
#ifdef __DRI_READ_DRAWABLE
|
|
||||||
if (strcmp(extensions[i]->name, __DRI_READ_DRAWABLE) == 0) {
|
if (strcmp(extensions[i]->name, __DRI_READ_DRAWABLE) == 0) {
|
||||||
__glXEnableExtension(screen->glx_enable_bits,
|
__glXEnableExtension(screen->glx_enable_bits,
|
||||||
"GLX_SGI_make_current_read");
|
"GLX_SGI_make_current_read");
|
||||||
|
|
||||||
LogMessage(X_INFO, "AIGLX: enabled GLX_SGI_make_current_read\n");
|
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) {
|
if (strcmp(extensions[i]->name, __DRI_TEX_BUFFER) == 0) {
|
||||||
screen->texBuffer = (const __DRItexBufferExtension *) extensions[i];
|
screen->texBuffer = (const __DRItexBufferExtension *) extensions[i];
|
||||||
/* GLX_EXT_texture_from_pixmap is always enabled. */
|
/* GLX_EXT_texture_from_pixmap is always enabled. */
|
||||||
LogMessage(X_INFO,
|
LogMessage(X_INFO,
|
||||||
"AIGLX: GLX_EXT_texture_from_pixmap backed by buffer objects\n");
|
"AIGLX: GLX_EXT_texture_from_pixmap backed by buffer objects\n");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __DRI2_FLUSH
|
|
||||||
if (strcmp(extensions[i]->name, __DRI2_FLUSH) == 0 &&
|
if (strcmp(extensions[i]->name, __DRI2_FLUSH) == 0 &&
|
||||||
extensions[i]->version >= 3) {
|
extensions[i]->version >= 3) {
|
||||||
screen->flush = (__DRI2flushExtension *) extensions[i];
|
screen->flush = (__DRI2flushExtension *) extensions[i];
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __DRI2_ROBUSTNESS
|
|
||||||
if (strcmp(extensions[i]->name, __DRI2_ROBUSTNESS) == 0 &&
|
if (strcmp(extensions[i]->name, __DRI2_ROBUSTNESS) == 0 &&
|
||||||
screen->dri2->base.version >= 3) {
|
screen->dri2->base.version >= 3) {
|
||||||
__glXEnableExtension(screen->glx_enable_bits,
|
__glXEnableExtension(screen->glx_enable_bits,
|
||||||
|
@ -922,7 +864,6 @@ initializeExtensions(__GLXDRIscreen * screen)
|
||||||
LogMessage(X_INFO,
|
LogMessage(X_INFO,
|
||||||
"AIGLX: enabled GLX_ARB_create_context_robustness\n");
|
"AIGLX: enabled GLX_ARB_create_context_robustness\n");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Ignore unknown extensions */
|
/* Ignore unknown extensions */
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user