summaryrefslogtreecommitdiffstats
path: root/src/glx
diff options
context:
space:
mode:
authorZack Rusin <[email protected]>2010-03-15 15:24:38 -0400
committerZack Rusin <[email protected]>2010-03-15 15:24:38 -0400
commit275c4bd3643d773210780cb8d578ca84f2604684 (patch)
tree8266edc39d4253ac0f2a0ecd41f560f3d815bb5c /src/glx
parentc5c5cd7132e18f4aad8e73d8ee879f8823c4c1e7 (diff)
parentd0b35352ed27b1e66785c45ee95a352ed06b47ce (diff)
Merge remote branch 'origin/master' into gallium_draw_llvm
Diffstat (limited to 'src/glx')
-rw-r--r--src/glx/XF86dri.c2
-rw-r--r--src/glx/dri2_glx.c6
-rw-r--r--src/glx/dri_glx.c3
-rw-r--r--src/glx/drisw_glx.c3
-rw-r--r--src/glx/glx_pbuffer.c3
-rw-r--r--src/glx/glxclient.h2
-rw-r--r--src/glx/glxcmds.c10
-rw-r--r--src/glx/glxext.c3
-rw-r--r--src/glx/indirect.c3
-rw-r--r--src/glx/indirect.h2
-rw-r--r--src/glx/indirect_size.c4
-rw-r--r--src/glx/indirect_size.h4
-rw-r--r--src/glx/indirect_vertex_array.c3
-rw-r--r--src/glx/indirect_vertex_program.c2
-rw-r--r--src/glx/pixelstore.c2
-rw-r--r--src/glx/single2.c3
16 files changed, 26 insertions, 29 deletions
diff --git a/src/glx/XF86dri.c b/src/glx/XF86dri.c
index 248d96ac5de..fdbdd43000e 100644
--- a/src/glx/XF86dri.c
+++ b/src/glx/XF86dri.c
@@ -45,7 +45,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "xf86dristr.h"
-#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303
+#if defined(__GNUC__)
# define PUBLIC __attribute__((visibility("default")))
# define USED __attribute__((used))
#else
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
index 29d589cdb90..5b0f335db6a 100644
--- a/src/glx/dri2_glx.c
+++ b/src/glx/dri2_glx.c
@@ -519,9 +519,6 @@ dri2CreateScreen(__GLXscreenConfigs * psc, int screen,
if (psp == NULL)
return NULL;
- /* Initialize per screen dynamic client GLX extensions */
- psc->ext_list_first_time = GL_TRUE;
-
if (!DRI2Connect(psc->dpy, RootWindow(psc->dpy, screen),
&driverName, &deviceName)) {
XFree(psp);
@@ -614,6 +611,9 @@ dri2CreateScreen(__GLXscreenConfigs * psc, int screen,
psp->setSwapInterval = dri2SetSwapInterval;
psp->getSwapInterval = dri2GetSwapInterval;
#endif
+#if defined(X_DRI2GetMSC) && defined(X_DRI2WaitMSC) && defined(X_DRI2SwapInterval)
+ __glXEnableDirectExtension(psc, "GLX_OML_sync_control");
+#endif
}
/* DRI2 suports SubBuffer through DRI2CopyRegion, so it's always
diff --git a/src/glx/dri_glx.c b/src/glx/dri_glx.c
index f9fe9a25db4..e47db82b70f 100644
--- a/src/glx/dri_glx.c
+++ b/src/glx/dri_glx.c
@@ -648,9 +648,6 @@ driCreateScreen(__GLXscreenConfigs * psc, int screen,
if (psp == NULL)
return NULL;
- /* Initialize per screen dynamic client GLX extensions */
- psc->ext_list_first_time = GL_TRUE;
-
if (!driGetDriverName(priv->dpy, screen, &driverName)) {
Xfree(psp);
return NULL;
diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c
index eed9a8c4723..1b94a56fd13 100644
--- a/src/glx/drisw_glx.c
+++ b/src/glx/drisw_glx.c
@@ -364,9 +364,6 @@ driCreateScreen(__GLXscreenConfigs * psc, int screen,
if (psp == NULL)
return NULL;
- /* Initialize per screen dynamic client GLX extensions */
- psc->ext_list_first_time = GL_TRUE;
-
psc->driver = driOpenDriver(driverName);
if (psc->driver == NULL)
goto handle_error;
diff --git a/src/glx/glx_pbuffer.c b/src/glx/glx_pbuffer.c
index 4c122ba6ddc..52e067165c8 100644
--- a/src/glx/glx_pbuffer.c
+++ b/src/glx/glx_pbuffer.c
@@ -379,7 +379,8 @@ CreateDrawable(Display * dpy, const __GLcontextModes * fbconfig,
req->glxwindow = (GLXWindow) XAllocID(dpy);
req->numAttribs = (CARD32) i;
- memcpy(data, attrib_list, 8 * i);
+ if (attrib_list)
+ memcpy(data, attrib_list, 8 * i);
UnlockDisplay(dpy);
SyncHandle();
diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h
index 04ce781c435..8e5dc785dd9 100644
--- a/src/glx/glxclient.h
+++ b/src/glx/glxclient.h
@@ -69,7 +69,7 @@
* We also need to define a USED attribute, so the optimizer doesn't
* inline a static function that we later use in an alias. - ajax
*/
-#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303
+#if defined(__GNUC__)
# define PUBLIC __attribute__((visibility("default")))
# define USED __attribute__((used))
#else
diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
index 704e9a0b9d7..49cbce72f8a 100644
--- a/src/glx/glxcmds.c
+++ b/src/glx/glxcmds.c
@@ -2364,7 +2364,7 @@ __glXGetSyncValuesOML(Display * dpy, GLXDrawable drawable,
psc = &priv->screenConfigs[i];
#if defined(__DRI_SWAP_BUFFER_COUNTER) && defined(__DRI_MEDIA_STREAM_COUNTER)
- if (pdraw && psc->sbc && psc->sbc)
+ if (pdraw && psc->sbc && psc->msc)
return ( (pdraw && psc->sbc && psc->msc)
&& ((*psc->msc->getMSC)(psc->driScreen, msc) == 0)
&& ((*psc->sbc->getSBC)(pdraw->driDrawable, sbc) == 0)
@@ -2494,7 +2494,7 @@ __glXSwapBuffersMscOML(Display * dpy, GLXDrawable drawable,
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, &screen);
__GLXscreenConfigs *const psc = GetGLXScreenConfigs(dpy, screen);
- if (!pdraw || !gc->driContext) /* no GLX for this */
+ if (!pdraw || !gc || !gc->driContext) /* no GLX for this */
return -1;
/* The OML_sync_control spec says these should "generate a GLX_BAD_VALUE
@@ -2534,8 +2534,6 @@ __glXWaitForMscOML(Display * dpy, GLXDrawable drawable,
__GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, screen );
int ret;
- fprintf(stderr, "waitmsc: %lld, %lld, %lld\n", target_msc, divisor,
- remainder);
/* The OML_sync_control spec says these should "generate a GLX_BAD_VALUE
* error", but the return type in the spec is Bool.
@@ -2547,7 +2545,6 @@ __glXWaitForMscOML(Display * dpy, GLXDrawable drawable,
#ifdef __DRI_MEDIA_STREAM_COUNTER
if (pdraw != NULL && psc->msc != NULL) {
- fprintf(stderr, "dri1 msc\n");
ret = (*psc->msc->waitForMSC) (pdraw->driDrawable, target_msc,
divisor, remainder, msc, sbc);
@@ -2563,7 +2560,6 @@ __glXWaitForMscOML(Display * dpy, GLXDrawable drawable,
return ret;
}
- fprintf(stderr, "no drawable??\n");
return False;
}
@@ -2594,7 +2590,7 @@ __glXWaitForSbcOML(Display * dpy, GLXDrawable drawable,
return ((ret == 0) && (__glXGetUST(ust) == 0));
}
#endif
- if (pdraw && psc->driScreen && psc->driScreen->waitForMSC) {
+ if (pdraw && psc->driScreen && psc->driScreen->waitForSBC) {
ret = psc->driScreen->waitForSBC(pdraw, target_sbc, ust, msc, sbc);
return ret;
}
diff --git a/src/glx/glxext.c b/src/glx/glxext.c
index c2de1a3fff8..b5657baf2e8 100644
--- a/src/glx/glxext.c
+++ b/src/glx/glxext.c
@@ -717,6 +717,9 @@ AllocAndFetchScreenConfigs(Display * dpy, __GLXdisplayPrivate * priv)
if (psc->drawHash == NULL)
continue;
+ /* Initialize per screen dynamic client GLX extensions */
+ psc->ext_list_first_time = GL_TRUE;
+
if (priv->dri2Display)
psc->driScreen = (*priv->dri2Display->createScreen) (psc, i, priv);
diff --git a/src/glx/indirect.c b/src/glx/indirect.c
index 48bae1478f4..42a225f6711 100644
--- a/src/glx/indirect.c
+++ b/src/glx/indirect.c
@@ -30,7 +30,6 @@
#include "indirect.h"
#include "glxclient.h"
#include "indirect_size.h"
-#include "glapitable.h"
#include "glapidispatch.h"
#include "glapi.h"
#include "glthread.h"
@@ -54,7 +53,7 @@
# define NOINLINE
# endif
-#if !defined __GNUC__ || __GNUC__ < 3
+#ifndef __GNUC__
# define __builtin_expect(x, y) x
#endif
diff --git a/src/glx/indirect.h b/src/glx/indirect.h
index 9e73b338184..b09b61aae76 100644
--- a/src/glx/indirect.h
+++ b/src/glx/indirect.h
@@ -37,7 +37,7 @@
* \author Ian Romanick <[email protected]>
*/
-# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__)
+# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) && defined(__ELF__)
# define HIDDEN __attribute__((visibility("hidden")))
# else
# define HIDDEN
diff --git a/src/glx/indirect_size.c b/src/glx/indirect_size.c
index 6356ddd49b5..0c136d26cdd 100644
--- a/src/glx/indirect_size.c
+++ b/src/glx/indirect_size.c
@@ -29,7 +29,7 @@
#include <GL/gl.h>
#include "indirect_size.h"
-# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
+# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
# define PURE __attribute__((pure))
# else
# define PURE
@@ -41,7 +41,7 @@
# define FASTCALL
# endif
-# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__)
+# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) && defined(__ELF__)
# define INTERNAL __attribute__((visibility("internal")))
# else
# define INTERNAL
diff --git a/src/glx/indirect_size.h b/src/glx/indirect_size.h
index af0919f9645..79b849b6839 100644
--- a/src/glx/indirect_size.h
+++ b/src/glx/indirect_size.h
@@ -36,7 +36,7 @@
* \author Ian Romanick <[email protected]>
*/
-# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
+# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
# define PURE __attribute__((pure))
# else
# define PURE
@@ -48,7 +48,7 @@
# define FASTCALL
# endif
-# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__)
+# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) && defined(__ELF__)
# define INTERNAL __attribute__((visibility("internal")))
# else
# define INTERNAL
diff --git a/src/glx/indirect_vertex_array.c b/src/glx/indirect_vertex_array.c
index ad9882528ff..ec0e654ceae 100644
--- a/src/glx/indirect_vertex_array.c
+++ b/src/glx/indirect_vertex_array.c
@@ -291,7 +291,8 @@ __glXInitVertexArrayState(__GLXcontext * gc)
arrays->stack_index = 0;
arrays->stack = malloc(sizeof(struct array_stack_state)
- * arrays->num_arrays);
+ * arrays->num_arrays
+ * __GL_CLIENT_ATTRIB_STACK_DEPTH);
}
diff --git a/src/glx/indirect_vertex_program.c b/src/glx/indirect_vertex_program.c
index 3313ac008a5..d822a7ee56e 100644
--- a/src/glx/indirect_vertex_program.c
+++ b/src/glx/indirect_vertex_program.c
@@ -30,7 +30,7 @@
#include "indirect_vertex_array.h"
#include <GL/glxproto.h>
-#if !defined __GNUC__ || __GNUC__ < 3
+#if !defined(__GNUC__)
# define __builtin_expect(x, y) x
#endif
diff --git a/src/glx/pixelstore.c b/src/glx/pixelstore.c
index 8b51b5d8b7f..dc193b9f747 100644
--- a/src/glx/pixelstore.c
+++ b/src/glx/pixelstore.c
@@ -31,7 +31,7 @@
#include "glxclient.h"
#include "indirect.h"
-#if !defined __GNUC__ || __GNUC__ < 3
+#if !defined(__GNUC__)
# define __builtin_expect(x, y) x
#endif
diff --git a/src/glx/single2.c b/src/glx/single2.c
index 9ecf589ffff..a1461956b99 100644
--- a/src/glx/single2.c
+++ b/src/glx/single2.c
@@ -44,6 +44,9 @@
#include <X11/Xlib-xcb.h>
#endif /* USE_XCB */
+#if !defined(__GNUC__)
+# define __builtin_expect(x, y) x
+#endif
/* Used for GL_ARB_transpose_matrix */
static void