diff options
author | José Fonseca <[email protected]> | 2010-01-31 05:36:33 +0000 |
---|---|---|
committer | José Fonseca <[email protected]> | 2010-01-31 05:36:33 +0000 |
commit | bee9964b29b2428ee75e2d1efc0e1d2c2518a417 (patch) | |
tree | fd733f886743b31f2ac2727e57f05d1a0918a977 /src/glx | |
parent | 36a0819ff4ede1af91dcf909106cf20659856384 (diff) | |
parent | 12eb32e34244db9923cacaaed9ba951b7ac274a4 (diff) |
Merge remote branch 'origin/master' into lp-binning
Conflicts:
Makefile
src/gallium/auxiliary/util/u_surface.c
src/gallium/drivers/llvmpipe/lp_flush.c
src/gallium/drivers/llvmpipe/lp_setup.c
src/gallium/drivers/llvmpipe/lp_state_derived.c
src/gallium/drivers/llvmpipe/lp_state_fs.c
src/gallium/drivers/llvmpipe/lp_state_surface.c
src/gallium/drivers/llvmpipe/lp_tex_cache.c
src/gallium/drivers/llvmpipe/lp_texture.c
src/gallium/drivers/llvmpipe/lp_tile_cache.c
src/mesa/state_tracker/st_cb_condrender.c
Diffstat (limited to 'src/glx')
-rw-r--r-- | src/glx/x11/Makefile | 21 | ||||
-rw-r--r-- | src/glx/x11/dri2.c | 20 | ||||
-rw-r--r-- | src/glx/x11/dri2_glx.c | 13 | ||||
-rw-r--r-- | src/glx/x11/glxclient.h | 5 | ||||
-rw-r--r-- | src/glx/x11/glxcurrent.c | 1 | ||||
-rw-r--r-- | src/glx/x11/glxext.c | 7 | ||||
-rw-r--r-- | src/glx/x11/indirect.c | 5 | ||||
-rw-r--r-- | src/glx/x11/indirect.h | 4 | ||||
-rw-r--r-- | src/glx/x11/indirect_size.c | 5 | ||||
-rw-r--r-- | src/glx/x11/indirect_size.h | 4 | ||||
-rw-r--r-- | src/glx/x11/single2.c | 3 | ||||
-rw-r--r-- | src/glx/x11/singlepix.c | 3 |
12 files changed, 54 insertions, 37 deletions
diff --git a/src/glx/x11/Makefile b/src/glx/x11/Makefile index 86d84d4b9ff..e681be834f0 100644 --- a/src/glx/x11/Makefile +++ b/src/glx/x11/Makefile @@ -1,7 +1,7 @@ TOP = ../../.. include $(TOP)/configs/current -EXTRA_DEFINES = -DXF86VIDMODE -D_REENTRANT -UIN_DRI_DRIVER \ +EXTRA_DEFINES = -DXF86VIDMODE -D_REENTRANT \ -DDEFAULT_DRIVER_DIR=\"$(DRI_DRIVER_SEARCH_DIR)\" SOURCES = \ @@ -39,13 +39,9 @@ SOURCES = \ dri2_glx.c \ dri2.c -include $(TOP)/src/mesa/sources.mak +GLAPI_LIB = $(TOP)/src/mesa/libglapi.a -MESA_GLAPI_ASM_SOURCES = $(addprefix $(TOP)/src/mesa/, $(GLAPI_ASM_SOURCES)) -MESA_GLAPI_SOURCES = $(addprefix $(TOP)/src/mesa/, $(GLAPI_SOURCES)) -MESA_GLAPI_OBJECTS = $(addprefix $(TOP)/src/mesa/, $(GLAPI_OBJECTS)) - -OBJECTS = $(SOURCES:.c=.o) $(MESA_GLAPI_OBJECTS) +OBJECTS = $(SOURCES:.c=.o) INCLUDES = -I. \ -I$(TOP)/include \ @@ -70,18 +66,19 @@ INCLUDES = -I. \ default: depend $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) # Make libGL -$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) Makefile +$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) $(GLAPI_LIB) Makefile $(MKLIB) -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ -major 1 -minor 2 $(MKLIB_OPTIONS) \ -install $(TOP)/$(LIB_DIR) -id $(INSTALL_LIB_DIR)/lib$(GL_LIB).1.dylib \ - $(GL_LIB_DEPS) $(OBJECTS) + $(GL_LIB_DEPS) $(OBJECTS) $(GLAPI_LIB) +$(GLAPI_LIB): + @$(MAKE) -C $(TOP)/src/mesa libglapi.a -depend: $(SOURCES) $(MESA_GLAPI_SOURCES) $(MESA_GLAPI_ASM_SOURCES) Makefile +depend: $(SOURCES) Makefile rm -f depend touch depend - $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) \ - $(MESA_GLAPI_SOURCES) $(MESA_GLAPI_ASM_SOURCES) + $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) # Emacs tags diff --git a/src/glx/x11/dri2.c b/src/glx/x11/dri2.c index 2cb5d3463af..832935a3ba0 100644 --- a/src/glx/x11/dri2.c +++ b/src/glx/x11/dri2.c @@ -81,12 +81,15 @@ static XEXT_GENERATE_FIND_DISPLAY (DRI2FindDisplay, dri2Info, dri2ExtensionName, &dri2ExtensionHooks, - 0, NULL) + 1, NULL) static Bool DRI2WireToEvent(Display *dpy, XEvent *event, xEvent *wire) { XExtDisplayInfo *info = DRI2FindDisplay(dpy); + XExtDisplayInfo *glx_info = __glXFindDisplay(dpy); + static int glx_event_base; + static Bool found_glx_info = False; XextCheckExtension(dpy, info, dri2ExtensionName, False); @@ -95,21 +98,26 @@ DRI2WireToEvent(Display *dpy, XEvent *event, xEvent *wire) { GLXBufferSwapComplete *aevent = (GLXBufferSwapComplete *)event; xDRI2BufferSwapComplete *awire = (xDRI2BufferSwapComplete *)wire; - switch (awire->type) { + aevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *) wire); + aevent->type = + (glx_info->codes->first_event + GLX_BufferSwapComplete) & 0x75; + aevent->send_event = (awire->type & 0x80) != 0; + aevent->display = dpy; + aevent->drawable = awire->drawable; + switch (awire->event_type) { case DRI2_EXCHANGE_COMPLETE: - aevent->event_type = GLX_EXCHANGE_COMPLETE; + aevent->event_type = GLX_EXCHANGE_COMPLETE_INTEL; break; case DRI2_BLIT_COMPLETE: - aevent->event_type = GLX_BLIT_COMPLETE; + aevent->event_type = GLX_BLIT_COMPLETE_INTEL; break; case DRI2_FLIP_COMPLETE: - aevent->event_type = GLX_FLIP_COMPLETE; + aevent->event_type = GLX_FLIP_COMPLETE_INTEL; break; default: /* unknown swap completion type */ return False; } - aevent->drawable = awire->drawable; aevent->ust = ((CARD64)awire->ust_hi << 32) | awire->ust_lo; aevent->msc = ((CARD64)awire->msc_hi << 32) | awire->msc_lo; aevent->sbc = ((CARD64)awire->sbc_hi << 32) | awire->sbc_lo; diff --git a/src/glx/x11/dri2_glx.c b/src/glx/x11/dri2_glx.c index 7b0c52b50d4..22289581441 100644 --- a/src/glx/x11/dri2_glx.c +++ b/src/glx/x11/dri2_glx.c @@ -504,8 +504,10 @@ dri2CreateScreen(__GLXscreenConfigs * psc, int screen, psc->ext_list_first_time = GL_TRUE; if (!DRI2Connect(psc->dpy, RootWindow(psc->dpy, screen), - &driverName, &deviceName)) + &driverName, &deviceName)) { + XFree(psp); return NULL; + } psc->driver = driOpenDriver(driverName); if (psc->driver == NULL) { @@ -534,17 +536,17 @@ dri2CreateScreen(__GLXscreenConfigs * psc, int screen, psc->fd = open(deviceName, O_RDWR); if (psc->fd < 0) { ErrorMessageF("failed to open drm device: %s\n", strerror(errno)); - return NULL; + goto handle_error; } if (drmGetMagic(psc->fd, &magic)) { ErrorMessageF("failed to get magic\n"); - return NULL; + goto handle_error; } if (!DRI2Authenticate(psc->dpy, RootWindow(psc->dpy, screen), magic)) { ErrorMessageF("failed to authenticate magic %d\n", magic); - return NULL; + goto handle_error; } /* If the server does not support the protocol for @@ -558,7 +560,7 @@ dri2CreateScreen(__GLXscreenConfigs * psc, int screen, if (psc->__driScreen == NULL) { ErrorMessageF("failed to create dri screen\n"); - return NULL; + goto handle_error; } driBindCommonExtensions(psc); @@ -602,6 +604,7 @@ dri2CreateScreen(__GLXscreenConfigs * psc, int screen, handle_error: Xfree(driverName); Xfree(deviceName); + XFree(psp); /* FIXME: clean up here */ diff --git a/src/glx/x11/glxclient.h b/src/glx/x11/glxclient.h index ded4f5a434a..e0b286b6883 100644 --- a/src/glx/x11/glxclient.h +++ b/src/glx/x11/glxclient.h @@ -41,6 +41,7 @@ #define NEED_EVENTS #include <X11/Xproto.h> #include <X11/Xlibint.h> +#include <X11/extensions/extutil.h> #define GLX_GLXEXT_PROTOTYPES #include <GL/glx.h> #include <GL/glxext.h> @@ -793,6 +794,10 @@ extern GLboolean __glXGetMscRateOML(Display * dpy, GLXDrawable drawable, GLboolean __driGetMscRateOML(__DRIdrawable * draw, int32_t * numerator, int32_t * denominator, void *private); + +/* So that dri2.c:DRI2WireToEvent() can access + * glx_info->codes->first_event */ +XExtDisplayInfo *__glXFindDisplay (Display *dpy); #endif #endif /* !__GLX_client_h__ */ diff --git a/src/glx/x11/glxcurrent.c b/src/glx/x11/glxcurrent.c index fae1bd9fa62..50de7d612b8 100644 --- a/src/glx/x11/glxcurrent.c +++ b/src/glx/x11/glxcurrent.c @@ -162,6 +162,7 @@ __glXSetCurrentContextNull(void) __glXSetCurrentContext(&dummyContext); #ifdef GLX_DIRECT_RENDERING _glapi_set_dispatch(NULL); /* no-op functions */ + _glapi_set_context(NULL); #endif } diff --git a/src/glx/x11/glxext.c b/src/glx/x11/glxext.c index fe65216c411..09bb8503196 100644 --- a/src/glx/x11/glxext.c +++ b/src/glx/x11/glxext.c @@ -120,7 +120,6 @@ static /* const */ XExtensionHooks __glXExtensionHooks = { __glXErrorString, /* error_string */ }; -static XEXT_GENERATE_FIND_DISPLAY(__glXFindDisplay, __glXExtensionInfo, __glXExtensionName, &__glXExtensionHooks, __GLX_NUMBER_EVENTS, NULL) @@ -194,11 +193,11 @@ __glXEventToWire(Display *dpy, XEvent *event, xEvent *wire) break; case GLX_SAVED: break; - case GLX_EXCHANGE_COMPLETE: + case GLX_EXCHANGE_COMPLETE_INTEL: break; - case GLX_BLIT_COMPLETE: + case GLX_BLIT_COMPLETE_INTEL: break; - case GLX_FLIP_COMPLETE: + case GLX_FLIP_COMPLETE_INTEL: break; default: /* client doesn't support server event */ diff --git a/src/glx/x11/indirect.c b/src/glx/x11/indirect.c index ea90ce44630..48bae1478f4 100644 --- a/src/glx/x11/indirect.c +++ b/src/glx/x11/indirect.c @@ -30,7 +30,8 @@ #include "indirect.h" #include "glxclient.h" #include "indirect_size.h" -#include "dispatch.h" +#include "glapitable.h" +#include "glapidispatch.h" #include "glapi.h" #include "glthread.h" #include <GL/glxproto.h> @@ -47,7 +48,7 @@ # else # define FASTCALL # endif -# if defined(__GNUC__) +# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) # define NOINLINE __attribute__((noinline)) # else # define NOINLINE diff --git a/src/glx/x11/indirect.h b/src/glx/x11/indirect.h index 19a8c0d134a..9e73b338184 100644 --- a/src/glx/x11/indirect.h +++ b/src/glx/x11/indirect.h @@ -37,7 +37,7 @@ * \author Ian Romanick <[email protected]> */ -# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) +# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__) # define HIDDEN __attribute__((visibility("hidden"))) # else # define HIDDEN @@ -47,7 +47,7 @@ # else # define FASTCALL # endif -# if defined(__GNUC__) +# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) # define NOINLINE __attribute__((noinline)) # else # define NOINLINE diff --git a/src/glx/x11/indirect_size.c b/src/glx/x11/indirect_size.c index cdaf02ffe6a..6356ddd49b5 100644 --- a/src/glx/x11/indirect_size.c +++ b/src/glx/x11/indirect_size.c @@ -29,7 +29,7 @@ #include <GL/gl.h> #include "indirect_size.h" -# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || (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(__ELF__) +# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__) # define INTERNAL __attribute__((visibility("internal"))) # else # define INTERNAL @@ -73,6 +73,7 @@ __glCallLists_size(GLenum e) case GL_SHORT: case GL_UNSIGNED_SHORT: case GL_2_BYTES: + case GL_HALF_FLOAT: return 2; case GL_3_BYTES: return 3; diff --git a/src/glx/x11/indirect_size.h b/src/glx/x11/indirect_size.h index 9ba0bd69075..af0919f9645 100644 --- a/src/glx/x11/indirect_size.h +++ b/src/glx/x11/indirect_size.h @@ -36,7 +36,7 @@ * \author Ian Romanick <[email protected]> */ -# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || (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(__ELF__) +# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__) # define INTERNAL __attribute__((visibility("internal"))) # else # define INTERNAL diff --git a/src/glx/x11/single2.c b/src/glx/x11/single2.c index d128ba20537..9ecf589ffff 100644 --- a/src/glx/x11/single2.c +++ b/src/glx/x11/single2.c @@ -35,7 +35,8 @@ #include "glxextensions.h" #include "indirect.h" #include "indirect_vertex_array.h" -#include "dispatch.h" +#include "glapitable.h" +#include "glapidispatch.h" #include "glapi.h" #ifdef USE_XCB #include <xcb/xcb.h> diff --git a/src/glx/x11/singlepix.c b/src/glx/x11/singlepix.c index fa12ac3bbcb..f5ebf4dfdbf 100644 --- a/src/glx/x11/singlepix.c +++ b/src/glx/x11/singlepix.c @@ -30,7 +30,8 @@ #include "packsingle.h" #include "indirect.h" -#include "dispatch.h" +#include "glapitable.h" +#include "glapidispatch.h" #include "glapi.h" #include "glthread.h" #include "glapioffsets.h" |