void *loaderPrivate);
};
+/**
+ * This extension allows for common DRI2 options
+ */
+#define __DRI2_CONFIG_QUERY "DRI_CONFIG_QUERY"
+#define __DRI2_CONFIG_QUERY_VERSION 1
+
+typedef struct __DRI2configQueryExtensionRec __DRI2configQueryExtension;
+struct __DRI2configQueryExtensionRec {
+ __DRIextension base;
+
+ int (*configQueryb)(__DRIscreen *screen, const char *var, GLboolean *val);
+ int (*configQueryi)(__DRIscreen *screen, const char *var, GLint *val);
+ int (*configQueryf)(__DRIscreen *screen, const char *var, GLfloat *val);
+};
#endif
/* internal driver extension, no GL extension exposed */
}
#endif
+
+#ifdef __DRI2_CONFIG_QUERY
+ if ((strcmp(extensions[i]->name, __DRI2_CONFIG_QUERY) == 0))
+ psc->config = (__DRI2configQueryExtension *) extensions[i];
+#endif
}
}
const __DRI2flushExtension *f;
#endif
+#ifdef __DRI2_CONFIG_QUERY
+ const __DRI2configQueryExtension *config;
+#endif
+
#endif
/**
return pdraw;
}
+static int
+dri2ConfigQueryb(__DRIscreen *screen, const char *var, GLboolean *val)
+{
+ if (!driCheckOption(&screen->optionCache, var, DRI_BOOL))
+ return -1;
+
+ *val = driQueryOptionb(&screen->optionCache, var);
+
+ return 0;
+}
+
+static int
+dri2ConfigQueryi(__DRIscreen *screen, const char *var, GLint *val)
+{
+ if (!driCheckOption(&screen->optionCache, var, DRI_INT) &&
+ !driCheckOption(&screen->optionCache, var, DRI_ENUM))
+ return -1;
+
+ *val = driQueryOptioni(&screen->optionCache, var);
+
+ return 0;
+}
+
+static int
+dri2ConfigQueryf(__DRIscreen *screen, const char *var, GLfloat *val)
+{
+ if (!driCheckOption(&screen->optionCache, var, DRI_FLOAT))
+ return -1;
+
+ *val = driQueryOptionf(&screen->optionCache, var);
+
+ return 0;
+}
+
+
static void dri_get_drawable(__DRIdrawable *pdp)
{
pdp->refcount++;
static const __DRIextension *emptyExtensionList[] = { NULL };
__DRIscreen *psp;
drmVersionPtr version;
+ driOptionCache options;
if (driDriverAPI.InitScreen2 == NULL)
return NULL;
psp->DriverAPI = driDriverAPI;
+ driParseOptionInfo(&options, __dri2ConfigOptions, __dri2NConfigOptions);
+ driParseConfigFiles(&psp->optionCache, &options, psp->myNum, "dri2");
+
return psp;
}
dri2CreateNewContext,
};
+const __DRI2configQueryExtension dri2ConfigQueryExtension = {
+ { __DRI2_CONFIG_QUERY, __DRI2_CONFIG_QUERY_VERSION },
+ dri2ConfigQueryb,
+ dri2ConfigQueryi,
+ dri2ConfigQueryf,
+};
+
static int
driFrameTracking(__DRIdrawable *drawable, GLboolean enable)
{
#include <drm.h>
#include <drm_sarea.h>
#include <xf86drm.h>
+#include "xmlconfig.h"
#include "main/glheader.h"
#include "GL/internal/glcore.h"
#include "GL/internal/dri_interface.h"
extern const __DRIswapControlExtension driSwapControlExtension;
extern const __DRIframeTrackingExtension driFrameTrackingExtension;
extern const __DRImediaStreamCounterExtension driMediaStreamCounterExtension;
+extern const __DRI2configQueryExtension dri2ConfigQueryExtension;
/**
* Used by DRI_VALIDATE_DRAWABLE_INFO
/* The lock actually in use, old sarea or DRI2 */
drmLock *lock;
+
+ driOptionCache optionCache;
};
extern void
&intelTexBufferExtension.base,
&intelFlushExtension.base,
&intelImageExtension.base,
+ &dri2ConfigQueryExtension.base,
NULL
};
static const __DRIextension *nouveau_screen_extensions[] = {
&nouveau_flush_extension.base,
&nouveau_texbuffer_extension.base,
+ &dri2ConfigQueryExtension.base,
NULL
};
screen->extensions[i++] = &r600texOffsetExtension.base;
#endif
+ screen->extensions[i++] = &dri2ConfigQueryExtension.base;
+
screen->extensions[i++] = NULL;
sPriv->extensions = screen->extensions;
/* Configuration cache with default values for all contexts */
driOptionCache optionCache;
- const __DRIextension *extensions[16];
+ const __DRIextension *extensions[17];
int num_gb_pipes;
int num_z_pipes;