summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2014-09-26 10:29:25 -0700
committerKenneth Graunke <kenneth@whitecape.org>2014-10-01 01:05:35 -0700
commit5105f9a7ae66001537e8dbf6acf40faf736430e5 (patch)
tree0c9aadf206265f7e25a9e64427978a6bad2d3e26 /src
parentfbebd5e4a5ccb44ae005a8be18c85ea45c66307f (diff)
downloadexternal_mesa3d-5105f9a7ae66001537e8dbf6acf40faf736430e5.zip
external_mesa3d-5105f9a7ae66001537e8dbf6acf40faf736430e5.tar.gz
external_mesa3d-5105f9a7ae66001537e8dbf6acf40faf736430e5.tar.bz2
i965: Fix INTEL_DEBUG=state to work with 64-bit dirty bits.
This will keep INTEL_DEBUG=state working when we add BRW_NEW_* bits beyond 1 << 31. We missed doing this when widening the driver flags from uint32_t to uint64_t. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_state_upload.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c
index f4b0475..e124ce4 100644
--- a/src/mesa/drivers/dri/i965/brw_state_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_state_upload.c
@@ -438,7 +438,7 @@ static void xor_states( struct brw_state_flags *result,
}
struct dirty_bit_map {
- uint32_t bit;
+ uint64_t bit;
char *name;
uint32_t count;
};
@@ -475,7 +475,8 @@ static struct dirty_bit_map mesa_bits[] = {
DEFINE_BIT(_NEW_PROGRAM_CONSTANTS),
DEFINE_BIT(_NEW_BUFFER_OBJECT),
DEFINE_BIT(_NEW_FRAG_CLAMP),
- DEFINE_BIT(_NEW_VARYING_VP_INPUTS),
+ /* Avoid sign extension problems. */
+ {(unsigned) _NEW_VARYING_VP_INPUTS, "_NEW_VARYING_VP_INPUTS", 0},
{0, 0, 0}
};
@@ -538,14 +539,9 @@ static struct dirty_bit_map cache_bits[] = {
static void
-brw_update_dirty_count(struct dirty_bit_map *bit_map, int32_t bits)
+brw_update_dirty_count(struct dirty_bit_map *bit_map, uint64_t bits)
{
- int i;
-
- for (i = 0; i < 32; i++) {
- if (bit_map[i].bit == 0)
- return;
-
+ for (int i = 0; bit_map[i].bit != 0; i++) {
if (bit_map[i].bit & bits)
bit_map[i].count++;
}
@@ -554,13 +550,8 @@ brw_update_dirty_count(struct dirty_bit_map *bit_map, int32_t bits)
static void
brw_print_dirty_count(struct dirty_bit_map *bit_map)
{
- int i;
-
- for (i = 0; i < 32; i++) {
- if (bit_map[i].bit == 0)
- return;
-
- fprintf(stderr, "0x%08x: %12d (%s)\n",
+ for (int i = 0; bit_map[i].bit != 0; i++) {
+ fprintf(stderr, "0x%016lx: %12d (%s)\n",
bit_map[i].bit, bit_map[i].count, bit_map[i].name);
}
}