<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.comp.video.mesa3d.devel">
    <title>gmane.comp.video.mesa3d.devel</title>
    <link>http://blog.gmane.org/gmane.comp.video.mesa3d.devel</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59368"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59367"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59366"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59365"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59360"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59359"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59358"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59357"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59356"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59355"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59354"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59353"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59351"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59350"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59349"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59347"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59346"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59345"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59344"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59343"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59368">
    <title>[PATCH 2/2] radeonsi: Handle TGSI_OPCODE_DDX/Y usinglocal memory</title>
    <link>http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59368</link>
    <description>&lt;pre&gt;From: Michel Dänzer &amp;lt;michel.daenzer&amp;lt; at &amp;gt;amd.com&amp;gt;

16 more little piglits.

Signed-off-by: Michel Dänzer &amp;lt;michel.daenzer&amp;lt; at &amp;gt;amd.com&amp;gt;
---
 src/gallium/drivers/radeonsi/radeonsi_compute.c |   2 +-
 src/gallium/drivers/radeonsi/radeonsi_shader.c  | 101 +++++++++++++++++++++++-
 src/gallium/drivers/radeonsi/radeonsi_shader.h  |   1 +
 src/gallium/drivers/radeonsi/si_state_draw.c    |   1 +
 4 files changed, 103 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/radeonsi_compute.c b/src/gallium/drivers/radeonsi/radeonsi_compute.c
index ed51587..a4a2856 100644
--- a/src/gallium/drivers/radeonsi/radeonsi_compute.c
+++ b/src/gallium/drivers/radeonsi/radeonsi_compute.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -191,7 +191,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void radeonsi_launch_grid(
 | S_00B84C_TGID_Z_EN(1)
 | S_00B84C_TG_SIZE_EN(1)
 | S_00B84C_TIDIG_COMP_CNT(2)
-| S_00B84C_LDS_SIZE(0)
+| S_00B84C_LDS_SIZE(shader-&amp;gt;lds_size)
 | S_00B84C_EXCP_EN(0))
 ;
 si_pm4_set_reg(pm4, R_00B854_COMPUTE_RESOURCE_LIMITS, 0);
diff --git a/src/gallium/drivers/radeonsi/radeonsi_shader.c b/src/gallium/drivers/radeonsi/radeonsi_shader.c
index 7f3d38b..fee6262 100644
--- a/src/gallium/drivers/radeonsi/radeonsi_shader.c
+++ b/src/gallium/drivers/radeonsi/radeonsi_shader.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -61,6 +61,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; struct si_shader_context
 unsigned type; /* TGSI_PROCESSOR_* specifies the type of shader. */
 LLVMValueRef const_md;
 LLVMValueRef const_resource;
