From c85499f8caadee1657ebb3c2a31a0f30035ac093 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Wed, 15 Apr 2009 15:19:12 +0000 Subject: [PATCH] - mesa-7.5-get-driver-name.patch: Fix glXGetScreenDriver for DRI2 (#495342) --- mesa-7.5-get-driver-name.patch | 85 ++++++++++++++++++++++++++++++++++ mesa.spec | 8 +++- 2 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 mesa-7.5-get-driver-name.patch diff --git a/mesa-7.5-get-driver-name.patch b/mesa-7.5-get-driver-name.patch new file mode 100644 index 0000000..51dc2a9 --- /dev/null +++ b/mesa-7.5-get-driver-name.patch @@ -0,0 +1,85 @@ +commit a3c3c1f1437de0186d70de9017a6a8e404ecf482 +Author: Adam Jackson +Date: Tue Apr 14 17:56:29 2009 -0400 + + glx: Make glXGetScreenDriver() work for DRI2 + +diff --git a/src/glx/x11/dri_glx.c b/src/glx/x11/dri_glx.c +index 3089aa1..87d62ad 100644 +--- a/src/glx/x11/dri_glx.c ++++ b/src/glx/x11/dri_glx.c +@@ -40,6 +40,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #include "glxclient.h" + #include "glcontextmodes.h" + #include "xf86dri.h" ++#include "dri2.h" + #include "sarea.h" + #include + #include +@@ -75,32 +76,45 @@ struct __GLXDRIcontextPrivateRec { + */ + static Bool driGetDriverName(Display *dpy, int scrNum, char **driverName) + { +- int directCapable; +- Bool b; +- int driverMajor, driverMinor, driverPatch; ++ int directCapable; ++ Bool b; ++ int event, error; ++ int driverMajor, driverMinor, driverPatch; + +- *driverName = NULL; ++ *driverName = NULL; + +- if (!XF86DRIQueryDirectRenderingCapable(dpy, scrNum, &directCapable)) { +- ErrorMessageF("XF86DRIQueryDirectRenderingCapable failed\n"); +- return False; +- } +- if (!directCapable) { +- ErrorMessageF("XF86DRIQueryDirectRenderingCapable returned false\n"); +- return False; +- } ++ if (XF86DRIQueryExtension(dpy, &event, &error)) { /* DRI1 */ ++ if (!XF86DRIQueryDirectRenderingCapable(dpy, scrNum, &directCapable)) { ++ ErrorMessageF("XF86DRIQueryDirectRenderingCapable failed\n"); ++ return False; ++ } ++ if (!directCapable) { ++ ErrorMessageF("XF86DRIQueryDirectRenderingCapable returned false\n"); ++ return False; ++ } + +- b = XF86DRIGetClientDriverName(dpy, scrNum, &driverMajor, &driverMinor, +- &driverPatch, driverName); +- if (!b) { +- ErrorMessageF("Cannot determine driver name for screen %d\n", scrNum); +- return False; +- } ++ b = XF86DRIGetClientDriverName(dpy, scrNum, &driverMajor, &driverMinor, ++ &driverPatch, driverName); ++ if (!b) { ++ ErrorMessageF("Cannot determine driver name for screen %d\n", scrNum); ++ return False; ++ } ++ ++ InfoMessageF("XF86DRIGetClientDriverName: %d.%d.%d %s (screen %d)\n", ++ driverMajor, driverMinor, driverPatch, *driverName, scrNum); ++ ++ return True; ++ } else if (DRI2QueryExtension(dpy, &event, &error)) { /* DRI2 */ ++ char *dev; ++ Bool ret = DRI2Connect(dpy, RootWindow(dpy, scrNum), driverName, &dev); + +- InfoMessageF("XF86DRIGetClientDriverName: %d.%d.%d %s (screen %d)\n", +- driverMajor, driverMinor, driverPatch, *driverName, scrNum); ++ if (ret) ++ Xfree(dev); ++ ++ return ret; ++ } + +- return True; ++ return False; + } + + /* diff --git a/mesa.spec b/mesa.spec index 081f6a0..b2f4a48 100644 --- a/mesa.spec +++ b/mesa.spec @@ -20,7 +20,7 @@ Summary: Mesa graphics libraries Name: mesa Version: 7.5 -Release: 0.9%{?dist} +Release: 0.10%{?dist} License: MIT Group: System Environment/Libraries URL: http://www.mesa3d.org @@ -48,6 +48,8 @@ Patch9: intel-revert-vbl.patch Patch12: mesa-7.1-disable-intel-classic-warn.patch Patch13: mesa-7.5-sparc64.patch +Patch20: mesa-7.5-get-driver-name.patch + BuildRequires: pkgconfig autoconf automake %if %{with_dri} BuildRequires: libdrm-devel >= 2.4.5-1 @@ -175,6 +177,7 @@ This package provides some demo applications for testing Mesa. %patch9 -p1 -b .intel-vbl %patch12 -p1 -b .intel-nowarn %patch13 -p1 -b .sparc64 +%patch20 -p1 -b .get-driver-name # Hack the demos to use installed data files sed -i 's,../images,%{_libdir}/mesa-demos-data,' progs/demos/*.c @@ -431,6 +434,9 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/mesa-demos-data %changelog +* Tue Apr 14 2009 Adam Jackson 7.5-0.10 +- mesa-7.5-get-driver-name.patch: Fix glXGetScreenDriver for DRI2 (#495342) + * Fri Apr 09 2009 Dennis Gilmore - 7.5-0.9 - fix sparc64 asm