Updating the xorg dri path patch for dri2.

svn path=/nixpkgs/trunk/; revision=18225
This commit is contained in:
Lluís Batlle i Rossell 2009-11-06 21:15:59 +00:00
parent bc2ba3677b
commit b02ba2aff8

View File

@ -1,50 +1,52 @@
diff --exclude '*~' -rc xorg-server-1.5.3-orig/glx/glxdri.c xorg-server-1.5.3/glx/glxdri.c diff --git a/glx/glxdri.c b/glx/glxdri.c
*** xorg-server-1.5.3-orig/glx/glxdri.c 2008-11-05 19:48:30.000000000 +0100 index 6122653..3f5fc2b 100644
--- xorg-server-1.5.3/glx/glxdri.c 2009-09-02 23:11:06.000000000 +0200 --- a/glx/glxdri.c
*************** +++ b/glx/glxdri.c
*** 1013,1020 **** @@ -1042,8 +1042,11 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
goto handle_error; goto handle_error;
} }
snprintf(filename, sizeof filename, "%s/%s_dri.so", + char *real_dri_driver_path = getenv("XORG_DRI_DRIVER_PATH");
! dri_driver_path, driverName); + if (!real_dri_driver_path) real_dri_driver_path = dri_driver_path;
+
screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL); snprintf(filename, sizeof filename, "%s/%s_dri.so",
if (screen->driver == NULL) { - dri_driver_path, driverName);
--- 1013,1023 ---- + real_dri_driver_path, driverName);
goto handle_error;
} screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
if (screen->driver == NULL) {
diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index ed7fb4c..135b1c8 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -617,8 +617,11 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
__glXInitExtensionEnableBits(screen->glx_enable_bits);
- snprintf(filename, sizeof filename,
- "%s/%s_dri.so", dri_driver_path, driverName);
+ char *real_dri_driver_path = getenv("XORG_DRI_DRIVER_PATH"); + char *real_dri_driver_path = getenv("XORG_DRI_DRIVER_PATH");
+ if (!real_dri_driver_path) real_dri_driver_path = dri_driver_path; + if (!real_dri_driver_path) real_dri_driver_path = dri_driver_path;
+ +
snprintf(filename, sizeof filename, "%s/%s_dri.so", + snprintf(filename, sizeof filename, "%s/%s_dri.so",
! real_dri_driver_path, driverName); + real_dri_driver_path, driverName);
screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL); screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
if (screen->driver == NULL) { if (screen->driver == NULL) {
diff --exclude '*~' -rc xorg-server-1.5.3-orig/glx/glxdriswrast.c xorg-server-1.5.3/glx/glxdriswrast.c diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c
*** xorg-server-1.5.3-orig/glx/glxdriswrast.c 2008-11-05 17:52:17.000000000 +0100 index 44f658f..8922414 100644
--- xorg-server-1.5.3/glx/glxdriswrast.c 2009-09-02 23:12:19.000000000 +0200 --- a/glx/glxdriswrast.c
*************** +++ b/glx/glxdriswrast.c
*** 470,477 **** @@ -458,8 +458,11 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
screen->base.swapInterval = NULL; screen->base.swapInterval = NULL;
screen->base.pScreen = pScreen; screen->base.pScreen = pScreen;
snprintf(filename, sizeof filename, + char *real_dri_driver_path = getenv("XORG_DRI_DRIVER_PATH");
! "%s/%s_dri.so", dri_driver_path, driverName); + if (!real_dri_driver_path) real_dri_driver_path = dri_driver_path;
+
screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL); snprintf(filename, sizeof filename,
if (screen->driver == NULL) { - "%s/%s_dri.so", dri_driver_path, driverName);
--- 470,480 ---- + "%s/%s_dri.so", real_dri_driver_path, driverName);
screen->base.swapInterval = NULL;
screen->base.pScreen = pScreen; screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
if (screen->driver == NULL) {
+ char *real_dri_driver_path = getenv("XORG_DRI_DRIVER_PATH");
+ if (!real_dri_driver_path) real_dri_driver_path = dri_driver_path;
+
snprintf(filename, sizeof filename,
! "%s/%s_dri.so", real_dri_driver_path, driverName);
screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
if (screen->driver == NULL) {