diff options
Diffstat (limited to 'xorg-server/glx/glxdriswrast.c')
-rw-r--r-- | xorg-server/glx/glxdriswrast.c | 77 |
1 files changed, 14 insertions, 63 deletions
diff --git a/xorg-server/glx/glxdriswrast.c b/xorg-server/glx/glxdriswrast.c index 4cabf6451..59a202b16 100644 --- a/xorg-server/glx/glxdriswrast.c +++ b/xorg-server/glx/glxdriswrast.c @@ -58,17 +58,6 @@ #include "dispatch.h"
#include "extension_string.h"
-/* RTLD_LOCAL is not defined on Cygwin */
-#ifdef __CYGWIN__
-#ifndef RTLD_LOCAL
-#define RTLD_LOCAL 0
-#endif
-#endif
-
-#ifdef _MSC_VER
-#define dlerror() "Getting loadlibrary error string not implemented"
-#endif
-
typedef struct __GLXDRIscreen __GLXDRIscreen;
typedef struct __GLXDRIcontext __GLXDRIcontext;
typedef struct __GLXDRIdrawable __GLXDRIdrawable;
@@ -209,6 +198,14 @@ __glXDRIbindTexImage(struct glx_context *baseContext, if (texBuffer == NULL)
return Success;
+#if __DRI_TEX_BUFFER_VERSION >= 2
+ if (texBuffer->base.version >= 2 && texBuffer->setTexBuffer2 != NULL) {
+ (*texBuffer->setTexBuffer2)(context->driContext,
+ glxPixmap->target,
+ glxPixmap->format,
+ drawable->driDrawable);
+ } else
+#endif
texBuffer->setTexBuffer(context->driContext,
glxPixmap->target,
drawable->driDrawable);
@@ -439,17 +436,12 @@ initializeExtensions(__GLXDRIscreen *screen) }
}
-static const char dri_driver_path[] = DRI_DRIVER_PATH;
-
static __GLXscreen *
__glXDRIscreenProbe(ScreenPtr pScreen)
{
const char *driverName = "swrast";
__GLXDRIscreen *screen;
- char filename[128];
- const __DRIextension **extensions;
const __DRIconfig **driConfigs;
- int i;
screen = calloc(1, sizeof *screen);
if (screen == NULL)
@@ -461,56 +453,15 @@ __glXDRIscreenProbe(ScreenPtr pScreen) screen->base.swapInterval = NULL;
screen->base.pScreen = pScreen;
-#ifdef _MSC_VER
-#ifdef _DEBUG
-#define DLLNAME "%s%s_dri_dbg.dll"
-#else
-#define DLLNAME "%s%s_dri.dll"
-#endif
- snprintf(filename, sizeof filename,
- DLLNAME, dri_driver_path, driverName);
-
- screen->driver = LoadLibrary(filename);
-#else
- snprintf(filename, sizeof filename,
- "%s/%s_dri.so", dri_driver_path, driverName);
-
- screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
-#endif
+ screen->driver = glxProbeDriver(driverName,
+ (void **)&screen->core,
+ __DRI_CORE, __DRI_CORE_VERSION,
+ (void **)&screen->swrast,
+ __DRI_SWRAST, __DRI_SWRAST_VERSION);
if (screen->driver == NULL) {
- LogMessage(X_ERROR, "AIGLX error: dlopen of %s failed (%s)\n",
- filename, dlerror());
goto handle_error;
}
-#ifdef _MSC_VER
- extensions = (const __DRIextension **)GetProcAddress(screen->driver, __DRI_DRIVER_EXTENSIONS);
-#else
- extensions = dlsym(screen->driver, __DRI_DRIVER_EXTENSIONS);
-#endif
- if (extensions == NULL) {
- LogMessage(X_ERROR, "AIGLX error: %s exports no extensions (%s)\n",
- driverName, dlerror());
- goto handle_error;
- }
-
- for (i = 0; extensions[i]; i++) {
- if (strcmp(extensions[i]->name, __DRI_CORE) == 0 &&
- extensions[i]->version >= __DRI_CORE_VERSION) {
- screen->core = (const __DRIcoreExtension *) extensions[i];
- }
- if (strcmp(extensions[i]->name, __DRI_SWRAST) == 0 &&
- extensions[i]->version >= __DRI_SWRAST_VERSION) {
- screen->swrast = (const __DRIswrastExtension *) extensions[i];
- }
- }
-
- if (screen->core == NULL || screen->swrast == NULL) {
- LogMessage(X_ERROR, "AIGLX error: %s exports no DRI extension\n",
- driverName);
- goto handle_error;
- }
-
screen->driScreen =
(*screen->swrast->createNewScreen)(pScreen->myNum,
loader_extensions,
@@ -536,7 +487,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) screen->base.GLXminor = 4;
LogMessage(X_INFO,
- "AIGLX: Loaded and initialized %s\n", filename);
+ "AIGLX: Loaded and initialized %s\n", driverName);
return &screen->base;
|