diff options
author | marha <marha@users.sourceforge.net> | 2012-05-03 13:38:22 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-05-03 13:38:22 +0200 |
commit | 62068b3bc534d504e40df34847b4436f1a496f35 (patch) | |
tree | 7f67aa0910acff5830585e699be4098088244a85 | |
parent | e67b35e7a899da5805fcce3d390cb10ebcaffe91 (diff) | |
download | vcxsrv-62068b3bc534d504e40df34847b4436f1a496f35.tar.gz vcxsrv-62068b3bc534d504e40df34847b4436f1a496f35.tar.bz2 vcxsrv-62068b3bc534d504e40df34847b4436f1a496f35.zip |
xserver mesa git update 3 May 2012
-rw-r--r-- | mesalib/src/gallium/auxiliary/util/u_format.h | 13 | ||||
-rw-r--r-- | mesalib/src/glsl/glsl_parser_extras.cpp | 51 | ||||
-rw-r--r-- | mesalib/src/glsl/glsl_parser_extras.h | 3 | ||||
-rw-r--r-- | mesalib/src/glsl/standalone_scaffolding.cpp | 6 | ||||
-rw-r--r-- | mesalib/src/glsl/standalone_scaffolding.h | 4 | ||||
-rw-r--r-- | mesalib/src/mesa/main/errors.c | 43 | ||||
-rw-r--r-- | mesalib/src/mesa/main/errors.h | 3 | ||||
-rw-r--r-- | xorg-server/Xi/xiquerypointer.c | 25 | ||||
-rw-r--r-- | xorg-server/configure.ac | 15 |
9 files changed, 135 insertions, 28 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_format.h b/mesalib/src/gallium/auxiliary/util/u_format.h index bd4e51d27..1718fb5e2 100644 --- a/mesalib/src/gallium/auxiliary/util/u_format.h +++ b/mesalib/src/gallium/auxiliary/util/u_format.h @@ -549,6 +549,19 @@ util_format_colormask(const struct util_format_description *desc) } +/** + * Checks if color mask covers every channel for the specified format + * + * @param desc a format description to check colormask with + * @param colormask a bit mask for channels, matches format of PIPE_MASK_RGBA + */ +static INLINE boolean +util_format_colormask_full(const struct util_format_description *desc, unsigned colormask) +{ + return (~colormask & util_format_colormask(desc)) == 0; +} + + boolean util_format_is_float(enum pipe_format format); diff --git a/mesalib/src/glsl/glsl_parser_extras.cpp b/mesalib/src/glsl/glsl_parser_extras.cpp index ae7a365f4..6f1c86b43 100644 --- a/mesalib/src/glsl/glsl_parser_extras.cpp +++ b/mesalib/src/glsl/glsl_parser_extras.cpp @@ -36,8 +36,9 @@ extern "C" { #include "ir_optimization.h" #include "loop_analysis.h" -_mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *ctx, +_mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx, GLenum target, void *mem_ctx) + : ctx(_ctx) { switch (target) { case GL_VERTEX_SHADER: this->target = vertex_shader; break; @@ -134,24 +135,49 @@ _mesa_glsl_shader_target_name(enum _mesa_glsl_parser_targets target) return "unknown"; } +/* This helper function will append the given message to the shader's + info log and report it via GL_ARB_debug_output. Per that extension, + 'type' is one of the enum values classifying the message, and + 'id' is the implementation-defined ID of the given message. */ +static void +_mesa_glsl_msg(const YYLTYPE *locp, _mesa_glsl_parse_state *state, + GLenum type, GLuint id, const char *fmt, va_list ap) +{ + bool error = (type == GL_DEBUG_TYPE_ERROR_ARB); + + assert(state->info_log != NULL); + + /* Get the offset that the new message will be written to. */ + int msg_offset = strlen(state->info_log); + + ralloc_asprintf_append(&state->info_log, "%u:%u(%u): %s: ", + locp->source, + locp->first_line, + locp->first_column, + error ? "error" : "warning"); + ralloc_vasprintf_append(&state->info_log, fmt, ap); + + const char *const msg = &state->info_log[msg_offset]; + struct gl_context *ctx = state->ctx; + /* Report the error via GL_ARB_debug_output. */ + if (error) + _mesa_shader_debug(ctx, type, id, msg, strlen(msg)); + + ralloc_strcat(&state->info_log, "\n"); +} void _mesa_glsl_error(YYLTYPE *locp, _mesa_glsl_parse_state *state, const char *fmt, ...) { va_list ap; + GLenum type = GL_DEBUG_TYPE_ERROR_ARB; state->error = true; - assert(state->info_log != NULL); - ralloc_asprintf_append(&state->info_log, "%u:%u(%u): error: ", - locp->source, - locp->first_line, - locp->first_column); va_start(ap, fmt); - ralloc_vasprintf_append(&state->info_log, fmt, ap); + _mesa_glsl_msg(locp, state, type, SHADER_ERROR_UNKNOWN, fmt, ap); va_end(ap); - ralloc_strcat(&state->info_log, "\n"); } @@ -160,16 +186,11 @@ _mesa_glsl_warning(const YYLTYPE *locp, _mesa_glsl_parse_state *state, const char *fmt, ...) { va_list ap; + GLenum type = GL_DEBUG_TYPE_OTHER_ARB; - assert(state->info_log != NULL); - ralloc_asprintf_append(&state->info_log, "%u:%u(%u): warning: ", - locp->source, - locp->first_line, - locp->first_column); va_start(ap, fmt); - ralloc_vasprintf_append(&state->info_log, fmt, ap); + _mesa_glsl_msg(locp, state, type, 0, fmt, ap); va_end(ap); - ralloc_strcat(&state->info_log, "\n"); } diff --git a/mesalib/src/glsl/glsl_parser_extras.h b/mesalib/src/glsl/glsl_parser_extras.h index 55676f5a9..1a909c68b 100644 --- a/mesalib/src/glsl/glsl_parser_extras.h +++ b/mesalib/src/glsl/glsl_parser_extras.h @@ -57,7 +57,7 @@ struct glsl_switch_state { }; struct _mesa_glsl_parse_state { - _mesa_glsl_parse_state(struct gl_context *ctx, GLenum target, + _mesa_glsl_parse_state(struct gl_context *_ctx, GLenum target, void *mem_ctx); /* Callers of this ralloc-based new need not call delete. It's @@ -77,6 +77,7 @@ struct _mesa_glsl_parse_state { ralloc_free(mem); } + struct gl_context *const ctx; void *scanner; exec_list translation_unit; glsl_symbol_table *symbols; diff --git a/mesalib/src/glsl/standalone_scaffolding.cpp b/mesalib/src/glsl/standalone_scaffolding.cpp index 24cc64ad9..f15f2d882 100644 --- a/mesalib/src/glsl/standalone_scaffolding.cpp +++ b/mesalib/src/glsl/standalone_scaffolding.cpp @@ -41,6 +41,12 @@ _mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr, *ptr = sh; } +void +_mesa_shader_debug(struct gl_context *, GLenum, GLuint, + const char *, int) +{ +} + struct gl_shader * _mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type) { diff --git a/mesalib/src/glsl/standalone_scaffolding.h b/mesalib/src/glsl/standalone_scaffolding.h index 877332006..41ce35bef 100644 --- a/mesalib/src/glsl/standalone_scaffolding.h +++ b/mesalib/src/glsl/standalone_scaffolding.h @@ -40,6 +40,10 @@ _mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr, extern "C" struct gl_shader * _mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type); +extern "C" void +_mesa_shader_debug(struct gl_context *ctx, GLenum type, GLuint id, + const char *msg, int len); + /** * Initialize the given gl_context structure to a reasonable set of * defaults representing the minimum capabilities required by the diff --git a/mesalib/src/mesa/main/errors.c b/mesalib/src/mesa/main/errors.c index fcf873f18..4a187b7b0 100644 --- a/mesalib/src/mesa/main/errors.c +++ b/mesalib/src/mesa/main/errors.c @@ -1062,4 +1062,47 @@ _mesa_debug( const struct gl_context *ctx, const char *fmtString, ... ) (void) fmtString; } + +/** + * Report debug information from the shader compiler via GL_ARB_debug_output. + * + * \param ctx GL context. + * \param type The namespace to which this message belongs. + * \param id The message ID within the given namespace. + * \param msg The message to output. Need not be null-terminated. + * \param len The length of 'msg'. If negative, 'msg' must be null-terminated. + */ +void +_mesa_shader_debug( struct gl_context *ctx, GLenum type, GLuint id, + const char *msg, int len ) +{ + GLenum source = GL_DEBUG_SOURCE_SHADER_COMPILER_ARB, + severity; + + switch (type) { + case GL_DEBUG_TYPE_ERROR_ARB: + assert(id < SHADER_ERROR_COUNT); + severity = GL_DEBUG_SEVERITY_HIGH_ARB; + break; + case GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB: + case GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB: + case GL_DEBUG_TYPE_PORTABILITY_ARB: + case GL_DEBUG_TYPE_PERFORMANCE_ARB: + case GL_DEBUG_TYPE_OTHER_ARB: + assert(0 && "other categories not implemented yet"); + default: + _mesa_problem(ctx, "bad enum in _mesa_shader_debug()"); + return; + } + + if (len < 0) + len = strlen(msg); + + /* Truncate the message if necessary. */ + if (len >= MAX_DEBUG_MESSAGE_LENGTH) + len = MAX_DEBUG_MESSAGE_LENGTH - 1; + + _mesa_log_msg(ctx, source, type, id, severity, len, msg); +} + /*@}*/ diff --git a/mesalib/src/mesa/main/errors.h b/mesalib/src/mesa/main/errors.h index ed1c6fc7f..b4490fac9 100644 --- a/mesalib/src/mesa/main/errors.h +++ b/mesalib/src/mesa/main/errors.h @@ -68,6 +68,9 @@ _mesa_error( struct gl_context *ctx, GLenum error, const char *fmtString, ... ) extern void _mesa_debug( const struct gl_context *ctx, const char *fmtString, ... ) PRINTFLIKE(2, 3); +extern void +_mesa_shader_debug( struct gl_context *ctx, GLenum type, GLuint id, const char *msg, int len ); + #ifdef __cplusplus } #endif diff --git a/xorg-server/Xi/xiquerypointer.c b/xorg-server/Xi/xiquerypointer.c index a2e7442e0..169436e14 100644 --- a/xorg-server/Xi/xiquerypointer.c +++ b/xorg-server/Xi/xiquerypointer.c @@ -79,10 +79,21 @@ ProcXIQueryPointer(ClientPtr client) XkbStatePtr state; char *buttons = NULL; int buttons_size = 0; /* size of buttons array */ + XIClientPtr xi_client; + Bool have_xi22 = FALSE; REQUEST(xXIQueryPointerReq); REQUEST_SIZE_MATCH(xXIQueryPointerReq); + /* Check if client is compliant with XInput 2.2 or later. Earlier clients + * do not know about touches, so we must report emulated button presses. 2.2 + * and later clients are aware of touches, so we don't include emulated + * button presses in the reply. */ + xi_client = dixLookupPrivate(&client->devPrivates, XIClientPrivateKey); + if (version_compare(xi_client->major_version, + xi_client->minor_version, 2, 2) >= 0) + have_xi22 = TRUE; + rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixReadAccess); if (rc != Success) { client->errorValue = stuff->deviceid; @@ -132,7 +143,7 @@ ProcXIQueryPointer(ClientPtr client) } if (pDev->button) { - int i, down; + int i; rep.buttons_len = bytes_to_int32(bits_to_bytes(pDev->button->numButtons)); @@ -142,14 +153,12 @@ ProcXIQueryPointer(ClientPtr client) if (!buttons) return BadAlloc; - down = pDev->button->buttonsDown; + for (i = 1; i < pDev->button->numButtons; i++) + if (BitIsOn(pDev->button->down, i)) + SetBit(buttons, pDev->button->map[i]); - for (i = 0; i < pDev->button->numButtons && down; i++) { - if (BitIsOn(pDev->button->down, i)) { - SetBit(buttons, i); - down--; - } - } + if (!have_xi22 && pDev->touch && pDev->touch->buttonsDown > 0) + SetBit(buttons, pDev->button->map[1]); } else rep.buttons_len = 0; diff --git a/xorg-server/configure.ac b/xorg-server/configure.ac index 4afac8268..6a41ea83f 100644 --- a/xorg-server/configure.ac +++ b/xorg-server/configure.ac @@ -271,10 +271,11 @@ AC_CACHE_CHECK([for SYSV IPC], #include <sys/types.h> #include <sys/ipc.h> #include <sys/shm.h> +#include <sys/stat.h> ],[ { int id; - id = shmget(IPC_PRIVATE, 512, SHM_W | SHM_R); + id = shmget(IPC_PRIVATE, 512, S_IRUSR | S_IWUSR); if (id < 0) return -1; return shmctl(id, IPC_RMID, 0); }], @@ -592,7 +593,7 @@ AC_ARG_WITH(khronos-spec-dir, AS_HELP_STRING([--with-khronos-spec-dir=PATH], [Pa dnl Extensions. AC_ARG_ENABLE(registry, AS_HELP_STRING([--disable-registry], [Build string registry module (default: enabled)]), [XREGISTRY=$enableval], [XREGISTRY=yes]) AC_ARG_ENABLE(composite, AS_HELP_STRING([--disable-composite], [Build Composite extension (default: enabled)]), [COMPOSITE=$enableval], [COMPOSITE=yes]) -AC_ARG_ENABLE(mitshm, AS_HELP_STRING([--disable-mitshm], [Build SHM extension (default: enabled)]), [MITSHM=$enableval], [MITSHM=yes]) +AC_ARG_ENABLE(mitshm, AS_HELP_STRING([--disable-mitshm], [Build SHM extension (default: auto)]), [MITSHM=$enableval], [MITSHM=auto]) AC_ARG_ENABLE(xres, AS_HELP_STRING([--disable-xres], [Build XRes extension (default: enabled)]), [RES=$enableval], [RES=yes]) AC_ARG_ENABLE(record, AS_HELP_STRING([--disable-record], [Build Record extension (default: enabled)]), [RECORD=$enableval], [RECORD=yes]) AC_ARG_ENABLE(xv, AS_HELP_STRING([--disable-xv], [Build Xv extension (default: enabled)]), [XV=$enableval], [XV=yes]) @@ -656,6 +657,7 @@ AC_MSG_CHECKING([to see if we can install the Xorg server as root]) if test "x$SETUID" = "xauto" ; then case $host_os in cygwin*) SETUID="no" ;; + mingw*) SETUID="no" ;; darwin*) SETUID="no" ;; *) case $host_cpu in @@ -698,7 +700,7 @@ AM_CONDITIONAL(INSTALL_LIBXF86CONFIG, [test "x$INSTALL_LIBXF86CONFIG" = xyes]) dnl DDX Detection... Yes, it's ugly to have it here... but we need to dnl handle this early on so that we don't require unsupported extensions case $host_os in - cygwin*) + cygwin* | mingw*) CONFIG_DBUS_API=no CONFIG_HAL=no CONFIG_UDEV=no @@ -1000,6 +1002,9 @@ if test "x$COMPOSITE" = xyes; then COMPOSITE_INC='-I$(top_srcdir)/composite' fi +if test "x$MITSHM" = xauto; then + MITSHM="$ac_cv_sysv_ipc" +fi AM_CONDITIONAL(MITSHM, [test "x$MITSHM" = xyes]) if test "x$MITSHM" = xyes; then AC_DEFINE(MITSHM, 1, [Support MIT-SHM extension]) @@ -1547,6 +1552,7 @@ if test "x$XORG" = xauto; then XORG="yes" case $host_os in cygwin*) XORG="no" ;; + mingw*) XORG="no" ;; darwin*) XORG="no" ;; esac fi @@ -1857,7 +1863,7 @@ if test "x$XWIN" = xyes; then XWIN_SERVER_NAME=Xming AC_DEFINE(RELOCATE_PROJECTROOT,1,[Make PROJECT_ROOT relative to the xserver location]) AC_DEFINE(HAS_WINSOCK,1,[Use Windows sockets]) - XWIN_SYS_LIBS=-lwinsock2 + XWIN_SYS_LIBS=-lws2_32 ;; esac XWIN_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $RANDR_LIB $RENDER_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $OS_LIB" @@ -1948,6 +1954,7 @@ if test "x$DMX" = xauto; then DMX="$have_dmx" case $host_os in cygwin*) DMX="no" ;; + mingw*) DMX="no" ;; darwin*) DMX="no" ;; esac fi |