diff options
-rw-r--r-- | mesalib/configure.ac | 2 | ||||
-rw-r--r-- | mesalib/docs/GL3.txt | 8 | ||||
-rw-r--r-- | mesalib/docs/news.html | 8 | ||||
-rw-r--r-- | mesalib/docs/relnotes-8.0.4.html | 201 | ||||
-rw-r--r-- | mesalib/docs/relnotes-8.1.html | 1 | ||||
-rw-r--r-- | mesalib/docs/relnotes.html | 1 | ||||
-rw-r--r-- | mesalib/src/mapi/glapi/gen/gl_API.xml | 22 | ||||
-rw-r--r-- | mesalib/src/mesa/main/dd.h | 6 | ||||
-rw-r--r-- | mesalib/src/mesa/main/dlist.c | 24 | ||||
-rw-r--r-- | mesalib/src/mesa/main/extensions.c | 1 | ||||
-rw-r--r-- | mesalib/src/mesa/main/get.c | 15 | ||||
-rw-r--r-- | mesalib/src/mesa/main/queryobj.c | 78 | ||||
-rw-r--r-- | mesalib/src/mesa/main/texcompress_etc.h | 4 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_cb_queryobj.c | 14 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_extensions.c | 5 | ||||
-rw-r--r-- | pixman/pixman/pixman-mmx.c | 13 | ||||
-rw-r--r-- | pixman/pixman/pixman-x86.c | 337 | ||||
-rw-r--r-- | xorg-server/Xext/sync.c | 4 | ||||
-rw-r--r-- | xorg-server/dix/devices.c | 10 | ||||
-rw-r--r-- | xorg-server/test/xtest.c | 2 |
20 files changed, 542 insertions, 214 deletions
diff --git a/mesalib/configure.ac b/mesalib/configure.ac index 46265a221..b5250f321 100644 --- a/mesalib/configure.ac +++ b/mesalib/configure.ac @@ -33,7 +33,7 @@ USER_CXXFLAGS="$CXXFLAGS" dnl Versions for external dependencies LIBDRM_REQUIRED=2.4.24 LIBDRM_RADEON_REQUIRED=2.4.31 -LIBDRM_INTEL_REQUIRED=2.4.34 +LIBDRM_INTEL_REQUIRED=2.4.37 LIBDRM_NVVIEUX_REQUIRED=2.4.33 LIBDRM_NOUVEAU_REQUIRED=2.4.33 DRI2PROTO_REQUIRED=2.6 diff --git a/mesalib/docs/GL3.txt b/mesalib/docs/GL3.txt index 36d24725d..8357289ea 100644 --- a/mesalib/docs/GL3.txt +++ b/mesalib/docs/GL3.txt @@ -42,8 +42,8 @@ GLX_ARB_create_context (GLX 1.4 is required) DONE GL 3.1: -GLSL 1.40 missing: UBOS, inverse(), - highp change +GLSL 1.40 needs UBOs (in progress) +Forward compatibile context support/deprecations not started Instanced drawing (GL_ARB_draw_instanced) DONE (i965, gallium, swrast) Buffer copying (GL_ARB_copy_buffer) DONE (i965, r300, r600, swrast) Primitive restart (GL_NV_primitive_restart) DONE (i965, r600) @@ -80,7 +80,7 @@ GL_ARB_sampler_objects DONE (i965, r300, r600) GL_ARB_shader_bit_encoding DONE GL_ARB_texture_rgb10_a2ui DONE (r600) GL_ARB_texture_swizzle DONE (same as EXT version) (i965, r300, r600, swrast) -GL_ARB_timer_query ~60% done (the EXT variant) +GL_ARB_timer_query DONE GL_ARB_instanced_arrays DONE (i965, r300, r600) GL_ARB_vertex_type_2_10_10_10_rev DONE (r600) @@ -91,6 +91,7 @@ GLSL 4.0 not started GL_ARB_texture_query_lod not started GL_ARB_draw_buffers_blend DONE (i965, r600, softpipe) GL_ARB_draw_indirect not started +GL_ARB_gpu_shader5 not started GL_ARB_gpu_shader_fp64 not started GL_ARB_sample_shading not started GL_ARB_shader_subroutine not started @@ -114,6 +115,7 @@ GL_ARB_viewport_array not started GL 4.2: + GLSL 4.2 not started GL_ARB_texture_compression_bptc not started GL_ARB_compressed_texture_pixel_storage not started diff --git a/mesalib/docs/news.html b/mesalib/docs/news.html index b6b82671c..541bde67b 100644 --- a/mesalib/docs/news.html +++ b/mesalib/docs/news.html @@ -9,6 +9,14 @@ <h1>News</h1> +<h2>July 10, 2012</h2> + +<p> +<a href="relnotes-8.0.4.html">Mesa 8.0.4</a> is released. +This is a bug fix release. +</p> + + <h2>May 18, 2012</h2> <p> diff --git a/mesalib/docs/relnotes-8.0.4.html b/mesalib/docs/relnotes-8.0.4.html new file mode 100644 index 000000000..529140af2 --- /dev/null +++ b/mesalib/docs/relnotes-8.0.4.html @@ -0,0 +1,201 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html lang="en"> +<head> + <meta http-equiv="content-type" content="text/html; charset=utf-8"> + <title>Mesa Release Notes</title> + <link rel="stylesheet" type="text/css" href="mesa.css"> +</head> +<body> + +<h1>Mesa 8.0.4 Release Notes / July 10, 2012</h1> + +<p> +Mesa 8.0.4 is a bug fix release which fixes bugs found since the 8.0.2 release. +</p> +<p> +Mesa 8.0.4 implements the OpenGL 3.0 API, but the version reported by +glGetString(GL_VERSION) depends on the particular driver being used. +Some drivers don't support all the features required in OpenGL 3.0. +</p> +<p> +See the <a href="install.html">Compiling/Installing page</a> for prerequisites +for DRI hardware acceleration. +</p> + + +<h2>MD5 checksums</h2> +<pre> +02b96082d2f1ad72e7385f4022afafb9 MesaLib-8.0.4.tar.gz +d546f988adfdf986cff45b1efa2d8a46 MesaLib-8.0.4.tar.bz2 +1f0fdabe6e8019d4de6c16e20e74d163 MesaLib-8.0.4.zip +</pre> + +<h2>New features</h2> +<p>None.</p> + +<h2>Bug fixes</h2> + +<p>This list is likely incomplete.</p> + +<ul> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=45967">Bug 45967</a> - piglit getteximage-invalid-format-for-packed-type regression</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=47742">Bug 47742</a> - [softpipe] piglit fbo-generatemipmap-array regression</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=48141">Bug 48141</a> - [vmwgfx] src/gallium/auxiliary/util/u_inlines.h:256:pipe_buffer_map_range: Assertion `offset + length <= buffer->width0' failed.</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=48472">Bug 48472</a> - GPU Lockup while running demo (rzr - the scene is dead) in wine</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=50033">Bug 50033</a> - src/mesa/state_tracker/st_cb_fbo.c:379:st_render_texture: Assertion `strb->rtt_level <= strb->texture->last_level' failed.</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=50621">Bug 50621</a> - Mesa fails its test suite with a buffer overflow.</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=50298">Bug 50298</a> - [ILK IVB bisected]Ogles2conform GL/sin/sin_float_vert_xvary.test regressed</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=51574">Bug 51574</a> - ir_loop_jump constructor assigns member variable to itself</li> + +<!-- <li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=">Bug </a> - </li> --> + +</ul> + + +<h2>Changes</h2> +<p>The full set of changes can be viewed by using the following GIT command:</p> + +<pre> + git log mesa-8.0.3..mesa-8.0.4 +</pre> + +<p>Andreas Betz (1):</p> +<ul> + <li>vega: fix 565 color unpacking bug</li> +</ul> + +<p>Antoine Labour (2):</p> +<ul> + <li>meta: Cleanup the resources we allocate.</li> + <li>mesa: Free uniforms correclty.</li> +</ul> + +<p>Brian Paul (22):</p> +<ul> + <li>docs: add link to 8.0.3 release notes</li> + <li>mesa: fix Z32_FLOAT -> uint conversion functions</li> + <li>draw: fix primitive restart bug by using the index buffer offset</li> + <li>st/mesa: fix glDrawPixels(GL_DEPTH_COMPONENT) color output</li> + <li>svga: fix synchronization bug between sampler views and surfaces</li> + <li>mesa: new _mesa_error_check_format_and_type() function</li> + <li>mesa: add missing GL_UNSIGNED_INT_10F_11F_11F_REV case</li> + <li>mesa: fix missing return value in getteximage_error_check()</li> + <li>st/mesa: pass GL_MAP_INVALIDATE_RANGE_BIT to gallium drivers</li> + <li>svga: add 0.5 in float->int conversion of sample min/max lod</li> + <li>svga: fix min/max lod clamping</li> + <li>svga: change PIPE_CAPF_MAX_TEXTURE_LOD_BIAS from 16.0 to 15.0</li> + <li>st/mesa: add fallback pipe formats for (compressed) R, RG formats</li> + <li>st/mesa: copy num_immediates field when copying the immediates array</li> + <li>svga: move svga_texture() casts/calls in svga_surface_copy()</li> + <li>svga: reset vertex buffer offset in svga_release_user_upl_buffers()</li> + <li>st/mesa: don't set PIPE_BIND_DISPLAY_TARGET for user-created renderbuffers</li> + <li>st/mesa: use private pipe_sampler_view in decompress_with_blit()</li> + <li>st/mesa: add null pointer check in st_texture_image_map()</li> + <li>st/mesa: fix mipmap image size computation w.r.t. texture arrays</li> + <li>draw: fix missing immediates bug in polygon stipple code</li> + <li>st/mesa: fix max_offset computation for base vertex</li> +</ul> + +<p>Christoph Bumiller (1):</p> +<ul> + <li>nv50: handle NEG,ABS modifiers for short RCP encoding</li> +</ul> + +<p>Dylan Noblesmith (1):</p> +<ul> + <li>mesa: require GL_MAX_SAMPLES >= 4 for GL 3.0</li> +</ul> + +<p>Eric Anholt (1):</p> +<ul> + <li>i965/vs: Fix texelFetchOffset()</li> +</ul> + +<p>Ian Romanick (5):</p> +<ul> + <li>docs: Add 8.0.3 release md5sums</li> + <li>glx/tests: Fix off-by-one error in allocating extension string buffer</li> + <li>glsl: Remove spurious printf messages</li> + <li>glsl: Fix pi/2 constant in acos built-in function</li> + <li>mesa: Bump version number to 8.0.4</li> +</ul> + +<p>José Fonseca (2):</p> +<ul> + <li>mesa: Avoid void acinclude.m4 Android.common.mk Android.mk autogen.sh bin common.py configs configure.ac docs doxygen include Makefile scons SConstruct src tests arithmetic.</li> + <li>draw: Ensure that prepare is always run after LLVM garbagge collection.</li> +</ul> + +<p>Kenneth Graunke (15):</p> +<ul> + <li>mesa: Check for a negative "size" parameter in glCopyBufferSubData().</li> + <li>i965: Fix brw_swap_cmod() for LE/GE comparisons.</li> + <li>glsl: Remove unused ir_loop_jump::loop pointer.</li> + <li>ralloc: Fix ralloc_parent() of memory allocated out of the NULL context.</li> + <li>mesa: Restore depth texture state on glPopAttrib(GL_TEXTURE_BIT).</li> + <li>glsl/builtins: Fix textureGrad() for Array samplers.</li> + <li>mesa: Unbind ARB_copy_buffer and transform feedback buffers on delete.</li> + <li>mesa: Support BindBuffer{Base,Offset,Range} with a buffer of 0.</li> + <li>mesa: Unbind ARB_transform_feedback2 binding points on Delete too.</li> + <li>meta: Fix GL_RENDERBUFFER binding in decompress_texture_image().</li> + <li>i965/fs: Fix texelFetchOffset() on pre-Gen7.</li> + <li>i965/vs: Fix texelFetchOffset() on pre-Gen7.</li> + <li>i965/fs: Fix user-defined FS outputs with less than four components.</li> + <li>glsl: Hook up loop_variable_state destructor to plug a memory leak.</li> + <li>glsl: Don't trust loop analysis in the presence of function calls.</li> +</ul> + +<p>Kurt Roeckx (1):</p> +<ul> + <li>i830: Fix crash for GL_STENCIL_TEST in i830Enable()</li> +</ul> + +<p>Lukas Rössler (1):</p> +<ul> + <li>glu: fix two Clang warnings</li> +</ul> + +<p>Marek Olšák (2):</p> +<ul> + <li>mesa: allow exposing GL3 without EXT_texture_integer</li> + <li>st/mesa: don't do srgb->linear conversion in decompress_with_blit</li> +</ul> + +<p>Paul Seidler (1):</p> +<ul> + <li>tests: include mesa headers</li> +</ul> + +<p>Stéphane Marchesin (3):</p> +<ul> + <li>glx: Handle a null reply in QueryVersion.</li> + <li>i915g: Don't invert signalled/unsignalled fences</li> + <li>i915g: Don't avoid flushing when we have a pending fence.</li> +</ul> + +<p>Thomas Gstädtner (1):</p> +<ul> + <li>gallium/targets: pass ldflags parameter to MKLIB</li> +</ul> + +<p>Vadim Girlin (2):</p> +<ul> + <li>st/mesa: set stObj->lastLevel in guess_and_alloc_texture</li> + <li>r600g: check gpr count limit</li> +</ul> + +<p>Vinson Lee (1):</p> +<ul> + <li>st/mesa: Fix uninitialized members in glsl_to_tgsi_visitor constructor.</li> +</ul> + +</body> +</html> diff --git a/mesalib/docs/relnotes-8.1.html b/mesalib/docs/relnotes-8.1.html index 4901c3022..c6980b688 100644 --- a/mesalib/docs/relnotes-8.1.html +++ b/mesalib/docs/relnotes-8.1.html @@ -36,6 +36,7 @@ Note: some of the new features are only available with certain drivers. <li>GL_ARB_blend_func_extended</li> <li>GL_ARB_debug_output</li> <li>GL_ARB_shader_bit_encoding</li> +<li>GL_ARB_timer_query</li> <li>GL_EXT_unpack_subimage for ES 2.0</li> <li>GL_EXT_read_format_bgra for ES 1.1 and 2.0</li> <li>GL_EXT_texture_rg for ES 2.x</li> diff --git a/mesalib/docs/relnotes.html b/mesalib/docs/relnotes.html index 608035f99..a6ff138ea 100644 --- a/mesalib/docs/relnotes.html +++ b/mesalib/docs/relnotes.html @@ -15,6 +15,7 @@ The release notes summarize what's new or changed in each Mesa release. <ul> <li><a href="relnotes-8.1.html">8.1 release notes</a> +<li><a href="relnotes-8.0.4.html">8.0.4 release notes</a> <li><a href="relnotes-8.0.3.html">8.0.3 release notes</a> <li><a href="relnotes-8.0.2.html">8.0.2 release notes</a> <li><a href="relnotes-8.0.1.html">8.0.1 release notes</a> diff --git a/mesalib/src/mapi/glapi/gen/gl_API.xml b/mesalib/src/mapi/glapi/gen/gl_API.xml index af74c909b..c302ab94a 100644 --- a/mesalib/src/mapi/glapi/gen/gl_API.xml +++ b/mesalib/src/mapi/glapi/gen/gl_API.xml @@ -7981,7 +7981,27 @@ <xi:include href="ARB_texture_rgb10_a2ui.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> <!-- 84. GL_ARB_texture_swizzle --> -<!-- 85. GL_ARB_timer_query --> + +<category name="GL_ARB_timer_query" number="85"> + <enum name="TIME_ELAPSED" value="0x88BF"/> + <enum name="TIMESTAMP" value="0x8E28"/> + <type name="int64" size="8"/> + <type name="uint64" unsigned="true" size="8"/> + <function name="GetQueryObjecti64v" alias="GetQueryObjecti64vEXT" static_dispatch="false"> + <param name="id" type="GLuint"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLint64 *"/> + </function> + <function name="GetQueryObjectui64v" alias="GetQueryObjectui64vEXT" static_dispatch="false"> + <param name="id" type="GLuint"/> + <param name="pname" type="GLenum"/> + <param name="params" type="GLuint64 *"/> + </function> + <function name="QueryCounter" offset="assign" static_dispatch="false"> + <param name="id" type="GLuint"/> + <param name="target" type="GLenum"/> + </function> +</category> <xi:include href="ARB_vertex_type_2_10_10_10_rev.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> diff --git a/mesalib/src/mesa/main/dd.h b/mesalib/src/mesa/main/dd.h index 687a38f44..c8a765f47 100644 --- a/mesalib/src/mesa/main/dd.h +++ b/mesalib/src/mesa/main/dd.h @@ -820,6 +820,12 @@ struct dd_function_table { GLuint name); void (*DeleteSamplerObject)(struct gl_context *ctx, struct gl_sampler_object *samp); + + /** + * \name Return a timestamp in nanoseconds as defined by GL_ARB_timer_query. + * This should be equivalent to glGetInteger64v(GL_TIMESTAMP); + */ + uint64_t (*GetTimestamp)(struct gl_context *ctx); }; diff --git a/mesalib/src/mesa/main/dlist.c b/mesalib/src/mesa/main/dlist.c index a0d84cfdc..a827d132d 100644 --- a/mesalib/src/mesa/main/dlist.c +++ b/mesalib/src/mesa/main/dlist.c @@ -469,6 +469,9 @@ typedef enum OPCODE_BEGIN_CONDITIONAL_RENDER, OPCODE_END_CONDITIONAL_RENDER, + /* ARB_timer_query */ + OPCODE_QUERY_COUNTER, + /* The following three are meta instructions */ OPCODE_ERROR, /* raise compiled-in error */ OPCODE_CONTINUE, @@ -5351,6 +5354,23 @@ save_EndQueryARB(GLenum target) } } + +static void GLAPIENTRY +save_QueryCounter(GLuint id, GLenum target) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_QUERY_COUNTER, 2); + if (n) { + n[1].ui = id; + n[2].e = target; + } + if (ctx->ExecuteFlag) { + CALL_QueryCounter(ctx->Exec, (id, target)); + } +} + #endif /* FEATURE_queryobj */ @@ -8345,6 +8365,9 @@ execute_list(struct gl_context *ctx, GLuint list) case OPCODE_END_QUERY_ARB: CALL_EndQueryARB(ctx->Exec, (n[1].e)); break; + case OPCODE_QUERY_COUNTER: + CALL_QueryCounter(ctx->Exec, (n[1].ui, n[2].e)); + break; #endif case OPCODE_DRAW_BUFFERS_ARB: { @@ -10309,6 +10332,7 @@ _mesa_create_save_table(void) _mesa_init_queryobj_dispatch(table); /* glGetQuery, etc */ SET_BeginQueryARB(table, save_BeginQueryARB); SET_EndQueryARB(table, save_EndQueryARB); + SET_QueryCounter(table, save_QueryCounter); #endif SET_DrawBuffersARB(table, save_DrawBuffersARB); diff --git a/mesalib/src/mesa/main/extensions.c b/mesalib/src/mesa/main/extensions.c index 793cc4e24..dbc2813f2 100644 --- a/mesalib/src/mesa/main/extensions.c +++ b/mesalib/src/mesa/main/extensions.c @@ -139,6 +139,7 @@ static const struct extension extension_table[] = { { "GL_ARB_texture_rg", o(ARB_texture_rg), GL, 2008 }, { "GL_ARB_texture_storage", o(ARB_texture_storage), GL, 2011 }, { "GL_ARB_texture_swizzle", o(EXT_texture_swizzle), GL, 2008 }, + { "GL_ARB_timer_query", o(ARB_timer_query), GL, 2010 }, { "GL_ARB_transform_feedback2", o(ARB_transform_feedback2), GL, 2010 }, { "GL_ARB_transpose_matrix", o(ARB_transpose_matrix), GL, 1999 }, { "GL_ARB_uniform_buffer_object", o(ARB_uniform_buffer_object), GL, 2009 }, diff --git a/mesalib/src/mesa/main/get.c b/mesalib/src/mesa/main/get.c index a83d36721..cff4cf394 100644 --- a/mesalib/src/mesa/main/get.c +++ b/mesalib/src/mesa/main/get.c @@ -342,6 +342,7 @@ EXTRA_EXT(ARB_texture_buffer_object); EXTRA_EXT(OES_EGL_image_external); EXTRA_EXT(ARB_blend_func_extended); EXTRA_EXT(ARB_uniform_buffer_object); +EXTRA_EXT(ARB_timer_query); static const int extra_ARB_vertex_program_ARB_fragment_program_NV_vertex_program[] = { @@ -1353,6 +1354,9 @@ static const struct value_desc values[] = { { GL_UNIFORM_BUFFER_BINDING, LOC_CUSTOM, TYPE_INT, 0, extra_ARB_uniform_buffer_object }, + /* GL_ARB_timer_query */ + { GL_TIMESTAMP, LOC_CUSTOM, TYPE_INT64, 0, extra_ARB_timer_query } + #endif /* FEATURE_GL */ }; @@ -1807,7 +1811,16 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu case GL_UNIFORM_BUFFER_BINDING: v->value_int = ctx->UniformBuffer->Name; break; - } + /* GL_ARB_timer_query */ + case GL_TIMESTAMP: + if (ctx->Driver.GetTimestamp) { + v->value_int64 = ctx->Driver.GetTimestamp(ctx); + } + else { + _mesa_problem(ctx, "driver doesn't implement GetTimestamp"); + } + break; + } } /** diff --git a/mesalib/src/mesa/main/queryobj.c b/mesalib/src/mesa/main/queryobj.c index f0a9a7922..cb5078411 100644 --- a/mesalib/src/mesa/main/queryobj.c +++ b/mesalib/src/mesa/main/queryobj.c @@ -353,9 +353,66 @@ _mesa_EndQueryARB(GLenum target) static void GLAPIENTRY +_mesa_QueryCounter(GLuint id, GLenum target) +{ + struct gl_query_object *q; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (MESA_VERBOSE & VERBOSE_API) + _mesa_debug(ctx, "glQueryCounter(%u, %s)\n", id, + _mesa_lookup_enum_by_nr(target)); + + /* error checking */ + if (target != GL_TIMESTAMP) { + _mesa_error(ctx, GL_INVALID_ENUM, "glQueryCounter(target)"); + return; + } + + if (id == 0) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glQueryCounter(id==0)"); + return; + } + + q = _mesa_lookup_query_object(ctx, id); + if (!q) { + /* XXX the Core profile should throw INVALID_OPERATION here */ + + /* create new object */ + q = ctx->Driver.NewQueryObject(ctx, id); + if (!q) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glQueryCounter"); + return; + } + _mesa_HashInsert(ctx->Query.QueryObjects, id, q); + } + else { + if (q->Target && q->Target != GL_TIMESTAMP) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glQueryCounter(id has an invalid target)"); + return; + } + } + + if (q->Active) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glQueryCounter(id is active)"); + return; + } + + q->Target = target; + q->Result = 0; + q->Ready = GL_FALSE; + + /* QueryCounter is implemented using EndQuery without BeginQuery + * in drivers. This is actually Direct3D and Gallium convention. */ + ctx->Driver.EndQuery(ctx, q); +} + + +static void GLAPIENTRY _mesa_GetQueryivARB(GLenum target, GLenum pname, GLint *params) { - struct gl_query_object *q, **bindpt; + struct gl_query_object *q = NULL, **bindpt = NULL; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -364,13 +421,21 @@ _mesa_GetQueryivARB(GLenum target, GLenum pname, GLint *params) _mesa_lookup_enum_by_nr(target), _mesa_lookup_enum_by_nr(pname)); - bindpt = get_query_binding_point(ctx, target); - if (!bindpt) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryARB(target)"); - return; + if (target == GL_TIMESTAMP) { + if (!ctx->Extensions.ARB_timer_query) { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryARB(target)"); + return; + } } + else { + bindpt = get_query_binding_point(ctx, target); + if (!bindpt) { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryARB(target)"); + return; + } - q = *bindpt; + q = *bindpt; + } switch (pname) { case GL_QUERY_COUNTER_BITS_ARB: @@ -581,6 +646,7 @@ _mesa_init_queryobj_dispatch(struct _glapi_table *disp) SET_GetQueryivARB(disp, _mesa_GetQueryivARB); SET_GetQueryObjectivARB(disp, _mesa_GetQueryObjectivARB); SET_GetQueryObjectuivARB(disp, _mesa_GetQueryObjectuivARB); + SET_QueryCounter(disp, _mesa_QueryCounter); SET_GetQueryObjecti64vEXT(disp, _mesa_GetQueryObjecti64vEXT); SET_GetQueryObjectui64vEXT(disp, _mesa_GetQueryObjectui64vEXT); diff --git a/mesalib/src/mesa/main/texcompress_etc.h b/mesalib/src/mesa/main/texcompress_etc.h index 4e166b2b1..8e8427f8f 100644 --- a/mesalib/src/mesa/main/texcompress_etc.h +++ b/mesalib/src/mesa/main/texcompress_etc.h @@ -30,10 +30,10 @@ struct swrast_texture_image; -extern GLboolean +GLboolean _mesa_texstore_etc1_rgb8(TEXSTORE_PARAMS); -extern void +void _mesa_fetch_texel_2d_f_etc1_rgb8(const struct swrast_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel); diff --git a/mesalib/src/mesa/state_tracker/st_cb_queryobj.c b/mesalib/src/mesa/state_tracker/st_cb_queryobj.c index b6a236e8d..e5e4a81dc 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_queryobj.c +++ b/mesalib/src/mesa/state_tracker/st_cb_queryobj.c @@ -39,6 +39,7 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" +#include "pipe/p_screen.h" #include "st_context.h" #include "st_cb_queryobj.h" #include "st_cb_bitmap.h" @@ -133,6 +134,11 @@ st_EndQuery(struct gl_context *ctx, struct gl_query_object *q) st_flush_bitmap_cache(st_context(ctx)); + if (q->Target == GL_TIMESTAMP && !stq->pq) { + stq->pq = pipe->create_query(pipe, PIPE_QUERY_TIMESTAMP); + stq->type = PIPE_QUERY_TIMESTAMP; + } + pipe->end_query(pipe, stq->pq); } @@ -169,6 +175,13 @@ st_CheckQuery(struct gl_context *ctx, struct gl_query_object *q) } +static uint64_t +st_GetTimestamp(struct gl_context *ctx) +{ + struct pipe_screen *screen = st_context(ctx)->pipe->screen; + + return screen->get_timestamp(screen); +} void st_init_query_functions(struct dd_function_table *functions) @@ -179,6 +192,7 @@ void st_init_query_functions(struct dd_function_table *functions) functions->EndQuery = st_EndQuery; functions->WaitQuery = st_WaitQuery; functions->CheckQuery = st_CheckQuery; + functions->GetTimestamp = st_GetTimestamp; } #endif /* FEATURE_queryobj */ diff --git a/mesalib/src/mesa/state_tracker/st_extensions.c b/mesalib/src/mesa/state_tracker/st_extensions.c index fd9507536..5b333ad2c 100644 --- a/mesalib/src/mesa/state_tracker/st_extensions.c +++ b/mesalib/src/mesa/state_tracker/st_extensions.c @@ -636,4 +636,9 @@ void st_init_extensions(struct st_context *st) if (ctx->Const.MaxDualSourceDrawBuffers > 0) ctx->Extensions.ARB_blend_func_extended = GL_TRUE; + + if (screen->get_param(screen, PIPE_CAP_TIMER_QUERY) && + screen->get_param(screen, PIPE_CAP_QUERY_TIMESTAMP)) { + ctx->Extensions.ARB_timer_query = GL_TRUE; + } } diff --git a/pixman/pixman/pixman-mmx.c b/pixman/pixman/pixman-mmx.c index 5441d6bc2..74a5e87a8 100644 --- a/pixman/pixman/pixman-mmx.c +++ b/pixman/pixman/pixman-mmx.c @@ -105,8 +105,17 @@ _mm_shuffle_pi16 (__m64 __A, int8_t const __N) return ret; } # else -# define _mm_shuffle_pi16(A, N) \ - ((__m64) __builtin_ia32_pshufw ((__v4hi)(__m64)(A), (int)(N))) +# define _mm_shuffle_pi16(A, N) \ + ({ \ + __m64 ret; \ + \ + asm ("pshufw %2, %1, %0\n\t" \ + : "=y" (ret) \ + : "y" (A), "K" ((const int8_t)N) \ + ); \ + \ + ret; \ + }) # endif # endif #endif diff --git a/pixman/pixman/pixman-x86.c b/pixman/pixman/pixman-x86.c index 52ad3dfd5..57e4d1f35 100644 --- a/pixman/pixman/pixman-x86.c +++ b/pixman/pixman/pixman-x86.c @@ -32,249 +32,204 @@ * that would lead to SIGILL instructions on old CPUs that don't have * it. */ -#if !defined(__amd64__) && !defined(__x86_64__) && !defined(_M_AMD64) - -#ifdef HAVE_GETISAX -#include <sys/auxv.h> -#endif typedef enum { - NO_FEATURES = 0, - MMX = 0x1, - MMX_EXTENSIONS = 0x2, - SSE = 0x6, - SSE2 = 0x8, - CMOV = 0x10 + X86_MMX = (1 << 0), + X86_MMX_EXTENSIONS = (1 << 1), + X86_SSE = (1 << 2) | X86_MMX_EXTENSIONS, + X86_SSE2 = (1 << 3), + X86_CMOV = (1 << 4) } cpu_features_t; +#ifdef HAVE_GETISAX -static unsigned int +#include <sys/auxv.h> + +static cpu_features_t detect_cpu_features (void) { - unsigned int features = 0; + cpu_features_t features = 0; unsigned int result = 0; - -#ifdef HAVE_GETISAX + if (getisax (&result, 1)) { if (result & AV_386_CMOV) - features |= CMOV; + features |= X86_CMOV; if (result & AV_386_MMX) - features |= MMX; + features |= X86_MMX; if (result & AV_386_AMD_MMX) - features |= MMX_EXTENSIONS; + features |= X86_MMX_EXTENSIONS; if (result & AV_386_SSE) - features |= SSE; + features |= X86_SSE; if (result & AV_386_SSE2) - features |= SSE2; + features |= X86_SSE2; } + + return features; +} + +#else + +#define _PIXMAN_X86_64 \ + (defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64)) + +static pixman_bool_t +have_cpuid (void) +{ +#if _PIXMAN_X86_64 || defined (_MSC_VER) + + return TRUE; + +#elif defined (__GNUC__) + uint32_t result; + + __asm__ volatile ( + "pushf" "\n\t" + "pop %%eax" "\n\t" + "mov %%eax, %%ecx" "\n\t" + "xor $0x00200000, %%eax" "\n\t" + "push %%eax" "\n\t" + "popf" "\n\t" + "pushf" "\n\t" + "pop %%eax" "\n\t" + "xor %%ecx, %%eax" "\n\t" + "mov %%eax, %0" "\n\t" + : "=r" (result) + : + : "%eax", "%ecx"); + + return !!result; + #else - char vendor[13]; -#ifdef _MSC_VER - int vendor0 = 0, vendor1, vendor2; +#error "Unknown compiler" #endif - vendor[0] = 0; - vendor[12] = 0; - -#ifdef __GNUC__ - /* see p. 118 of amd64 instruction set manual Vol3 */ - /* We need to be careful about the handling of %ebx and - * %esp here. We can't declare either one as clobbered +} + +static void +pixman_cpuid (uint32_t feature, + uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d) +{ +#if defined (__GNUC__) + +#if _PIXMAN_X86_64 + __asm__ volatile ( + "cpuid" "\n\t" + : "=a" (*a), "=b" (*b), "=c" (*c), "=d" (*d) + : "a" (feature)); +#else + /* On x86-32 we need to be careful about the handling of %ebx + * and %esp. We can't declare either one as clobbered * since they are special registers (%ebx is the "PIC * register" holding an offset to global data, %esp the - * stack pointer), so we need to make sure they have their - * original values when we access the output operands. + * stack pointer), so we need to make sure that %ebx is + * preserved, and that %esp has its original value when + * accessing the output operands. */ - __asm__ ( - "pushf\n" - "pop %%eax\n" - "mov %%eax, %%ecx\n" - "xor $0x00200000, %%eax\n" - "push %%eax\n" - "popf\n" - "pushf\n" - "pop %%eax\n" - "mov $0x0, %%edx\n" - "xor %%ecx, %%eax\n" - "jz 1f\n" - - "mov $0x00000000, %%eax\n" - "push %%ebx\n" - "cpuid\n" - "mov %%ebx, %%eax\n" - "pop %%ebx\n" - "mov %%eax, %1\n" - "mov %%edx, %2\n" - "mov %%ecx, %3\n" - "mov $0x00000001, %%eax\n" - "push %%ebx\n" - "cpuid\n" - "pop %%ebx\n" - "1:\n" - "mov %%edx, %0\n" - : "=r" (result), - "=m" (vendor[0]), - "=m" (vendor[4]), - "=m" (vendor[8]) - : - : "%eax", "%ecx", "%edx" - ); - + __asm__ volatile ( + "xchg %%ebx, %1" "\n\t" + "cpuid" "\n\t" + "xchg %%ebx, %1" "\n\t" + : "=a" (*a), "=r" (*b), "=c" (*c), "=d" (*d) + : "a" (feature)); +#endif + #elif defined (_MSC_VER) - - _asm { - pushfd - pop eax - mov ecx, eax - xor eax, 00200000h - push eax - popfd - pushfd - pop eax - mov edx, 0 - xor eax, ecx - jz nocpuid - - mov eax, 0 - push ebx - cpuid - mov eax, ebx - pop ebx - mov vendor0, eax - mov vendor1, edx - mov vendor2, ecx - mov eax, 1 - push ebx - cpuid - pop ebx - nocpuid: - mov result, edx - } - memmove (vendor + 0, &vendor0, 4); - memmove (vendor + 4, &vendor1, 4); - memmove (vendor + 8, &vendor2, 4); - + int info[4]; + + __cpuid (info, feature); + + *a = info[0]; + *b = info[1]; + *c = info[2]; + *d = info[3]; #else -# error unsupported compiler +#error Unknown compiler #endif - - features = 0; - if (result) +} + +static cpu_features_t +detect_cpu_features (void) +{ + uint32_t a, b, c, d; + cpu_features_t features = 0; + + if (!have_cpuid()) + return features; + + /* Get feature bits */ + pixman_cpuid (0x01, &a, &b, &c, &d); + if (d & (1 << 15)) + features |= X86_CMOV; + if (d & (1 << 23)) + features |= X86_MMX; + if (d & (1 << 25)) + features |= X86_SSE; + if (d & (1 << 26)) + features |= X86_SSE2; + + /* Check for AMD specific features */ + if ((features & X86_MMX) && !(features & X86_SSE)) { - /* result now contains the standard feature bits */ - if (result & (1 << 15)) - features |= CMOV; - if (result & (1 << 23)) - features |= MMX; - if (result & (1 << 25)) - features |= SSE; - if (result & (1 << 26)) - features |= SSE2; - if ((features & MMX) && !(features & SSE) && - (strcmp (vendor, "AuthenticAMD") == 0 || - strcmp (vendor, "Geode by NSC") == 0)) + char vendor[13]; + + /* Get vendor string */ + memset (vendor, 0, sizeof vendor); + + pixman_cpuid (0x00, &a, &b, &c, &d); + memcpy (vendor + 0, &b, 4); + memcpy (vendor + 4, &d, 4); + memcpy (vendor + 8, &c, 4); + + if (strcmp (vendor, "AuthenticAMD") == 0 || + strcmp (vendor, "Geode by NSC") == 0) { - /* check for AMD MMX extensions */ -#ifdef __GNUC__ - __asm__ ( - " push %%ebx\n" - " mov $0x80000000, %%eax\n" - " cpuid\n" - " xor %%edx, %%edx\n" - " cmp $0x1, %%eax\n" - " jge 2f\n" - " mov $0x80000001, %%eax\n" - " cpuid\n" - "2:\n" - " pop %%ebx\n" - " mov %%edx, %0\n" - : "=r" (result) - : - : "%eax", "%ecx", "%edx" - ); -#elif defined _MSC_VER - _asm { - push ebx - mov eax, 80000000h - cpuid - xor edx, edx - cmp eax, 1 - jge notamd - mov eax, 80000001h - cpuid - notamd: - pop ebx - mov result, edx - } -#endif - if (result & (1 << 22)) - features |= MMX_EXTENSIONS; + pixman_cpuid (0x80000000, &a, &b, &c, &d); + if (a >= 0x80000001) + { + pixman_cpuid (0x80000001, &a, &b, &c, &d); + + if (d & (1 << 22)) + features |= X86_MMX_EXTENSIONS; + } } } -#endif /* HAVE_GETISAX */ - + return features; } -#ifdef USE_X86_MMX -static pixman_bool_t -pixman_have_mmx (void) -{ - static pixman_bool_t initialized = FALSE; - static pixman_bool_t mmx_present; - - if (!initialized) - { - unsigned int features = detect_cpu_features (); - mmx_present = (features & (MMX | MMX_EXTENSIONS)) == (MMX | MMX_EXTENSIONS); - initialized = TRUE; - } - - return mmx_present; -} #endif -#ifdef USE_SSE2 static pixman_bool_t -pixman_have_sse2 (void) +have_feature (cpu_features_t feature) { - static pixman_bool_t initialized = FALSE; - static pixman_bool_t sse2_present; - + static pixman_bool_t initialized; + static cpu_features_t features; + if (!initialized) { - unsigned int features = detect_cpu_features (); - sse2_present = (features & (MMX | MMX_EXTENSIONS | SSE | SSE2)) == (MMX | MMX_EXTENSIONS | SSE | SSE2); + features = detect_cpu_features(); initialized = TRUE; } - - return sse2_present; -} -#endif - -#else /* __amd64__ */ -#ifdef USE_X86_MMX -#define pixman_have_mmx() TRUE -#endif -#ifdef USE_SSE2 -#define pixman_have_sse2() TRUE -#endif -#endif /* __amd64__ */ + return (features & feature) == feature; +} #endif pixman_implementation_t * _pixman_x86_get_implementations (pixman_implementation_t *imp) { +#define MMX_BITS (X86_MMX | X86_MMX_EXTENSIONS) +#define SSE2_BITS (X86_MMX | X86_MMX_EXTENSIONS | X86_SSE | X86_SSE2) + #ifdef USE_X86_MMX - if (!_pixman_disabled ("mmx") && pixman_have_mmx()) + if (!_pixman_disabled ("mmx") && have_feature (MMX_BITS)) imp = _pixman_implementation_create_mmx (imp); #endif #ifdef USE_SSE2 - if (!_pixman_disabled ("sse2") && pixman_have_sse2()) + if (!_pixman_disabled ("sse2") && have_feature (SSE2_BITS)) imp = _pixman_implementation_create_sse2 (imp); #endif diff --git a/xorg-server/Xext/sync.c b/xorg-server/Xext/sync.c index 8a333dd3a..b8f094db5 100644 --- a/xorg-server/Xext/sync.c +++ b/xorg-server/Xext/sync.c @@ -951,6 +951,7 @@ SyncCreateSystemCounter(const char *name, if (RTCounter == 0) { return NULL; } + xorg_list_init(&SysCounterList); } pCounter = SyncCreateCounter(NULL, FakeClientID(0), initial); @@ -2448,13 +2449,12 @@ SyncExtensionInit(void) ExtensionEntry *extEntry; int s; - xorg_list_init(&SysCounterList); - for (s = 0; s < screenInfo.numScreens; s++) miSyncSetup(screenInfo.screens[s]); if (RTCounter == 0) { RTCounter = CreateNewResourceType(FreeCounter, "SyncCounter"); + xorg_list_init(&SysCounterList); } RTAlarm = CreateNewResourceType(FreeAlarm, "SyncAlarm"); RTAwait = CreateNewResourceType(FreeAwait, "SyncAwait"); diff --git a/xorg-server/dix/devices.c b/xorg-server/dix/devices.c index 839de35aa..9cf04ed3f 100644 --- a/xorg-server/dix/devices.c +++ b/xorg-server/dix/devices.c @@ -1890,6 +1890,7 @@ ProcGetPointerMapping(ClientPtr client) * the ClientPointer could change. */ DeviceIntPtr ptr = PickPointer(client); ButtonClassPtr butc = ptr->button; + int nElts; int rc; REQUEST_SIZE_MATCH(xReq); @@ -1898,15 +1899,16 @@ ProcGetPointerMapping(ClientPtr client) if (rc != Success) return rc; + nElts = (butc) ? butc->numButtons : 0; rep = (xGetPointerMappingReply) { .type = X_Reply, - .nElts = (butc) ? butc->numButtons : 0, + .nElts = nElts, .sequenceNumber = client->sequence, - .length = ((unsigned) rep.nElts + (4 - 1)) / 4 + .length = ((unsigned) nElts + (4 - 1)) / 4 }; WriteReplyToClient(client, sizeof(xGetPointerMappingReply), &rep); if (butc) - WriteToClient(client, (int) rep.nElts, &butc->map[1]); + WriteToClient(client, nElts, &butc->map[1]); return Success; } @@ -2672,6 +2674,8 @@ AllocDevicePair(ClientPtr client, const char *name, *ptr = *keybd = NULL; + XkbInitPrivates(); + pointer = AddInputDevice(client, ptr_proc, TRUE); if (!pointer) diff --git a/xorg-server/test/xtest.c b/xorg-server/test/xtest.c index 99e218541..402d9ceba 100644 --- a/xorg-server/test/xtest.c +++ b/xorg-server/test/xtest.c @@ -76,8 +76,6 @@ xtest_init_devices(void) InitAtoms(); SyncExtensionInit(); - XkbInitPrivates(); - /* this also inits the xtest devices */ InitCoreDevices(); |