mesa: Branch 'index-swtnl-0.1' - 3 commits
Keith Whitwell
keithw at kemper.freedesktop.org
Mon Mar 19 09:39:32 UTC 2007
src/mesa/drivers/dri/i915tex/i915_cache.c | 6 +
src/mesa/drivers/dri/i915tex/i915_fpc_debug.c | 78 +++++++++++-----------
src/mesa/drivers/dri/i915tex/i915_state_program.c | 3
src/mesa/drivers/dri/i915tex/i915_vtbl.c | 5 +
src/mesa/drivers/dri/i915tex/intel_batchbuffer.c | 17 +++-
src/mesa/drivers/dri/i915tex/intel_context.h | 1
6 files changed, 66 insertions(+), 44 deletions(-)
New commits:
diff-tree c8068c6d785d0975de782d15333e665122697f19 (from 5cda1f01a1a63da6b14edc23142f074fd41e65ff)
Author: Keith Whitwell <keith at tungstengraphics.com>
Date: Mon Mar 19 09:39:11 2007 +0000
add DEBUG_ALWAYS_SYNC option
diff --git a/src/mesa/drivers/dri/i915tex/i915_state_program.c b/src/mesa/drivers/dri/i915tex/i915_state_program.c
index 44d578d..6d070b4 100644
--- a/src/mesa/drivers/dri/i915tex/i915_state_program.c
+++ b/src/mesa/drivers/dri/i915tex/i915_state_program.c
@@ -55,6 +55,9 @@ static void upload_program( struct intel
/* As the compiled program depends only on the original program
* text, just store the compiled version in the fragment program
* struct.
+ *
+ * Could do the same with the indirect offset & avoid the need for
+ * hashing & caching the generated program.
*/
if (!fp->translated) {
i915_compile_fragment_program(i915, fp);
diff --git a/src/mesa/drivers/dri/i915tex/intel_batchbuffer.c b/src/mesa/drivers/dri/i915tex/intel_batchbuffer.c
index 662aa14..0dbb0d3 100644
--- a/src/mesa/drivers/dri/i915tex/intel_batchbuffer.c
+++ b/src/mesa/drivers/dri/i915tex/intel_batchbuffer.c
@@ -84,11 +84,8 @@ static void dump(struct intel_context *i
assert(0);
return;
}
-
- for (j = 0; j < len; j++, i++)
- _mesa_printf("\t\t0x%08x\n", ptr[i]);
-
- _mesa_printf("\n");
+
+ i += len;
}
}
@@ -365,6 +362,16 @@ intel_batchbuffer_flush(struct intel_bat
/* Reset the buffer:
*/
intel_batchbuffer_reset(batch);
+
+
+ if (INTEL_DEBUG & DEBUG_ALWAYS_SYNC)
+ {
+ struct _DriFenceObject *fence = batch->last_fence;
+ driFenceReference(fence);
+ driFenceFinish(fence, 3, GL_FALSE);
+ driFenceUnReference(fence);
+ }
+
return batch->last_fence;
}
diff --git a/src/mesa/drivers/dri/i915tex/intel_context.h b/src/mesa/drivers/dri/i915tex/intel_context.h
index a3afffe..ac6dcf3 100644
--- a/src/mesa/drivers/dri/i915tex/intel_context.h
+++ b/src/mesa/drivers/dri/i915tex/intel_context.h
@@ -394,6 +394,7 @@ extern int INTEL_DEBUG;
#define DEBUG_LOCK 0x1000
#define DEBUG_IDX 0x2000
#define DEBUG_TRI 0x4000
+#define DEBUG_ALWAYS_SYNC 0x8000
#define DBG(...) do { if (INTEL_DEBUG & FILE_DEBUG_FLAG) _mesa_printf(__VA_ARGS__); } while(0)
diff-tree 5cda1f01a1a63da6b14edc23142f074fd41e65ff (from cb38064de93563f60e5d6c4f9b0e567da9dc36e6)
Author: Keith Whitwell <keith at tungstengraphics.com>
Date: Mon Mar 19 09:37:47 2007 +0000
clear state offsets, sizes after cache clear
diff --git a/src/mesa/drivers/dri/i915tex/i915_cache.c b/src/mesa/drivers/dri/i915tex/i915_cache.c
index 574e96a..f359576 100644
--- a/src/mesa/drivers/dri/i915tex/i915_cache.c
+++ b/src/mesa/drivers/dri/i915tex/i915_cache.c
@@ -321,8 +321,12 @@ void i915_clear_caches( struct i915_cach
{
GLint i;
- for (i = 0; i < I915_MAX_CACHE; i++)
+ for (i = 0; i < I915_MAX_CACHE; i++) {
clear_cache(&cctx->cache[i]);
+
+ cctx->i915->current.offsets[i] = 0;
+ cctx->i915->current.sizes[i] = 0;
+ }
}
diff-tree cb38064de93563f60e5d6c4f9b0e567da9dc36e6 (from c85a448e8a4e6e8db429cc6164de0f054f57a80e)
Author: Keith Whitwell <keith at tungstengraphics.com>
Date: Mon Mar 19 09:37:11 2007 +0000
improve program disassembly formatting, use _mesa_printf
diff --git a/src/mesa/drivers/dri/i915tex/i915_fpc_debug.c b/src/mesa/drivers/dri/i915tex/i915_fpc_debug.c
index 22a9342..3502a16 100644
--- a/src/mesa/drivers/dri/i915tex/i915_fpc_debug.c
+++ b/src/mesa/drivers/dri/i915tex/i915_fpc_debug.c
@@ -122,27 +122,27 @@ print_reg_type_nr(GLuint type, GLuint nr
case REG_TYPE_T:
switch (nr) {
case T_DIFFUSE:
- fprintf(stderr, "T_DIFFUSE");
+ _mesa_printf("T_DIFFUSE");
return;
case T_SPECULAR:
- fprintf(stderr, "T_SPECULAR");
+ _mesa_printf("T_SPECULAR");
return;
case T_FOG_W:
- fprintf(stderr, "T_FOG_W");
+ _mesa_printf("T_FOG_W");
return;
default:
- fprintf(stderr, "T_TEX%d", nr);
+ _mesa_printf("T_TEX%d", nr);
return;
}
case REG_TYPE_OC:
if (nr == 0) {
- fprintf(stderr, "oC");
+ _mesa_printf("oC");
return;
}
break;
case REG_TYPE_OD:
if (nr == 0) {
- fprintf(stderr, "oD");
+ _mesa_printf("oD");
return;
}
break;
@@ -150,7 +150,7 @@ print_reg_type_nr(GLuint type, GLuint nr
break;
}
- fprintf(stderr, "%s[%d]", regname[type], nr);
+ _mesa_printf("%s[%d]", regname[type], nr);
}
#define REG_SWIZZLE_MASK 0x7777
@@ -171,33 +171,33 @@ print_reg_neg_swizzle(GLuint reg)
(reg & REG_NEGATE_MASK) == 0)
return;
- fprintf(stderr, ".");
+ _mesa_printf(".");
for (i = 3; i >= 0; i--) {
if (reg & (1 << ((i * 4) + 3)))
- fprintf(stderr, "-");
+ _mesa_printf("-");
switch ((reg >> (i * 4)) & 0x7) {
case 0:
- fprintf(stderr, "x");
+ _mesa_printf("x");
break;
case 1:
- fprintf(stderr, "y");
+ _mesa_printf("y");
break;
case 2:
- fprintf(stderr, "z");
+ _mesa_printf("z");
break;
case 3:
- fprintf(stderr, "w");
+ _mesa_printf("w");
break;
case 4:
- fprintf(stderr, "0");
+ _mesa_printf("0");
break;
case 5:
- fprintf(stderr, "1");
+ _mesa_printf("1");
break;
default:
- fprintf(stderr, "?");
+ _mesa_printf("?");
break;
}
}
@@ -222,15 +222,15 @@ print_dest_reg(GLuint dword)
print_reg_type_nr(type, nr);
if ((dword & A0_DEST_CHANNEL_ALL) == A0_DEST_CHANNEL_ALL)
return;
- fprintf(stderr, ".");
+ _mesa_printf(".");
if (dword & A0_DEST_CHANNEL_X)
- fprintf(stderr, "x");
+ _mesa_printf("x");
if (dword & A0_DEST_CHANNEL_Y)
- fprintf(stderr, "y");
+ _mesa_printf("y");
if (dword & A0_DEST_CHANNEL_Z)
- fprintf(stderr, "z");
+ _mesa_printf("z");
if (dword & A0_DEST_CHANNEL_W)
- fprintf(stderr, "w");
+ _mesa_printf("w");
}
@@ -245,29 +245,29 @@ print_arith_op(GLuint opcode, const GLui
if (opcode != A0_NOP) {
print_dest_reg(program[0]);
if (program[0] & A0_DEST_SATURATE)
- fprintf(stderr, " = SATURATE ");
+ _mesa_printf(" = SATURATE ");
else
- fprintf(stderr, " = ");
+ _mesa_printf(" = ");
}
- fprintf(stderr, "%s ", opcodes[opcode]);
+ _mesa_printf("%s ", opcodes[opcode]);
print_src_reg(GET_SRC0_REG(program[0], program[1]));
if (args[opcode] == 1) {
- fprintf(stderr, "\n");
+ _mesa_printf("\n");
return;
}
- fprintf(stderr, ", ");
+ _mesa_printf(", ");
print_src_reg(GET_SRC1_REG(program[1], program[2]));
if (args[opcode] == 2) {
- fprintf(stderr, "\n");
+ _mesa_printf("\n");
return;
}
- fprintf(stderr, ", ");
+ _mesa_printf(", ");
print_src_reg(GET_SRC2_REG(program[2]));
- fprintf(stderr, "\n");
+ _mesa_printf("\n");
return;
}
@@ -276,24 +276,24 @@ static void
print_tex_op(GLuint opcode, const GLuint * program)
{
print_dest_reg(program[0] | A0_DEST_CHANNEL_ALL);
- fprintf(stderr, " = ");
+ _mesa_printf(" = ");
- fprintf(stderr, "%s ", opcodes[opcode]);
+ _mesa_printf("%s ", opcodes[opcode]);
- fprintf(stderr, "S[%d],", program[0] & T0_SAMPLER_NR_MASK);
+ _mesa_printf("S[%d],", program[0] & T0_SAMPLER_NR_MASK);
print_reg_type_nr((program[1] >> T1_ADDRESS_REG_TYPE_SHIFT) &
REG_TYPE_MASK,
(program[1] >> T1_ADDRESS_REG_NR_SHIFT) & REG_NR_MASK);
- fprintf(stderr, "\n");
+ _mesa_printf("\n");
}
static void
print_dcl_op(GLuint opcode, const GLuint * program)
{
- fprintf(stderr, "%s ", opcodes[opcode]);
+ _mesa_printf("%s ", opcodes[opcode]);
print_dest_reg(program[0] | A0_DEST_CHANNEL_ALL);
- fprintf(stderr, "\n");
+ _mesa_printf("\n");
}
@@ -303,7 +303,7 @@ i915_disassemble_program(const GLuint *
GLuint size = program[0] & 0x1ff;
GLint i;
- fprintf(stderr, "BEGIN\n");
+ _mesa_printf("\t\tBEGIN\n");
assert(size + 2 == sz);
@@ -311,6 +311,8 @@ i915_disassemble_program(const GLuint *
for (i = 1; i < sz; i += 3, program += 3) {
GLuint opcode = program[0] & (0x1f << 24);
+ _mesa_printf("\t\t");
+
if ((GLint) opcode >= A0_NOP && opcode <= A0_SLT)
print_arith_op(opcode >> 24, program);
else if (opcode >= T0_TEXLD && opcode <= T0_TEXKILL)
@@ -318,10 +320,10 @@ i915_disassemble_program(const GLuint *
else if (opcode == D0_DCL)
print_dcl_op(opcode >> 24, program);
else
- fprintf(stderr, "Unknown opcode 0x%x\n", opcode);
+ _mesa_printf("Unknown opcode 0x%x\n", opcode);
}
- fprintf(stderr, "END\n\n");
+ _mesa_printf("\t\tEND\n\n");
}
diff --git a/src/mesa/drivers/dri/i915tex/i915_vtbl.c b/src/mesa/drivers/dri/i915tex/i915_vtbl.c
index dfd1bbe..25593dc 100644
--- a/src/mesa/drivers/dri/i915tex/i915_vtbl.c
+++ b/src/mesa/drivers/dri/i915tex/i915_vtbl.c
@@ -53,6 +53,11 @@ static GLuint debug( const int *stream,
else
_mesa_printf("%s (%d dwords):\n", name, len);
+ for (i = 0; i < len; i++)
+ _mesa_printf("\t\t0x%08x\n", stream[i]);
+
+ _mesa_printf("\n");
+
return len;
}
More information about the mesa-commit
mailing list