diff options
-rw-r--r-- | GL/glx/glxdri.c | 32 | ||||
-rw-r--r-- | GL/glx/glxdri2.c | 48 | ||||
-rw-r--r-- | hw/xfree86/dri2/dri2.c | 10 | ||||
-rw-r--r-- | hw/xfree86/dri2/dri2.h | 4 |
4 files changed, 41 insertions, 53 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) { diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c index 3bc533ede..9b4c18c61 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 c687a93f6..c8482477e 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, |