summaryrefslogtreecommitdiff
path: root/GL/glx
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2008-02-29 15:10:36 -0500
committerKristian Høgsberg <krh@redhat.com>2008-02-29 15:11:13 -0500
commit13bfa5937d43392f686b76a99ea6331e3dce5987 (patch)
tree5951dca53152300cda0a33cbd8becf5c0a9f5751 /GL/glx
parentd04ea267a4a51c16088d9ef429681a1edde536b1 (diff)
GLX: Adjust to changes in DRI driver interface.
Diffstat (limited to 'GL/glx')
-rw-r--r--GL/glx/glxdri.c32
-rw-r--r--GL/glx/glxdri2.c48
2 files changed, 41 insertions, 39 deletions
diff --git a/GL/glx/glxdri.c b/GL/glx/glxdri.c
index f9b28e427..dc15b0fcc 100644
--- a/GL/glx/glxdri.c
+++ b/GL/glx/glxdri.c
@@ -828,18 +828,38 @@ static void __glXReportDamage(__DRIdrawable *driDraw,
}
/* Table of functions that we export to the driver. */
-static const __DRIinterfaceMethods interface_methods = {
+static const __DRIcontextModesExtension contextModesExtension = {
+ { __DRI_CONTEXT_MODES, __DRI_CONTEXT_MODES_VERSION },
_gl_context_modes_create,
_gl_context_modes_destroy,
+};
- getDrawableInfo,
-
+static const __DRIsystemTimeExtension systemTimeExtension = {
+ { __DRI_SYSTEM_TIME, __DRI_SYSTEM_TIME_VERSION },
getUST,
- NULL, /* glXGetMscRateOML, */
+ NULL,
+};
+
+static const __DRIgetDrawableInfoExtension getDrawableInfoExtension = {
+ { __DRI_GET_DRAWABLE_INFO, __DRI_GET_DRAWABLE_INFO_VERSION },
+ getDrawableInfo
+};
+static const __DRIdamageExtension damageExtension = {
+ { __DRI_DAMAGE, __DRI_DAMAGE_VERSION },
__glXReportDamage,
};
+static const __DRIextension *loader_extensions[] = {
+ &contextModesExtension.base,
+ &systemTimeExtension.base,
+ &getDrawableInfoExtension.base,
+ &damageExtension.base,
+ NULL
+};
+
+
+
static const char dri_driver_path[] = DRI_DRIVER_PATH;
static Bool
@@ -926,7 +946,6 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
__DRIframebuffer framebuffer;
int fd = -1;
int status;
- int api_ver = 20070121;
drm_magic_t magic;
drmVersionPtr version;
int newlyopened;
@@ -1091,8 +1110,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
&framebuffer,
pSAREA,
fd,
- api_ver,
- &interface_methods,
+ loader_extensions,
&screen->base.fbconfigs);
if (screen->driScreen.private == NULL) {
diff --git a/GL/glx/glxdri2.c b/GL/glx/glxdri2.c
index d1c8d417e..b0082a040 100644
--- a/GL/glx/glxdri2.c
+++ b/GL/glx/glxdri2.c
@@ -414,18 +414,30 @@ static void __glXReportDamage(__DRIdrawable *driDraw,
}
/* Table of functions that we export to the driver. */
-static const __DRIinterfaceMethods interface_methods = {
+static const __DRIcontextModesExtension contextModesExtension = {
+ { __DRI_CONTEXT_MODES, __DRI_CONTEXT_MODES_VERSION },
_gl_context_modes_create,
_gl_context_modes_destroy,
+};
- NULL,
-
+static const __DRIsystemTimeExtension systemTimeExtension = {
+ { __DRI_SYSTEM_TIME, __DRI_SYSTEM_TIME_VERSION },
getUST,
NULL,
+};
+static const __DRIdamageExtension damageExtension = {
+ { __DRI_DAMAGE, __DRI_DAMAGE_VERSION },
__glXReportDamage,
};
+static const __DRIextension *loader_extensions[] = {
+ &contextModesExtension.base,
+ &systemTimeExtension.base,
+ &damageExtension.base,
+ NULL
+};
+
static const char dri_driver_path[] = DRI_DRIVER_PATH;
static Bool
@@ -502,10 +514,6 @@ static __GLXscreen *
__glXDRIscreenProbe(ScreenPtr pScreen)
{
__DRI2_CREATE_NEW_SCREEN_FUNC *createNewScreen;
- __DRIversion ddx_version;
- __DRIversion dri_version;
- __DRIversion drm_version;
- drmVersionPtr version;
const char *driverName;
__GLXDRIscreen *screen;
char filename[128];
@@ -522,9 +530,6 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
!DRI2Connect(pScreen,
&screen->fd,
&driverName,
- &ddx_version.major,
- &ddx_version.minor,
- &ddx_version.patch,
&sareaHandle)) {
LogMessage(X_INFO,
"AIGLX: Screen %d is not DRI2 capable\n", pScreen->myNum);
@@ -539,24 +544,6 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
__glXInitExtensionEnableBits(screen->glx_enable_bits);
- /* DRI protocol version. */
- dri_version.major = XF86DRI_MAJOR_VERSION;
- dri_version.minor = XF86DRI_MINOR_VERSION;
- dri_version.patch = XF86DRI_PATCH_VERSION;
-
- version = drmGetVersion(screen->fd);
- if (version) {
- drm_version.major = version->version_major;
- drm_version.minor = version->version_minor;
- drm_version.patch = version->version_patchlevel;
- drmFreeVersion(version);
- }
- else {
- drm_version.major = -1;
- drm_version.minor = -1;
- drm_version.patch = -1;
- }
-
snprintf(filename, sizeof filename, "%s/%s_dri.so",
dri_driver_path, driverName);
@@ -577,12 +564,9 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
screen->driScreen.private =
(*createNewScreen)(pScreen->myNum,
&screen->driScreen,
- &ddx_version,
- &dri_version,
- &drm_version,
screen->fd,
sareaHandle,
- &interface_methods,
+ loader_extensions,
&screen->base.fbconfigs);
if (screen->driScreen.private == NULL) {