aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/glx/glxdri2.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-03-15 21:35:41 +0000
committermarha <marha@users.sourceforge.net>2011-03-15 21:35:41 +0000
commit5e633abcca598289d0423d89bb400b41e6417259 (patch)
tree74258f0d1f9f5f2b171d16fd9654a13803216c6f /xorg-server/glx/glxdri2.c
parentb5d1fd89898edb34f73679b542c754d837d44cf8 (diff)
downloadvcxsrv-5e633abcca598289d0423d89bb400b41e6417259.tar.gz
vcxsrv-5e633abcca598289d0423d89bb400b41e6417259.tar.bz2
vcxsrv-5e633abcca598289d0423d89bb400b41e6417259.zip
xserver libX11 libxcb mesa git update 15 Mar 2011
Diffstat (limited to 'xorg-server/glx/glxdri2.c')
-rw-r--r--xorg-server/glx/glxdri2.c39
1 files changed, 3 insertions, 36 deletions
diff --git a/xorg-server/glx/glxdri2.c b/xorg-server/glx/glxdri2.c
index c9c316be5..9d4aeab23 100644
--- a/xorg-server/glx/glxdri2.c
+++ b/xorg-server/glx/glxdri2.c
@@ -599,8 +599,6 @@ static const __DRIextension *loader_extensions[] = {
NULL
};
-static const char dri_driver_path[] = DRI_DRIVER_PATH;
-
static Bool
glxDRIEnterVT (int index, int flags)
{
@@ -702,12 +700,9 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
{
const char *driverName, *deviceName;
__GLXDRIscreen *screen;
- char filename[128];
size_t buffer_size;
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- const __DRIextension **extensions;
const __DRIconfig **driConfigs;
- int i;
screen = calloc(1, sizeof *screen);
if (screen == NULL)
@@ -729,40 +724,12 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
__glXInitExtensionEnableBits(screen->glx_enable_bits);
- snprintf(filename, sizeof filename,
- "%s/%s_dri.so", dri_driver_path, driverName);
-
- screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
+ screen->driver = glxProbeDriver(driverName, (void **)&screen->core, __DRI_CORE, 1,
+ (void **)&screen->dri2, __DRI_DRI2, 1);
if (screen->driver == NULL) {
- LogMessage(X_ERROR, "AIGLX error: dlopen of %s failed (%s)\n",
- filename, dlerror());
goto handle_error;
}
-
- extensions = dlsym(screen->driver, __DRI_DRIVER_EXTENSIONS);
- 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 >= 1) {
- screen->core = (const __DRIcoreExtension *) extensions[i];
- }
- if (strcmp(extensions[i]->name, __DRI_DRI2) == 0 &&
- extensions[i]->version >= 1) {
- screen->dri2 = (const __DRIdri2Extension *) extensions[i];
- }
- }
-
- if (screen->core == NULL || screen->dri2 == NULL) {
- LogMessage(X_ERROR, "AIGLX error: %s exports no DRI extension\n",
- driverName);
- goto handle_error;
- }
-
screen->driScreen =
(*screen->dri2->createNewScreen)(pScreen->myNum,
screen->fd,
@@ -816,7 +783,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
pScrn->LeaveVT = glxDRILeaveVT;
LogMessage(X_INFO,
- "AIGLX: Loaded and initialized %s\n", filename);
+ "AIGLX: Loaded and initialized %s\n", driverName);
return &screen->base;