xserver: Branch 'master'

Kristian Høgsberg krh at kemper.freedesktop.org
Fri Feb 29 12:14:10 PST 2008


 GL/glx/glxdri.c        |   32 +++++++++++++++++++++++++-------
 GL/glx/glxdri2.c       |   48 ++++++++++++++++--------------------------------
 hw/xfree86/dri2/dri2.c |   10 ----------
 hw/xfree86/dri2/dri2.h |    4 ----
 4 files changed, 41 insertions(+), 53 deletions(-)

New commits:
commit 13bfa5937d43392f686b76a99ea6331e3dce5987
Author: Kristian Høgsberg <krh at redhat.com>
Date:   Fri Feb 29 15:10:36 2008 -0500

    GLX: Adjust to changes in DRI driver interface.

diff --git a/GL/glx/glxdri.c b/GL/glx/glxdri.c
index f9b28e4..dc15b0f 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 d1c8d41..b0082a0 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) {
diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index 3bc533e..9b4c18c 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -58,9 +58,6 @@ typedef struct _DRI2Screen {
     void			*sarea;
     unsigned int		 sareaSize;
     const char			*driverName;
-    int				 ddxVersionMajor;
-    int				 ddxVersionMinor;
-    int				 ddxVersionPatch;
 
     __DRIEventBuffer		*buffer;
     int				 locked;
@@ -330,7 +327,6 @@ DRI2DestroyDrawable(ScreenPtr pScreen, DrawablePtr pDraw)
 
 Bool
 DRI2Connect(ScreenPtr pScreen, int *fd, const char **driverName,
-	    int *ddxMajor, int *ddxMinor, int *ddxPatch,
 	    unsigned int *sareaHandle)
 {
     DRI2ScreenPtr ds = DRI2GetScreen(pScreen);
@@ -340,9 +336,6 @@ DRI2Connect(ScreenPtr pScreen, int *fd, const char **driverName,
 
     *fd = ds->fd;
     *driverName = ds->driverName;
-    *ddxMajor = ds->ddxVersionMajor;
-    *ddxMinor = ds->ddxVersionMinor;
-    *ddxPatch = ds->ddxVersionPatch;
     *sareaHandle = ds->sareaBO.handle;
 
     return TRUE;
@@ -406,9 +399,6 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
 
     ds->fd = info->fd;
     ds->driverName		= info->driverName;
-    ds->ddxVersionMajor		= info->ddxVersionMajor;
-    ds->ddxVersionMinor		= info->ddxVersionMinor;
-    ds->ddxVersionPatch		= info->ddxVersionPatch;
 
     ds->getPixmapHandle		= info->getPixmapHandle;
     ds->beginClipNotify		= info->beginClipNotify;
diff --git a/hw/xfree86/dri2/dri2.h b/hw/xfree86/dri2/dri2.h
index c687a93..c848247 100644
--- a/hw/xfree86/dri2/dri2.h
+++ b/hw/xfree86/dri2/dri2.h
@@ -43,7 +43,6 @@ typedef struct {
     int fd;
     size_t driverSareaSize;
     const char *driverName;
-    int ddxVersionMajor, ddxVersionMinor, ddxVersionPatch;
     DRI2GetPixmapHandleProcPtr getPixmapHandle;
     DRI2BeginClipNotifyProcPtr beginClipNotify;
     DRI2EndClipNotifyProcPtr endClipNotify;
@@ -57,9 +56,6 @@ void DRI2CloseScreen(ScreenPtr pScreen);
 Bool DRI2Connect(ScreenPtr pScreen,
 		 int *fd,
 		 const char **driverName,
-		 int *ddxMajor,
-		 int *ddxMinor,
-		 int *ddxPatch,
 		 unsigned int *sareaHandle);
 
 unsigned int DRI2GetPixmapHandle(PixmapPtr pPixmap,


More information about the xorg-commit mailing list