+#if HAVE_LLVM &amp;gt;= 0x0304
+LLVMValueRef ddxy_lds;
+#endif
 LLVMValueRef *constants;
 LLVMValueRef *resources;
 LLVMValueRef *samplers;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -82,6 +85,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static struct si_shader_context * si_shader_context(
 
 #define USE_SGPR_MAX_SUFFIX_LEN 5
 #define CONST_ADDR_SPACE 2
+#define LOCAL_ADDR_SPACE 3
 #define USER_SGPR_ADDR_SPACE 8
 
 /**
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1065,6 +1069,78 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void txq_fetch_args(
 4);
 }
 
+#if HAVE_LLVM &amp;gt;= 0x0304
+
+static void si_llvm_emit_ddxy(
+const struct lp_build_tgsi_action * action,
+struct lp_build_tgsi_context * bld_base,
+struct lp_build_emit_data * emit_data)
+{
+struct si_shader_context *si_shader_ctx = si_shader_context(bld_base);
+struct gallivm_state *gallivm = bld_base-&amp;gt;base.gallivm;
+struct lp_build_context * base = &amp;amp;bld_base-&amp;gt;base;
+const struct tgsi_full_instruction *inst = emit_data-&amp;gt;inst;
+unsigned opcode = inst-&amp;gt;Instruction.Opcode;
+LLVMValueRef indices[2];
+LLVMValueRef store_ptr, load_ptr0, load_ptr1;
+LLVMValueRef tl, trbl, result[4];
+LLVMTypeRef i32;
+unsigned swizzle[4];
+unsigned c;
+
+i32 = LLVMInt32TypeInContext(gallivm-&amp;gt;context);
+
+indices[0] = bld_base-&amp;gt;uint_bld.zero;
+indices[1] = build_intrinsic(gallivm-&amp;gt;builder, "llvm.SI.tid", i32,
+     NULL, 0, LLVMReadNoneAttribute);
+store_ptr = LLVMBuildGEP(gallivm-&amp;gt;builder, si_shader_ctx-&amp;gt;ddxy_lds,
+ indices, 2, "");
+
+indices[1] = LLVMBuildAnd(gallivm-&amp;gt;builder, indices[1],
+  lp_build_const_int32(gallivm, 0xfffffffc), "");
+load_ptr0 = LLVMBuildGEP(gallivm-&amp;gt;builder, si_shader_ctx-&amp;gt;ddxy_lds,
+ indices, 2, "");
+
+indices[1] = LLVMBuildAdd(gallivm-&amp;gt;builder, indices[1],
+  lp_build_const_int32(gallivm,
+       opcode == TGSI_OPCODE_DDX ? 1 : 2),
+  "");
+load_ptr1 = LLVMBuildGEP(gallivm-&amp;gt;builder, si_shader_ctx-&amp;gt;ddxy_lds,
+ indices, 2, "");
+
+for (c = 0; c &amp;lt; 4; ++c) {
+unsigned i;
+
+swizzle[c] = tgsi_util_get_full_src_register_swizzle(&amp;amp;inst-&amp;gt;Src[0], c);
+for (i = 0; i &amp;lt; c; ++i) {
+if (swizzle[i] == swizzle[c]) {
+result[c] = result[i];
+break;
+}
+}
+if (i != c)
+continue;
+
+LLVMBuildStore(gallivm-&amp;gt;builder,
+       LLVMBuildBitCast(gallivm-&amp;gt;builder,
+lp_build_emit_fetch(bld_base, inst, 0, c),
+i32, ""),
+       store_ptr);
+
+tl = LLVMBuildLoad(gallivm-&amp;gt;builder, load_ptr0, "");
+tl = LLVMBuildBitCast(gallivm-&amp;gt;builder, tl, base-&amp;gt;elem_type, "");
+
+trbl = LLVMBuildLoad(gallivm-&amp;gt;builder, load_ptr1, "");
+trbl = LLVMBuildBitCast(gallivm-&amp;gt;builder, trbl,base-&amp;gt;elem_type, "");
+
+result[c] = LLVMBuildFSub(gallivm-&amp;gt;builder, trbl, tl, "");
+}
+
+emit_data-&amp;gt;output[0] = lp_build_gather_values(gallivm, result, 4);
+}
+
+#endif /* HAVE_LLVM &amp;gt;= 0x0304 */
+
 static const struct lp_build_tgsi_action tex_action = {
 .fetch_args = tex_fetch_args,
 .emit = build_tex_intrinsic,
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1117,7 +1193,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void create_meta_data(struct si_shader_context *si_shader_ctx)
 
 static void create_function(struct si_shader_context *si_shader_ctx)
 {
-struct gallivm_state *gallivm = si_shader_ctx-&amp;gt;radeon_bld.soa.bld_base.base.gallivm;
+struct lp_build_tgsi_context *bld_base = &amp;amp;si_shader_ctx-&amp;gt;radeon_bld.soa.bld_base;
+struct gallivm_state *gallivm = bld_base-&amp;gt;base.gallivm;
 LLVMTypeRef params[20], f32, i8, i32, v2i32, v3i32;
 unsigned i;
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1172,6 +1249,16 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void create_function(struct si_shader_context *si_shader_ctx)
       SI_PARAM_START_INSTANCE);
 LLVMAddAttribute(P, LLVMInRegAttribute);
 }
+
+#if HAVE_LLVM &amp;gt;= 0x0304
+if (bld_base-&amp;gt;info-&amp;gt;opcode_count[TGSI_OPCODE_DDX] &amp;gt; 0 ||
+    bld_base-&amp;gt;info-&amp;gt;opcode_count[TGSI_OPCODE_DDY] &amp;gt; 0)
+si_shader_ctx-&amp;gt;ddxy_lds =
+LLVMAddGlobalInAddressSpace(gallivm-&amp;gt;module,
+    LLVMArrayType(i32, 64),
+    "ddxy_lds",
+    LOCAL_ADDR_SPACE);
+#endif
 }
 
 static void preload_constants(struct si_shader_context *si_shader_ctx)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1275,6 +1362,12 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int si_compile_llvm(struct r600_context *rctx, struct si_pipe_shader *shader,
 shader-&amp;gt;num_sgprs = (G_00B028_SGPRS(value) + 1) * 8;
 shader-&amp;gt;num_vgprs = (G_00B028_VGPRS(value) + 1) * 4;
 break;
+case R_00B02C_SPI_SHADER_PGM_RSRC2_PS:
+shader-&amp;gt;lds_size = G_00B02C_EXTRA_LDS_SIZE(value);
+break;
+case R_00B84C_COMPUTE_PGM_RSRC2:
+shader-&amp;gt;lds_size = G_00B84C_LDS_SIZE(value);
+break;
 case R_0286CC_SPI_PS_INPUT_ENA:
 shader-&amp;gt;spi_ps_input_ena = value;
 break;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1333,6 +1426,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int si_pipe_shader_create(
 bld_base = &amp;amp;si_shader_ctx.radeon_bld.soa.bld_base;
 
 tgsi_scan_shader(sel-&amp;gt;tokens, &amp;amp;shader_info);
+
 shader-&amp;gt;shader.uses_kill = shader_info.uses_kill;
 shader-&amp;gt;shader.uses_instanceid = shader_info.uses_instanceid;
 bld_base-&amp;gt;info = &amp;amp;shader_info;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1349,6 +1443,11 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int si_pipe_shader_create(
 bld_base-&amp;gt;op_actions[TGSI_OPCODE_TXP] = tex_action;
 bld_base-&amp;gt;op_actions[TGSI_OPCODE_TXQ] = txq_action;
 
+#if HAVE_LLVM &amp;gt;= 0x0304
+bld_base-&amp;gt;op_actions[TGSI_OPCODE_DDX].emit = si_llvm_emit_ddxy;
+bld_base-&amp;gt;op_actions[TGSI_OPCODE_DDY].emit = si_llvm_emit_ddxy;
+#endif
+
 si_shader_ctx.radeon_bld.load_input = declare_input;
 si_shader_ctx.radeon_bld.load_system_value = declare_system_value;
 si_shader_ctx.tokens = sel-&amp;gt;tokens;
diff --git a/src/gallium/drivers/radeonsi/radeonsi_shader.h b/src/gallium/drivers/radeonsi/radeonsi_shader.h
index 33e81c7..60a48f4 100644
--- a/src/gallium/drivers/radeonsi/radeonsi_shader.h
+++ b/src/gallium/drivers/radeonsi/radeonsi_shader.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -138,6 +138,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; struct si_pipe_shader {
 struct si_resource*bo;
 unsignednum_sgprs;
 unsignednum_vgprs;
+unsignedlds_size;
 unsignedspi_ps_input_ena;
 unsignedspi_shader_col_format;
 unsignedcb_shader_mask;
diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c b/src/gallium/drivers/radeonsi/si_state_draw.c
index 09c741f..18f265b 100644
--- a/src/gallium/drivers/radeonsi/si_state_draw.c
+++ b/src/gallium/drivers/radeonsi/si_state_draw.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -232,6 +232,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void si_pipe_shader_ps(struct pipe_context *ctx, struct si_pipe_shader *s
        S_00B028_VGPRS((shader-&amp;gt;num_vgprs - 1) / 4) |
        S_00B028_SGPRS((num_sgprs - 1) / 8));
 si_pm4_set_reg(pm4, R_00B02C_SPI_SHADER_PGM_RSRC2_PS,
+       S_00B02C_EXTRA_LDS_SIZE(shader-&amp;gt;lds_size) |
        S_00B02C_USER_SGPR(num_user_sgprs));
 
 si_pm4_set_reg(pm4, R_02880C_DB_SHADER_CONTROL, db_shader_control);
&lt;/pre&gt;</description>
    <dc:creator>Michel Dänzer</dc:creator>
    <dc:date>2013-06-19T16:30:50</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59367">
    <title>[PATCH v2 1/2] radeonsi: Handle TGSI_OPCODE_TXD</title>
    <link>http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59367</link>
    <description>&lt;pre&gt;From: Michel Dänzer &amp;lt;michel.daenzer&amp;lt; at &amp;gt;amd.com&amp;gt;

One more little piglit.

Signed-off-by: Michel Dänzer &amp;lt;michel.daenzer&amp;lt; at &amp;gt;amd.com&amp;gt;
---

v2: Only use the new functionality as of LLVM 3.4.

 src/gallium/drivers/radeonsi/radeonsi_shader.c | 27 ++++++++++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/radeonsi_shader.c b/src/gallium/drivers/radeonsi/radeonsi_shader.c
index f6fdfae..7f3d38b 100644
--- a/src/gallium/drivers/radeonsi/radeonsi_shader.c
+++ b/src/gallium/drivers/radeonsi/radeonsi_shader.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -875,6 +875,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void tex_fetch_args(
 const struct tgsi_full_instruction * inst = emit_data-&amp;gt;inst;
 unsigned opcode = inst-&amp;gt;Instruction.Opcode;
 unsigned target = inst-&amp;gt;Texture.Texture;
+unsigned sampler_src;
 LLVMValueRef coords[4];
 LLVMValueRef address[16];
 int ref_pos;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -920,6 +921,15 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void tex_fetch_args(
 address[count++] = lp_build_emit_fetch(bld_base, inst, 1, 0);
 }
 
+/* Pack user derivatives */
+if (opcode == TGSI_OPCODE_TXD) {
+for (chan = 0; chan &amp;lt; 2; chan++) {
+address[count++] = lp_build_emit_fetch(bld_base, inst, 1, chan);
+if (num_coords &amp;gt; 1)
+address[count++] = lp_build_emit_fetch(bld_base, inst, 2, chan);
+}
+}
+
 /* Pack texture coordinates */
 address[count++] = coords[0];
 if (num_coords &amp;gt; 1)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -961,8 +971,10 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void tex_fetch_args(
  "");
 }
 
+sampler_src = emit_data-&amp;gt;inst-&amp;gt;Instruction.NumSrcRegs - 1;
+
 /* Resource */
-emit_data-&amp;gt;args[1] = si_shader_ctx-&amp;gt;resources[emit_data-&amp;gt;inst-&amp;gt;Src[1].Register.Index];
+emit_data-&amp;gt;args[1] = si_shader_ctx-&amp;gt;resources[emit_data-&amp;gt;inst-&amp;gt;Src[sampler_src].Register.Index];
 
 if (opcode == TGSI_OPCODE_TXF) {
 /* add tex offsets */
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -993,7 +1005,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void tex_fetch_args(
 emit_data-&amp;gt;arg_count = 3;
 } else {
 /* Sampler */
-emit_data-&amp;gt;args[2] = si_shader_ctx-&amp;gt;samplers[emit_data-&amp;gt;inst-&amp;gt;Src[1].Register.Index];
+emit_data-&amp;gt;args[2] = si_shader_ctx-&amp;gt;samplers[emit_data-&amp;gt;inst-&amp;gt;Src[sampler_src].Register.Index];
 
 emit_data-&amp;gt;dst_type = LLVMVectorType(
 LLVMFloatTypeInContext(bld_base-&amp;gt;base.gallivm-&amp;gt;context),
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1065,6 +1077,14 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static const struct lp_build_tgsi_action txb_action = {
 .intr_name = "llvm.SI.sampleb."
 };
 
+#if HAVE_LLVM &amp;gt;= 0x0304
+static const struct lp_build_tgsi_action txd_action = {
+.fetch_args = tex_fetch_args,
+.emit = build_tex_intrinsic,
+.intr_name = "llvm.SI.sampled."
+};
+#endif
+
 static const struct lp_build_tgsi_action txf_action = {
 .fetch_args = tex_fetch_args,
 .emit = build_tex_intrinsic,
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1321,6 +1341,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int si_pipe_shader_create(
 
 bld_base-&amp;gt;op_actions[TGSI_OPCODE_TEX] = tex_action;
 bld_base-&amp;gt;op_actions[TGSI_OPCODE_TXB] = txb_action;
+#if HAVE_LLVM &amp;gt;= 0x0304
+bld_base-&amp;gt;op_actions[TGSI_OPCODE_TXD] = txd_action;
+#endif
 bld_base-&amp;gt;op_actions[TGSI_OPCODE_TXF] = txf_action;
 bld_base-&amp;gt;op_actions[TGSI_OPCODE_TXL] = txl_action;
 bld_base-&amp;gt;op_actions[TGSI_OPCODE_TXP] = tex_action;
&lt;/pre&gt;</description>
    <dc:creator>Michel Dänzer</dc:creator>
    <dc:date>2013-06-19T16:30:49</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59366">
    <title>R600/SI: Support for local memory and derivatives</title>
    <link>http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59366</link>
    <description>&lt;pre&gt;
These patches implement enough of local memory support to allow radeonsi
to use that for computing derivatives, as suggested by Tom.

They also almost allow test/CodeGen/R600/local-memory.ll to generate
code for SI. Right now it still fails because it tries to copy a VGPR to
an SGPR, which is not possible.


&lt;/pre&gt;</description>
    <dc:creator>Michel Dänzer</dc:creator>
    <dc:date>2013-06-19T16:28:21</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59365">
    <title>[PATCH] st/dri/sw: Fix pitch calculation indrisw_update_tex_buffer</title>
    <link>http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59365</link>
    <description>&lt;pre&gt;swrastGetImage rounds the pitch up to 4 bytes for compatibility reasons
that are explained in drisw_glx.c:bytes_per_line, so drisw_update_tex_buffer
must do the same.

Fixes window skew seen while running firefox over vnc on a 16-bit screen.

Signed-off-by: Richard Sandiford &amp;lt;rsandifo&amp;lt; at &amp;gt;linux.vnet.ibm.com&amp;gt;
---
 src/gallium/state_trackers/dri/sw/drisw.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/gallium/state_trackers/dri/sw/drisw.c b/src/gallium/state_trackers/dri/sw/drisw.c
index 7a5f797..f9fddf7 100644
--- a/src/gallium/state_trackers/dri/sw/drisw.c
+++ b/src/gallium/state_trackers/dri/sw/drisw.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -265,8 +265,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; drisw_update_tex_buffer(struct dri_drawable *drawable,
    /* Copy the Drawable content to the mapped texture buffer */
    get_image(dPriv, x, y, w, h, map);
 
-   /* The pipe transfer has a pitch rounded up to the nearest 64 pixels. */
-   ximage_stride = w * cpp;
+   /* The pipe transfer has a pitch rounded up to the nearest 64 pixels.
+      get_image() has a patch rounded up to 4 bytes.  */
+   ximage_stride = ((w * cpp) + 3) &amp;amp; -4;
    for (line = h-1; line; --line) {
       memmove(&amp;amp;map[line * transfer-&amp;gt;stride],
               &amp;amp;map[line * ximage_stride],
&lt;/pre&gt;</description>
    <dc:creator>Richard Sandiford</dc:creator>
    <dc:date>2013-06-18T15:41:43</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59360">
    <title>Re: [PATCH 1/2] gallium: fixPIPE_QUERY_TIMESTAMP_DISJOINT</title>
    <link>http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59360</link>
    <description>&lt;pre&gt;

----- Original Message -----

Actually, jsut noticed it should be using a `struct pipe_query_data_timestamp_disjoint *` instead of res64/res8.

Jose

&lt;/pre&gt;</description>
    <dc:creator>Jose Fonseca</dc:creator>
    <dc:date>2013-06-19T15:11:00</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59359">
    <title>Re: [PATCH 2/2] softpipe: handle all queries, and change for the new disjoint semantics</title>
    <link>http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59359</link>
    <description>&lt;pre&gt;Looks good to me.

Jose

----- Original Message -----
&lt;/pre&gt;</description>
    <dc:creator>Jose Fonseca</dc:creator>
    <dc:date>2013-06-19T15:09:44</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59358">
    <title>Re: [PATCH 1/2] gallium: fixPIPE_QUERY_TIMESTAMP_DISJOINT</title>
    <link>http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59358</link>
    <description>&lt;pre&gt;

----- Original Message -----

I don't think this statement is needed. Same below. Otherwise looks good.

Jose




&lt;/pre&gt;</description>
    <dc:creator>Jose Fonseca</dc:creator>
    <dc:date>2013-06-19T15:08:17</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59357">
    <title>Re: [PATCH 0/6] Eliminating unused built-in varyings</title>
    <link>http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59357</link>
    <description>&lt;pre&gt;Could somebody please review this series?

Marek

On Thu, Jun 13, 2013 at 2:25 PM, Marek Olšák &amp;lt;maraeo&amp;lt; at &amp;gt;gmail.com&amp;gt; wrote:
_______________________________________________
mesa-dev mailing list
mesa-dev&amp;lt; at &amp;gt;lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev
&lt;/pre&gt;</description>
    <dc:creator>Marek Olšák</dc:creator>
    <dc:date>2013-06-19T11:22:27</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59356">
    <title>[PATCH] i965: Remove interleaved user array uploadoptimization</title>
    <link>http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59356</link>
    <description>&lt;pre&gt;From: Ian Romanick &amp;lt;ian.d.romanick&amp;lt; at &amp;gt;intel.com&amp;gt;

The checks to determine when the data can be uploaded in an interleaved
fashion can be tricked by certain data layouts.  For example,

    float data[...];

    glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 16, &amp;amp;data[0]);
    glVertexAttribPointer(1, 4, GL_FLOAT, GL_FALSE, 16, &amp;amp;data[4]);
    glDrawArrays(GL_POINTS, 0, 1);

will hit the interleaved path with an incorrect size (16 bytes instead
of 32 bytes).  As a result, the data for attribute 1 never gets
uploaded.  The single element draw case is the only sensible case I can
think of for non-interleaved-that-looks-like-interleaved data, but there
may be others as well.

I don't see an easy way to fix the checks, so I have chosen to just rip
out the optimization.  This may cause performance issues on applications
that use large arrays of data that are not in VBOs.

Signed-off-by: Ian Romanick &amp;lt;ian.d.romanick&amp;lt; at &amp;gt;intel.com&amp;gt;
Cc: Kenneth Graunke &amp;lt;kenneth&amp;lt; at &amp;gt;whitecape.org&amp;gt;
---
 src/mesa/drivers/dri/i965/brw_draw_upload.c | 37 +----------------------------
 1 file changed, 1 insertion(+), 36 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c
index 2ded14b..9d46fee 100644
--- a/src/mesa/drivers/dri/i965/brw_draw_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -403,8 +403,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void brw_prepare_vertices(struct brw_context *brw)
    struct intel_context *intel = intel_context(ctx);
    /* CACHE_NEW_VS_PROG */
    GLbitfield64 vs_inputs = brw-&amp;gt;vs.prog_data-&amp;gt;inputs_read;
-   const unsigned char *ptr = NULL;
-   GLuint interleaved = 0;
    unsigned int min_index = brw-&amp;gt;vb.min_index + brw-&amp;gt;basevertex;
    unsigned int max_index = brw-&amp;gt;vb.max_index + brw-&amp;gt;basevertex;
    int delta, i, j;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -498,19 +496,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void brw_prepare_vertices(struct brw_context *brw)
   */
  assert(input-&amp;gt;offset &amp;lt; brw-&amp;gt;vb.buffers[input-&amp;gt;buffer].bo-&amp;gt;size);
       } else {
- /* Queue the buffer object up to be uploaded in the next pass,
-  * when we've decided if we're doing interleaved or not.
+ /* Queue the buffer object up to be uploaded in the next pass.
   */
- if (nr_uploads == 0) {
-    interleaved = glarray-&amp;gt;StrideB;
-    ptr = glarray-&amp;gt;Ptr;
- }
- else if (interleaved != glarray-&amp;gt;StrideB ||
-  (uintptr_t)(glarray-&amp;gt;Ptr - ptr) &amp;gt; interleaved)
- {
-    interleaved = 0;
- }
-
  upload[nr_uploads++] = input;
       }
    }
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -527,28 +514,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void brw_prepare_vertices(struct brw_context *brw)
    }
 
    /* Handle any arrays to be uploaded. */
-   if (nr_uploads &amp;gt; 1) {
-      if (interleaved) {
- struct brw_vertex_buffer *buffer = &amp;amp;brw-&amp;gt;vb.buffers[j];
- /* All uploads are interleaved, so upload the arrays together as
-  * interleaved.  First, upload the contents and set up upload[0].
-  */
- copy_array_to_vbo_array(brw, upload[0], min_index, max_index,
- buffer, interleaved);
- buffer-&amp;gt;offset -= delta * interleaved;
-
- for (i = 0; i &amp;lt; nr_uploads; i++) {
-    /* Then, just point upload[i] at upload[0]'s buffer. */
-    upload[i]-&amp;gt;offset =
-       ((const unsigned char *)upload[i]-&amp;gt;glarray-&amp;gt;Ptr - ptr);
-    upload[i]-&amp;gt;buffer = j;
- }
- j++;
-
- nr_uploads = 0;
-      }
-   }
-   /* Upload non-interleaved arrays */
    for (i = 0; i &amp;lt; nr_uploads; i++) {
       struct brw_vertex_buffer *buffer = &amp;amp;brw-&amp;gt;vb.buffers[j];
       if (upload[i]-&amp;gt;glarray-&amp;gt;InstanceDivisor == 0) {
&lt;/pre&gt;</description>
    <dc:creator>Ian Romanick</dc:creator>
    <dc:date>2013-06-19T10:20:22</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59355">
    <title>Re: [PATCH] prog_parameter.c ASAN Patch</title>
    <link>http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59355</link>
    <description>&lt;pre&gt;Any word on this?

Thanks,
Myles


On Mon, Jun 17, 2013 at 12:09 PM, Myles C. Maxfield &amp;lt;
myles.maxfield&amp;lt; at &amp;gt;gmail.com&amp;gt; wrote:

_______________________________________________
mesa-dev mailing list
mesa-dev&amp;lt; at &amp;gt;lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev
&lt;/pre&gt;</description>
    <dc:creator>Myles C. Maxfield</dc:creator>
    <dc:date>2013-06-19T07:47:13</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59354">
    <title>Re: [PATCH 4/4] glsl: Streamline the built-in type handling code.</title>
    <link>http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59354</link>
    <description>&lt;pre&gt;
I love these changes.  I have a few comments below.

                                                ^^^^^^^^^^^
appropriate


uint/uvec is ES 300.


The non-1D types should be 300 for ES, and the 1D types should be 999 
for ES.


_______________________________________________
mesa-dev mailing list
mesa-dev&amp;lt; at &amp;gt;lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev
&lt;/pre&gt;</description>
    <dc:creator>Ian Romanick</dc:creator>
    <dc:date>2013-06-19T07:42:13</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59353">
    <title>[PATCH] llvmpipe: handle more queries</title>
    <link>http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59353</link>
    <description>&lt;pre&gt;From: Roland Scheidegger &amp;lt;sroland&amp;lt; at &amp;gt;vmware.com&amp;gt;

Handle PIPE_QUERY_GPU_FINISHED and PIPE_QUERY_TIMESTAMP_DISJOINT, and
also fill out the ps_invocations and c_primitives from the
PIPE_QUERY_PIPELINE_STATISTICS (the others in there should already
be handled). Note that ps_invocations isn't pixel exact, just 16 pixel
exact but I guess it's better than nothing.
Doesn't really seem to work correctly but there's probably bugs elsewhere.
Also use a 64bit counter for occlusion queries.
---
 src/gallium/drivers/llvmpipe/lp_bld_depth.c   |   11 ++++++++---
 src/gallium/drivers/llvmpipe/lp_jit.c         |    2 +-
 src/gallium/drivers/llvmpipe/lp_jit.h         |    2 +-
 src/gallium/drivers/llvmpipe/lp_query.c       |   23 ++++++++++++++++++++---
 src/gallium/drivers/llvmpipe/lp_rast.c        |   19 ++++++++++++++++---
 src/gallium/drivers/llvmpipe/lp_rast_priv.h   |    6 +++++-
 src/gallium/drivers/llvmpipe/lp_setup.c       |    4 ++--
 src/gallium/drivers/llvmpipe/lp_setup_line.c  |   13 ++++++++-----
 src/gallium/drivers/llvmpipe/lp_setup_point.c |   10 +++++++++-
 src/gallium/drivers/llvmpipe/lp_setup_tri.c   |    8 ++++++++
 10 files changed, 78 insertions(+), 20 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_bld_depth.c b/src/gallium/drivers/llvmpipe/lp_bld_depth.c
index edb59cc..79891cf 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_depth.c
+++ b/src/gallium/drivers/llvmpipe/lp_bld_depth.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -429,7 +429,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; get_s_shift_and_mask(const struct util_format_description *format_desc,
  * Test the depth mask. Add the number of channel which has none zero mask
  * into the occlusion counter. e.g. maskvalue is {-1, -1, -1, -1}.
  * The counter will add 4.
- * TODO: could get that out of the loop, and need to use 64bit counter.
+ * TODO: could get that out of the fs loop.
  *
  * \param type holds element type of the mask vector.
  * \param maskvalue is the depth test mask.
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -458,6 +458,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; lp_build_occlusion_count(struct gallivm_state *gallivm,
                                       LLVMInt32TypeInContext(context), bits);
       count = lp_build_intrinsic_unary(builder, popcntintr,
                                        LLVMInt32TypeInContext(context), bits);
+      count = LLVMBuildZExt(builder, count, LLVMIntTypeInContext(context, 64), "");
    }
    else if(util_cpu_caps.has_avx &amp;amp;&amp;amp; type.length == 8) {
       const char *movmskintr = "llvm.x86.avx.movmsk.ps.256";
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -468,6 +469,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; lp_build_occlusion_count(struct gallivm_state *gallivm,
                                       LLVMInt32TypeInContext(context), bits);
       count = lp_build_intrinsic_unary(builder, popcntintr,
                                        LLVMInt32TypeInContext(context), bits);
+      count = LLVMBuildZExt(builder, count, LLVMIntTypeInContext(context, 64), "");
    }
    else {
       unsigned i;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -510,8 +512,11 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; lp_build_occlusion_count(struct gallivm_state *gallivm,
        }
        count = lp_build_intrinsic_unary(builder, popcntintr, counttype, countd);
 
-       if (type.length &amp;gt; 4) {
-          count = LLVMBuildTrunc(builder, count, LLVMIntTypeInContext(context, 32), "");
+       if (type.length &amp;gt; 8) {
+          count = LLVMBuildTrunc(builder, count, LLVMIntTypeInContext(context, 64), "");
+       }
+       else if (type.length &amp;lt; 8) {
+          count = LLVMBuildZExt(builder, count, LLVMIntTypeInContext(context, 64), "");
        }
    }
    newcount = LLVMBuildLoad(builder, counter, "origcount");
diff --git a/src/gallium/drivers/llvmpipe/lp_jit.c b/src/gallium/drivers/llvmpipe/lp_jit.c
index f517b67..fa0f128 100644
--- a/src/gallium/drivers/llvmpipe/lp_jit.c
+++ b/src/gallium/drivers/llvmpipe/lp_jit.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -195,7 +195,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; lp_jit_create_types(struct lp_fragment_shader_variant *lp)
       LLVMTypeRef elem_types[LP_JIT_THREAD_DATA_COUNT];
       LLVMTypeRef thread_data_type;
 
-      elem_types[LP_JIT_THREAD_DATA_COUNTER] = LLVMInt32TypeInContext(lc);
+      elem_types[LP_JIT_THREAD_DATA_COUNTER] = LLVMInt64TypeInContext(lc);
 
       thread_data_type = LLVMStructTypeInContext(lc, elem_types,
                                                  Elements(elem_types), 0);
diff --git a/src/gallium/drivers/llvmpipe/lp_jit.h b/src/gallium/drivers/llvmpipe/lp_jit.h
index 2ecfde7..30cfaae 100644
--- a/src/gallium/drivers/llvmpipe/lp_jit.h
+++ b/src/gallium/drivers/llvmpipe/lp_jit.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -164,7 +164,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; enum {
 
 struct lp_jit_thread_data
 {
-   uint32_t vis_counter;
+   uint64_t vis_counter;
 };
 
 
diff --git a/src/gallium/drivers/llvmpipe/lp_query.c b/src/gallium/drivers/llvmpipe/lp_query.c
index 922913d..7fbf5f7 100644
--- a/src/gallium/drivers/llvmpipe/lp_query.c
+++ b/src/gallium/drivers/llvmpipe/lp_query.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -40,6 +40,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include "lp_query.h"
 #include "lp_screen.h"
 #include "lp_state.h"
+#include "lp_rast.h"
 
 
 static struct llvmpipe_query *llvmpipe_query( struct pipe_query *p )
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -128,7 +129,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; llvmpipe_get_query_result(struct pipe_context *pipe,
    case PIPE_QUERY_OCCLUSION_PREDICATE:
       for (i = 0; i &amp;lt; num_threads; i++) {
          /* safer (still not guaranteed) when there's an overflow */
-         *result = *result || pq-&amp;gt;count[i];
+         vresult-&amp;gt;b = vresult-&amp;gt;b || pq-&amp;gt;count[i];
       }
       break;
    case PIPE_QUERY_TIMESTAMP:
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -140,6 +141,17 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; llvmpipe_get_query_result(struct pipe_context *pipe,
             *result = os_time_get_nano();
       }
       break;
+   case PIPE_QUERY_TIMESTAMP_DISJOINT: {
+      struct pipe_query_data_timestamp_disjoint *td =
+         (struct pipe_query_data_timestamp_disjoint *)vresult;
+      /* os_get_time_nano return nanoseconds, but we sum all threads */
+      td-&amp;gt;frequency = UINT64_C(1000000000) * num_threads;
+      td-&amp;gt;disjoint = FALSE;
+   }
+      break;
+   case PIPE_QUERY_GPU_FINISHED:
+      vresult-&amp;gt;b = TRUE;
+      break;
    case PIPE_QUERY_PRIMITIVES_GENERATED:
       *result = pq-&amp;gt;num_primitives_generated;
       break;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -147,7 +159,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; llvmpipe_get_query_result(struct pipe_context *pipe,
       *result = pq-&amp;gt;num_primitives_written;
       break;
    case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
-      *result = pq-&amp;gt;so_has_overflown;
+      vresult-&amp;gt;b = pq-&amp;gt;so_has_overflown;
       break;
    case PIPE_QUERY_SO_STATISTICS: {
       struct pipe_query_data_so_statistics *stats =
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -159,8 +171,13 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; llvmpipe_get_query_result(struct pipe_context *pipe,
    case PIPE_QUERY_PIPELINE_STATISTICS: {
       struct pipe_query_data_pipeline_statistics *stats =
          (struct pipe_query_data_pipeline_statistics *)vresult;
+      /* only ps_invocations come from binned query */
+      for (i = 0; i &amp;lt; num_threads; i++) {
+         pq-&amp;gt;stats.ps_invocations += pq-&amp;gt;count[i];
+      }
+      pq-&amp;gt;stats.ps_invocations *= LP_RASTER_BLOCK_SIZE * LP_RASTER_BLOCK_SIZE;
       *stats = pq-&amp;gt;stats;
-   }
+    }
       break;
    default:
       assert(0);
diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c
index d802d53..62a82e3 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast.c
+++ b/src/gallium/drivers/llvmpipe/lp_rast.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -455,6 +455,10 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; lp_rast_shade_quads_mask(struct lp_rasterizer_task *task,
     * allocated 4x4 blocks hence need to filter them out here.
     */
    if ((x % TILE_SIZE) &amp;lt; task-&amp;gt;width &amp;amp;&amp;amp; (y % TILE_SIZE) &amp;lt; task-&amp;gt;height) {
+      if (task-&amp;gt;query[PIPE_QUERY_PIPELINE_STATISTICS]) {
+         /* not very accurate would need a popcount on the mask */
+         task-&amp;gt;ps_invocations++;
+      }
       /* run shader on 4x4 block */
       BEGIN_JIT_CALL(state, task);
       variant-&amp;gt;jit_function[RAST_EDGE_TEST](&amp;amp;state-&amp;gt;jit_context,
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -493,11 +497,14 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; lp_rast_begin_query(struct lp_rasterizer_task *task,
    case PIPE_QUERY_OCCLUSION_PREDICATE:
       task-&amp;gt;thread_data.vis_counter = 0;
       break;
+   case PIPE_QUERY_PIPELINE_STATISTICS:
+      task-&amp;gt;ps_invocations = 0;
+      break;
    case PIPE_QUERY_PRIMITIVES_GENERATED:
    case PIPE_QUERY_PRIMITIVES_EMITTED:
    case PIPE_QUERY_SO_STATISTICS:
-   case PIPE_QUERY_PIPELINE_STATISTICS:
    case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
+   case PIPE_QUERY_TIMESTAMP_DISJOINT:
       break;
    default:
       assert(0);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -518,7 +525,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; lp_rast_end_query(struct lp_rasterizer_task *task,
                   const union lp_rast_cmd_arg arg)
 {
    struct llvmpipe_query *pq = arg.query_obj;
-   assert(task-&amp;gt;query[pq-&amp;gt;type] == pq || pq-&amp;gt;type == PIPE_QUERY_TIMESTAMP);
+   assert(task-&amp;gt;query[pq-&amp;gt;type] == pq ||
+          pq-&amp;gt;type == PIPE_QUERY_TIMESTAMP ||
+          pq-&amp;gt;type == PIPE_QUERY_GPU_FINISHED);
 
    switch (pq-&amp;gt;type) {
    case PIPE_QUERY_OCCLUSION_COUNTER:
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -528,11 +537,15 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; lp_rast_end_query(struct lp_rasterizer_task *task,
    case PIPE_QUERY_TIMESTAMP:
       pq-&amp;gt;count[task-&amp;gt;thread_index] = os_time_get_nano();
       break;
+   case PIPE_QUERY_PIPELINE_STATISTICS:
+      pq-&amp;gt;count[task-&amp;gt;thread_index] += task-&amp;gt;ps_invocations;
+      break;
    case PIPE_QUERY_PRIMITIVES_GENERATED:
    case PIPE_QUERY_PRIMITIVES_EMITTED:
    case PIPE_QUERY_SO_STATISTICS:
-   case PIPE_QUERY_PIPELINE_STATISTICS:
    case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
+   case PIPE_QUERY_TIMESTAMP_DISJOINT:
+   case PIPE_QUERY_GPU_FINISHED:
       break;
    default:
       assert(0);
diff --git a/src/gallium/drivers/llvmpipe/lp_rast_priv.h b/src/gallium/drivers/llvmpipe/lp_rast_priv.h
index 6f03023..3048940 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast_priv.h
+++ b/src/gallium/drivers/llvmpipe/lp_rast_priv.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -99,8 +99,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; struct lp_rasterizer_task
 
    /* occlude counter for visible pixels */
    struct lp_jit_thread_data thread_data;
-   uint64_t query_start;
    struct llvmpipe_query *query[PIPE_QUERY_TYPES];
+   uint64_t ps_invocations;
 
    pipe_semaphore work_ready;
    pipe_semaphore work_done;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -307,6 +307,10 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; lp_rast_shade_quads_all( struct lp_rasterizer_task *task,
     * allocated 4x4 blocks hence need to filter them out here.
     */
    if ((x % TILE_SIZE) &amp;lt; task-&amp;gt;width &amp;amp;&amp;amp; (y % TILE_SIZE) &amp;lt; task-&amp;gt;height) {
+      if (task-&amp;gt;query[PIPE_QUERY_PIPELINE_STATISTICS]) {
+         /* not very accurate would need a popcount on the mask */
+         task-&amp;gt;ps_invocations++;
+      }
       /* run shader on 4x4 block */
       BEGIN_JIT_CALL(state, task);
       variant-&amp;gt;jit_function[RAST_WHOLE]( &amp;amp;state-&amp;gt;jit_context,
diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c
index e2fb257..6b64446 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1215,7 +1215,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; lp_setup_begin_query(struct lp_setup_context *setup,
    assert(setup-&amp;gt;active_query[pq-&amp;gt;type] == NULL);
 
    set_scene_state(setup, SETUP_ACTIVE, "begin_query");
-   
+
    setup-&amp;gt;active_query[pq-&amp;gt;type] = pq;
 
    /* XXX: It is possible that a query is created before the scene
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1249,7 +1249,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; lp_setup_end_query(struct lp_setup_context *setup, struct llvmpipe_query *pq)
 {
    set_scene_state(setup, SETUP_ACTIVE, "end_query");
 
-   if (pq-&amp;gt;type != PIPE_QUERY_TIMESTAMP) {
+   if (pq-&amp;gt;type != PIPE_QUERY_TIMESTAMP &amp;amp;&amp;amp; pq-&amp;gt;type != PIPE_QUERY_GPU_FINISHED) {
       assert(setup-&amp;gt;active_query[pq-&amp;gt;type] == pq);
       setup-&amp;gt;active_query[pq-&amp;gt;type] = NULL;
    }
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_line.c b/src/gallium/drivers/llvmpipe/lp_setup_line.c
index a9809a0..4b59bf3 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_line.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup_line.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -36,6 +36,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include "lp_rast.h"
 #include "lp_state_fs.h"
 #include "lp_state_setup.h"
+#include "lp_context.h"
 
 #define NUM_CHANNELS 4
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -541,11 +542,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; try_setup_line( struct lp_setup_context *setup,
       y[3] = subpixel_snap(v1[0][1] + y_offset     - setup-&amp;gt;pixel_offset);
    }
 
-
-
-   LP_COUNT(nr_tris);
-
- 
    /* Bounding rectangle (in pixels) */
    {
       /* Yes this is necessary to accurately calculate bounding boxes
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -598,6 +594,13 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; try_setup_line( struct lp_setup_context *setup,
    line-&amp;gt;v[1][1] = v2[0][1];
 #endif
 
+   LP_COUNT(nr_tris);
+
+   if (setup-&amp;gt;active_query[PIPE_QUERY_PIPELINE_STATISTICS]) {
+      struct llvmpipe_context *lp_context = (struct llvmpipe_context *)setup-&amp;gt;pipe;
+      lp_context-&amp;gt;pipeline_statistics.c_primitives++;
+   }
+
    /* calculate the deltas */
    plane = GET_PLANES(line);
    plane[0].dcdy = x[0] - x[1];
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_point.c b/src/gallium/drivers/llvmpipe/lp_setup_point.c
index 789caa8..7fe7bc5 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_point.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup_point.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -29,13 +29,14 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
  * Binning code for points
  */
 
-#include "lp_setup_context.h"
 #include "util/u_math.h"
 #include "util/u_memory.h"
+#include "lp_setup_context.h"
 #include "lp_perf.h"
 #include "lp_rast.h"
 #include "lp_state_fs.h"
 #include "lp_state_setup.h"
+#include "lp_context.h"
 #include "tgsi/tgsi_scan.h"
 
 #define NUM_CHANNELS 4
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -376,6 +377,13 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; try_setup_point( struct lp_setup_context *setup,
    point-&amp;gt;v[0][1] = v0[0][1];
 #endif
 
+   LP_COUNT(nr_tris);
+
+   if (setup-&amp;gt;active_query[PIPE_QUERY_PIPELINE_STATISTICS]) {
+      struct llvmpipe_context *lp_context = (struct llvmpipe_context *)setup-&amp;gt;pipe;
+      lp_context-&amp;gt;pipeline_statistics.c_primitives++;
+   }
+
    info.v0 = v0;
    info.dx01 = 0;
    info.dx12 = fixed_width;
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_tri.c b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
index 2ca47bc..bedd16b 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_tri.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -38,6 +38,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include "lp_rast.h"
 #include "lp_state_fs.h"
 #include "lp_state_setup.h"
+#include "lp_context.h"
 
 #define NUM_CHANNELS 4
 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -333,6 +334,11 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; do_triangle_ccw(struct lp_setup_context *setup,
 
    LP_COUNT(nr_tris);
 
+   if (setup-&amp;gt;active_query[PIPE_QUERY_PIPELINE_STATISTICS]) {
+      struct llvmpipe_context *lp_context = (struct llvmpipe_context *)setup-&amp;gt;pipe;
+      lp_context-&amp;gt;pipeline_statistics.c_primitives++;
+   }
+
    /* Setup parameter interpolants:
     */
    setup-&amp;gt;setup.variant-&amp;gt;jit_function( v0,
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -883,6 +889,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; typedef void (*triangle_func_t)(struct lp_setup_context *setup,
 /**
  * Subdivide this triangle by bisecting edge (v0, v1).
  * \param pv  the provoking vertex (must = v0 or v1 or v2)
+ * TODO: should probably think about non-overflowing arithmetic elsewhere.
+ * This will definitely screw with pipeline counters for instance.
  */
 static void
 subdiv_tri(struct lp_setup_context *setup,
&lt;/pre&gt;</description>
    <dc:creator>sroland&lt; at &gt;vmware.com</dc:creator>
    <dc:date>2013-06-19T01:58:09</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59351">
    <title>[Bug 65910] Killing weston-launch causes segv indesktop-shell</title>
    <link>http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59351</link>
    <description>&lt;pre&gt;https://bugs.freedesktop.org/show_bug.cgi?id=65910

Joe Konno &amp;lt;joe.konno&amp;lt; at &amp;gt;linux.intel.com&amp;gt; changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |VERIFIED

--- Comment #5 from Joe Konno &amp;lt;joe.konno&amp;lt; at &amp;gt;linux.intel.com&amp;gt; ---
Thanks krh!

I can verify your fix corrects the reported issue, so I'm setting status to
"verified."

(In reply to comment #3)

&lt;/pre&gt;</description>
    <dc:creator>bugzilla-daemon&lt; at &gt;freedesktop.org</dc:creator>
    <dc:date>2013-06-18T22:28:53</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59350">
    <title>[Bug 65910] Killing weston-launch causes segv indesktop-shell</title>
    <link>http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59350</link>
    <description>&lt;pre&gt;https://bugs.freedesktop.org/show_bug.cgi?id=65910

Kristian Høgsberg &amp;lt;krh&amp;lt; at &amp;gt;bitplanet.net&amp;gt; changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|Other                       |EGL

--- Comment #4 from Kristian Høgsberg &amp;lt;krh&amp;lt; at &amp;gt;bitplanet.net&amp;gt; ---
(added EGL component for mesa, moved bug there)

&lt;/pre&gt;</description>
    <dc:creator>bugzilla-daemon&lt; at &gt;freedesktop.org</dc:creator>
    <dc:date>2013-06-18T21:52:00</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59349">
    <title>[Bug 65910] Killing weston-launch causes segv indesktop-shell</title>
    <link>http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59349</link>
    <description>&lt;pre&gt;https://bugs.freedesktop.org/show_bug.cgi?id=65910

Kristian Høgsberg &amp;lt;krh&amp;lt; at &amp;gt;bitplanet.net&amp;gt; changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
           Assignee|wayland-bugs&amp;lt; at &amp;gt;lists.freedesk |mesa-dev&amp;lt; at &amp;gt;lists.freedesktop.
                   |top.org                     |org
            Product|Wayland                     |Mesa
            Version|unspecified                 |git
          Component|weston                      |Other

--- Comment #3 from Kristian Høgsberg &amp;lt;krh&amp;lt; at &amp;gt;bitplanet.net&amp;gt; ---
This was a mesa bug:

commit 712269d6744a8849d1d0cf01fa0132d969b79ed4
Author: Kristian Høgsberg &amp;lt;krh&amp;lt; at &amp;gt;bitplanet.net&amp;gt;
Date:   Tue Jun 18 16:53:46 2013 -0400

    wayland: Handle global_remove event as well

    We need to set up a handler for the global_remove event that gets sent
    out when a global gets removed.  Without the handler we end up calling
    a NULL pointer.

    https://bugs.freedesktop.org/show_bug.cgi?id=65910

    NOTE: This is a candidate for the stable branches.

    Signed-off-by: Kristian Høgsberg &amp;lt;krh&amp;lt; at &amp;gt;bitplanet.net&amp;gt;

&lt;/pre&gt;</description>
    <dc:creator>bugzilla-daemon&lt; at &gt;freedesktop.org</dc:creator>
    <dc:date>2013-06-18T21:48:03</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59347">
    <title>[PATCH 2/2] softpipe: handle all queries,and change for the new disjoint semantics</title>
    <link>http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59347</link>
    <description>&lt;pre&gt;From: Roland Scheidegger &amp;lt;sroland&amp;lt; at &amp;gt;vmware.com&amp;gt;

The driver can do render_condition but wasn't handling the occlusion
and so_overflow predicates (though the latter might not work yet due
to gs support).
---
 src/gallium/drivers/softpipe/sp_query.c |   39 ++++++++++++++++++++++---------
 1 file changed, 28 insertions(+), 11 deletions(-)

diff --git a/src/gallium/drivers/softpipe/sp_query.c b/src/gallium/drivers/softpipe/sp_query.c
index b5bc0db..daeef53 100644
--- a/src/gallium/drivers/softpipe/sp_query.c
+++ b/src/gallium/drivers/softpipe/sp_query.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -60,8 +60,10 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; softpipe_create_query(struct pipe_context *pipe,
    struct softpipe_query* sq;
 
    assert(type == PIPE_QUERY_OCCLUSION_COUNTER ||
+          type == PIPE_QUERY_OCCLUSION_PREDICATE ||
           type == PIPE_QUERY_TIME_ELAPSED ||
           type == PIPE_QUERY_SO_STATISTICS ||
+          type == PIPE_QUERY_SO_OVERFLOW_PREDICATE ||
           type == PIPE_QUERY_PRIMITIVES_EMITTED ||
           type == PIPE_QUERY_PRIMITIVES_GENERATED || 
           type == PIPE_QUERY_PIPELINE_STATISTICS ||
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -90,9 +92,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; softpipe_begin_query(struct pipe_context *pipe, struct pipe_query *q)
 
    switch (sq-&amp;gt;type) {
    case PIPE_QUERY_OCCLUSION_COUNTER:
+   case PIPE_QUERY_OCCLUSION_PREDICATE:
       sq-&amp;gt;start = softpipe-&amp;gt;occlusion_count;
       break;
-   case PIPE_QUERY_TIMESTAMP_DISJOINT:
    case PIPE_QUERY_TIME_ELAPSED:
       sq-&amp;gt;start = os_time_get_nano();
       break;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -102,6 +104,10 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; softpipe_begin_query(struct pipe_context *pipe, struct pipe_query *q)
       softpipe-&amp;gt;num_primitives_generated = 0;
       sq-&amp;gt;so.num_primitives_written = 0;
       softpipe-&amp;gt;so_stats.num_primitives_written = 0;
+      break;
+   case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
+      sq-&amp;gt;end = FALSE;
+      break;
    case PIPE_QUERY_PRIMITIVES_EMITTED:
       sq-&amp;gt;so.num_primitives_written = 0;
       softpipe-&amp;gt;so_stats.num_primitives_written = 0;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -112,6 +118,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; softpipe_begin_query(struct pipe_context *pipe, struct pipe_query *q)
       break;
    case PIPE_QUERY_TIMESTAMP:
    case PIPE_QUERY_GPU_FINISHED:
+   case PIPE_QUERY_TIMESTAMP_DISJOINT:
       break;
    case PIPE_QUERY_PIPELINE_STATISTICS:
       /* reset our cache */
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -141,15 +148,19 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; softpipe_end_query(struct pipe_context *pipe, struct pipe_query *q)
    softpipe-&amp;gt;active_query_count--;
    switch (sq-&amp;gt;type) {
    case PIPE_QUERY_OCCLUSION_COUNTER:
+   case PIPE_QUERY_OCCLUSION_PREDICATE:
       sq-&amp;gt;end = softpipe-&amp;gt;occlusion_count;
       break;
    case PIPE_QUERY_TIMESTAMP:
       sq-&amp;gt;start = 0;
       /* fall through */
-   case PIPE_QUERY_TIMESTAMP_DISJOINT:
    case PIPE_QUERY_TIME_ELAPSED:
       sq-&amp;gt;end = os_time_get_nano();
       break;
+   case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
+      sq-&amp;gt;end = (softpipe-&amp;gt;num_primitives_generated &amp;gt;
+                 softpipe-&amp;gt;so_stats.num_primitives_written);
+      break;
    case PIPE_QUERY_SO_STATISTICS:
       sq-&amp;gt;num_primitives_generated =
          softpipe-&amp;gt;num_primitives_generated;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -164,6 +175,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; softpipe_end_query(struct pipe_context *pipe, struct pipe_query *q)
       sq-&amp;gt;num_primitives_generated = softpipe-&amp;gt;num_primitives_generated;
       break;
    case PIPE_QUERY_GPU_FINISHED:
+   case PIPE_QUERY_TIMESTAMP_DISJOINT:
       break;
    case PIPE_QUERY_PIPELINE_STATISTICS:
       sq-&amp;gt;stats.ia_vertices =
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -195,9 +207,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; softpipe_end_query(struct pipe_context *pipe, struct pipe_query *q)
 
 static boolean
 softpipe_get_query_result(struct pipe_context *pipe, 
-  struct pipe_query *q,
-  boolean wait,
-  union pipe_query_result *vresult)
+                          struct pipe_query *q,
+                          boolean wait,
+                          union pipe_query_result *vresult)
 {
    struct softpipe_query *sq = softpipe_query(q);
    uint64_t *result = (uint64_t*)vresult;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -215,15 +227,17 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; softpipe_get_query_result(struct pipe_context *pipe,
              sizeof(struct pipe_query_data_pipeline_statistics));;
       break;
    case PIPE_QUERY_GPU_FINISHED:
-      *result = TRUE;
+      vresult-&amp;gt;b = TRUE;
+      break;
+   case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
+      vresult-&amp;gt;b = sq-&amp;gt;end != 0;
       break;
    case PIPE_QUERY_TIMESTAMP_DISJOINT: {
-      struct pipe_query_data_timestamp_disjoint td;
+      struct pipe_query_data_timestamp_disjoint *td =
+          (struct pipe_query_data_timestamp_disjoint *)vresult;
       /* os_get_time_nano return nanoseconds */
-      td.frequency = UINT64_C(1000000000);
-      td.disjoint = sq-&amp;gt;end != sq-&amp;gt;start;
-      memcpy(vresult, &amp;amp;td,
-             sizeof(struct pipe_query_data_timestamp_disjoint));
+      td-&amp;gt;frequency = UINT64_C(1000000000);
+      td-&amp;gt;disjoint = FALSE;
    }
       break;
    case PIPE_QUERY_PRIMITIVES_EMITTED:
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -232,6 +246,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; softpipe_get_query_result(struct pipe_context *pipe,
    case PIPE_QUERY_PRIMITIVES_GENERATED:
       *result = sq-&amp;gt;num_primitives_generated;
       break;
+   case PIPE_QUERY_OCCLUSION_PREDICATE:
+      vresult-&amp;gt;b = sq-&amp;gt;end - sq-&amp;gt;start != 0;
+      break;
    default:
       *result = sq-&amp;gt;end - sq-&amp;gt;start;
       break;
&lt;/pre&gt;</description>
    <dc:creator>sroland&lt; at &gt;vmware.com</dc:creator>
    <dc:date>2013-06-18T21:28:44</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59346">
    <title>[PATCH 1/2] gallium: fix PIPE_QUERY_TIMESTAMP_DISJOINT</title>
    <link>http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59346</link>
    <description>&lt;pre&gt;From: Roland Scheidegger &amp;lt;sroland&amp;lt; at &amp;gt;vmware.com&amp;gt;

The semantics didn't really make sense, not really matching neither d3d9
(though the docs are all broken there) nor d3d10. So make it match d3d10
semantics, which actually gives meaning to the "disjoint" part.
Drivers are fixed up in a very primitive way, I have no idea what could
actually cause the counter to become unreliable so just always return
FALSE for the disjoint part.
---
 src/gallium/docs/source/context.rst   |   10 ++++++----
 src/gallium/drivers/nv50/nv50_query.c |    5 +++--
 src/gallium/drivers/nvc0/nvc0_query.c |    4 +---
 3 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/src/gallium/docs/source/context.rst b/src/gallium/docs/source/context.rst
index ede89be..bfd58a4 100644
--- a/src/gallium/docs/source/context.rst
+++ b/src/gallium/docs/source/context.rst
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -330,11 +330,13 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; scaled to nanoseconds, recorded after all commands issued prior to
 This query does not require a call to ``begin_query``.
 The result is an unsigned 64-bit integer.
 
-``PIPE_QUERY_TIMESTAMP_DISJOINT`` can be used to check whether the
-internal timer resolution is good enough to distinguish between the
-events at ``begin_query`` and ``end_query``.
+``PIPE_QUERY_TIMESTAMP_DISJOINT`` can be used to check the
+internal timer resolution and whether the timestamp counter has become
+unreliable due to things like throttling etc. - only if this is FALSE
+a timestamp query (within the timestamp_disjoint query) should be trusted.
 The result is a 64-bit integer specifying the timer resolution in Hz,
-followed by a boolean value indicating whether the timer has incremented.
+followed by a boolean value indicating whether the timestamp counter
+is discontinuous or disjoint.
 
 ``PIPE_QUERY_PRIMITIVES_GENERATED`` returns a 64-bit integer indicating
 the number of primitives processed by the pipeline (regardless of whether
diff --git a/src/gallium/drivers/nv50/nv50_query.c b/src/gallium/drivers/nv50/nv50_query.c
index 656ff9d..b97eff2 100644
--- a/src/gallium/drivers/nv50/nv50_query.c
+++ b/src/gallium/drivers/nv50/nv50_query.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -181,7 +181,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; nv50_query_begin(struct pipe_context *pipe, struct pipe_query *pq)
       nv50_query_get(push, q, 0x20, 0x05805002);
       nv50_query_get(push, q, 0x30, 0x06805002);
       break;
-   case PIPE_QUERY_TIMESTAMP_DISJOINT:
    case PIPE_QUERY_TIME_ELAPSED:
       nv50_query_get(push, q, 0x10, 0x00005002);
       break;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -229,6 +228,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; nv50_query_end(struct pipe_context *pipe, struct pipe_query *pq)
    case NVA0_QUERY_STREAM_OUTPUT_BUFFER_OFFSET:
       nv50_query_get(push, q, 0, 0x0d005002 | (q-&amp;gt;index &amp;lt;&amp;lt; 5));
       break;
+   case PIPE_QUERY_TIMESTAMP_DISJOINT:
+      break;
    default:
       assert(0);
       break;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -289,7 +290,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; nv50_query_result(struct pipe_context *pipe, struct pipe_query *pq,
       break;
    case PIPE_QUERY_TIMESTAMP_DISJOINT: /* u32 sequence, u32 0, u64 time */
       res64[0] = 1000000000;
-      res8[8] = (data64[1] == data64[3]) ? FALSE : TRUE;
+      res8[8] = FALSE;
       break;
    case PIPE_QUERY_TIME_ELAPSED:
       res64[0] = data64[1] - data64[3];
diff --git a/src/gallium/drivers/nvc0/nvc0_query.c b/src/gallium/drivers/nvc0/nvc0_query.c
index 8e584c9..3f5a9fb 100644
--- a/src/gallium/drivers/nvc0/nvc0_query.c
+++ b/src/gallium/drivers/nvc0/nvc0_query.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -285,7 +285,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; nvc0_query_begin(struct pipe_context *pipe, struct pipe_query *pq)
    case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
       nvc0_query_get(push, q, 0x10, 0x03005002 | (q-&amp;gt;index &amp;lt;&amp;lt; 5));
       break;
-   case PIPE_QUERY_TIMESTAMP_DISJOINT:
    case PIPE_QUERY_TIME_ELAPSED:
       nvc0_query_get(push, q, 0x10, 0x00005002);
       break;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -360,7 +359,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; nvc0_query_end(struct pipe_context *pipe, struct pipe_query *pq)
       nvc0_query_get(push, q, 0x20, 0x00005002);
       break;
    case PIPE_QUERY_TIMESTAMP:
-   case PIPE_QUERY_TIMESTAMP_DISJOINT:
    case PIPE_QUERY_TIME_ELAPSED:
       nvc0_query_get(push, q, 0, 0x00005002);
       break;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -478,7 +476,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; nvc0_query_result(struct pipe_context *pipe, struct pipe_query *pq,
       break;
    case PIPE_QUERY_TIMESTAMP_DISJOINT: /* u32 sequence, u32 0, u64 time */
       res64[0] = 1000000000;
-      res8[8] = (data64[1] == data64[3]) ? FALSE : TRUE;
+      res8[8] = FALSE;
       break;
    case PIPE_QUERY_TIME_ELAPSED:
       res64[0] = data64[1] - data64[3];
&lt;/pre&gt;</description>
    <dc:creator>sroland&lt; at &gt;vmware.com</dc:creator>
    <dc:date>2013-06-18T21:28:43</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59345">
    <title>[Bug 65898] Low(er) FPS in Half-Life 2 on Arch Linux</title>
    <link>http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59345</link>
    <description>&lt;pre&gt;https://bugs.freedesktop.org/show_bug.cgi?id=65898

--- Comment #3 from Chris Forbes &amp;lt;chrisf&amp;lt; at &amp;gt;ijw.co.nz&amp;gt; ---

If that's correct, you probably want to get rid of it.

&lt;/pre&gt;</description>
    <dc:creator>bugzilla-daemon&lt; at &gt;freedesktop.org</dc:creator>
    <dc:date>2013-06-18T20:21:44</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59344">
    <title>Re: [PATCH] gen7: fix GPU hang on WebGL texture-size test</title>
    <link>http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59344</link>
    <description>&lt;pre&gt;

There's this really twitchy code for guessing an appropriate first_level
based on various GL state set at the moment you glTexImage() (or similar
calls, such as those baked into GenerateMipmaps()).  I found a field in
i915's HW state that I think I'd missed before when I tried to rip this
crap out, and there's a similar one in 855+, so I think I can go kill
it.

I think a test that would have broken would be: gen the texture, set the
base level to &amp;gt;0, set the filters to NEAREST, then TexImage(), then
render to that teximage using an FBO, then texture out of it to the
screen.
_______________________________________________
mesa-dev mailing list
mesa-dev&amp;lt; at &amp;gt;lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev
&lt;/pre&gt;</description>
    <dc:creator>Eric Anholt</dc:creator>
    <dc:date>2013-06-18T20:13:15</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59343">
    <title>Re: [PATCH 4/6] mesa: Use shared code for converting shader targets to short strings.</title>
    <link>http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59343</link>
    <description>&lt;pre&gt;
Yeah, I agree - it's not obvious which are the MESA_SHADER_VERTEX enums 
and which are the GL_VERTEX_SHADER enums.  I do like how you handle both 
GL enums in this function.

I think this is sensible and we can tidy up the enums in the future.
&lt;/pre&gt;</description>
    <dc:creator>Kenneth Graunke</dc:creator>
    <dc:date>2013-06-18T19:43:26</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59342">
    <title>[Bug 65898] Low(er) FPS in Half-Life 2 on Arch Linux</title>
    <link>http://permalink.gmane.org/gmane.comp.video.mesa3d.devel/59342</link>
    <description>&lt;pre&gt;https://bugs.freedesktop.org/show_bug.cgi?id=65898

--- Comment #2 from Eric Anholt &amp;lt;eric&amp;lt; at &amp;gt;anholt.net&amp;gt; ---
If you're interested in investigating on your own, there is information at
http://dri.freedesktop.org/wiki/IntelPerformanceTuning/ for how we go about
investigating things.  There is also a TODO list of likely things at
http://dri.freedesktop.org/wiki/I965Todo/

&lt;/pre&gt;</description>
    <dc:creator>bugzilla-daemon&lt; at &gt;freedesktop.org</dc:creator>
    <dc:date>2013-06-18T19:22:40</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.video.mesa3d.devel">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.video.mesa3d.devel</link>
  </textinput>
</rdf:RDF>
