summaryrefslogtreecommitdiffstats
path: root/src/glx
diff options
context:
space:
mode:
authorMichal Krol <[email protected]>2010-03-10 15:49:30 +0100
committerMichal Krol <[email protected]>2010-03-10 15:49:30 +0100
commit3ce4375912c8ea488460e593e07c5bb15b92dca9 (patch)
tree1011fa439bd829fd46a44fd99478135848800e73 /src/glx
parentf59f28093ea827bd234d8e1a36bdd56a9fce5f09 (diff)
parent9b348d0ed125a22be3f318ac60cef6f201edfdab (diff)
Merge branch 'master' into gallium-sampler-view
Conflicts: src/gallium/auxiliary/Makefile src/gallium/auxiliary/SConscript src/gallium/auxiliary/tgsi/tgsi_exec.c src/gallium/auxiliary/util/u_blitter.c src/gallium/drivers/i915/i915_context.h src/gallium/drivers/i965/brw_context.h src/gallium/drivers/llvmpipe/lp_context.h src/gallium/drivers/nv50/nv50_context.h src/gallium/drivers/nv50/nv50_state_validate.c src/gallium/drivers/nv50/nv50_tex.c src/gallium/drivers/r300/r300_blit.c src/gallium/drivers/r300/r300_context.h src/gallium/drivers/r300/r300_emit.c src/gallium/drivers/r300/r300_state.c src/gallium/drivers/softpipe/sp_context.h src/gallium/drivers/svga/svga_context.h src/gallium/drivers/svga/svga_pipe_sampler.c
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/glcontextmodes.c42
-rw-r--r--src/glx/glcontextmodes.h2
-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
17 files changed, 29 insertions, 67 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/glcontextmodes.c b/src/glx/glcontextmodes.c
index 232031c2ca8..eb9037907fc 100644
--- a/src/glx/glcontextmodes.c
+++ b/src/glx/glcontextmodes.c
@@ -31,42 +31,13 @@
* \author Ian Romanick <[email protected]>
*/
-#if defined(IN_MINI_GLX)
-#include <GL/gl.h>
-#else
-#if defined(HAVE_DIX_CONFIG_H)
-# include <dix-config.h>
-#endif
-#include <X11/X.h>
#include <GL/glx.h>
#include "GL/glxint.h"
-#endif
-
-/* Memory macros */
-#if defined(IN_MINI_GLX)
-# include <stdlib.h>
-# include <string.h>
-# define _mesa_malloc(b) malloc(b)
-# define _mesa_free(m) free(m)
-# define _mesa_memset memset
-#else
-# ifdef XFree86Server
-# include <os.h>
-# include <string.h>
-# define _mesa_malloc(b) xalloc(b)
-# define _mesa_free(m) xfree(m)
-# define _mesa_memset memset
-# else
-# include <X11/Xlibint.h>
-# define _mesa_memset memset
-# define _mesa_malloc(b) Xmalloc(b)
-# define _mesa_free(m) Xfree(m)
-# endif /* XFree86Server */
-#endif /* !defined(IN_MINI_GLX) */
+#include <stdlib.h>
+#include <string.h>
#include "glcontextmodes.h"
-#if !defined(IN_MINI_GLX)
#define NUM_VISUAL_TYPES 6
/**
@@ -133,7 +104,7 @@ _gl_copy_visual_to_context_mode(__GLcontextModes * mode,
{
__GLcontextModes *const next = mode->next;
- (void) _mesa_memset(mode, 0, sizeof(__GLcontextModes));
+ (void) memset(mode, 0, sizeof(__GLcontextModes));
mode->next = next;
mode->visualID = config->vid;
@@ -355,7 +326,6 @@ _gl_get_context_mode_data(const __GLcontextModes * mode, int attribute,
return GLX_BAD_ATTRIBUTE;
}
}
-#endif /* !defined(IN_MINI_GLX) */
/**
@@ -395,14 +365,14 @@ _gl_context_modes_create(unsigned count, size_t minimum_size)
next = &base;
for (i = 0; i < count; i++) {
- *next = (__GLcontextModes *) _mesa_malloc(size);
+ *next = (__GLcontextModes *) malloc(size);
if (*next == NULL) {
_gl_context_modes_destroy(base);
base = NULL;
break;
}
- (void) _mesa_memset(*next, 0, size);
+ (void) memset(*next, 0, size);
(*next)->visualID = GLX_DONT_CARE;
(*next)->visualType = GLX_DONT_CARE;
(*next)->visualRating = GLX_NONE;
@@ -441,7 +411,7 @@ _gl_context_modes_destroy(__GLcontextModes * modes)
while (modes != NULL) {
__GLcontextModes *const next = modes->next;
- _mesa_free(modes);
+ free(modes);
modes = next;
}
}
diff --git a/src/glx/glcontextmodes.h b/src/glx/glcontextmodes.h
index 6676ae306c2..ecf0280cba3 100644
--- a/src/glx/glcontextmodes.h
+++ b/src/glx/glcontextmodes.h
@@ -32,14 +32,12 @@
#include "GL/internal/glcore.h"
-#if !defined(IN_MINI_GLX)
extern GLint _gl_convert_from_x_visual_type(int visualType);
extern GLint _gl_convert_to_x_visual_type(int visualType);
extern void _gl_copy_visual_to_context_mode(__GLcontextModes * mode,
const __GLXvisualConfig * config);
extern int _gl_get_context_mode_data(const __GLcontextModes * mode,
int attribute, int *value_return);
-#endif /* !defined(IN_MINI_GLX) */
extern __GLcontextModes *_gl_context_modes_create(unsigned count,
size_t minimum_size);
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