summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLionel Landwerlin <[email protected]>2018-06-14 17:29:16 +0100
committerLionel Landwerlin <[email protected]>2018-07-05 11:57:45 +0100
commit28476c9d818b297bd88f2c0dc93cbd66aa671c13 (patch)
tree4720000a6b3c422c3e50326b76ddecb082945027
parentc262ec19d0705d93903b28ed8f79cb85abeb5a1a (diff)
intel: batch-decoder: don't asks for constant BO until decoding
With PPGTT mappings, our aubinator implementation can be quite slow if we request a buffer that doesn't exist. Instead of doing a PPGTT walk for invalid addresses (0 lengths), wait until we're sure we want to decode the data. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Rafael Antognolli <[email protected]>
-rw-r--r--src/intel/common/gen_batch_decoder.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/intel/common/gen_batch_decoder.c b/src/intel/common/gen_batch_decoder.c
index 2b6978da92d..81d8298c28b 100644
--- a/src/intel/common/gen_batch_decoder.c
+++ b/src/intel/common/gen_batch_decoder.c
@@ -562,9 +562,8 @@ decode_3dstate_constant(struct gen_batch_decode_ctx *ctx, const uint32_t *p)
struct gen_group *body =
gen_spec_find_struct(ctx->spec, "3DSTATE_CONSTANT_BODY");
- uint32_t read_length[4];
- struct gen_batch_decode_bo buffer[4];
- memset(buffer, 0, sizeof(buffer));
+ uint32_t read_length[4] = {0};
+ uint64_t read_addr[4];
struct gen_field_iterator outer;
gen_field_iterator_init(&outer, inst, p, 0, false);
@@ -581,18 +580,24 @@ decode_3dstate_constant(struct gen_batch_decode_ctx *ctx, const uint32_t *p)
if (sscanf(iter.name, "Read Length[%d]", &idx) == 1) {
read_length[idx] = iter.raw_value;
} else if (sscanf(iter.name, "Buffer[%d]", &idx) == 1) {
- buffer[idx] = ctx_get_bo(ctx, iter.raw_value);
+ read_addr[idx] = iter.raw_value;
}
}
for (int i = 0; i < 4; i++) {
- if (read_length[i] == 0 || buffer[i].map == NULL)
+ if (read_length[i] == 0)
continue;
+ struct gen_batch_decode_bo buffer = ctx_get_bo(ctx, read_addr[i]);
+ if (!buffer.map) {
+ fprintf(ctx->fp, "constant buffer %d unavailable\n", i);
+ continue;
+ }
+
unsigned size = read_length[i] * 32;
fprintf(ctx->fp, "constant buffer %d, size %u\n", i, size);
- ctx_print_buffer(ctx, buffer[i], size, 0, -1);
+ ctx_print_buffer(ctx, buffer, size, 0, -1);
}
}
}