summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2018-12-14 00:51:00 -0800
committerKenneth Graunke <kenneth@whitecape.org>2019-01-23 00:37:44 -0800
commitd450c5627c95fc1a5f761264f941cb9002625515 (patch)
treeb28e7a59e15983dc0f507ba4e2c8a55a3f3bf72f
parent59eb5367dcd1b61bf173206819697c67114a123c (diff)
iris: Add a more long term TODO about timebase scaling
-rw-r--r--src/gallium/drivers/iris/iris_query.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/iris/iris_query.c b/src/gallium/drivers/iris/iris_query.c
index 242bd5e64ae..9739369dd74 100644
--- a/src/gallium/drivers/iris/iris_query.c
+++ b/src/gallium/drivers/iris/iris_query.c
@@ -623,10 +623,15 @@ calculate_result_on_gpu(struct iris_context *ice, struct iris_query *q)
if (q->type == PIPE_QUERY_TIMESTAMP) {
ice->vtbl.load_register_mem64(batch, CS_GPR(0), q->bo,
offsetof(struct iris_query_snapshots, start));
+ /* TODO: This discards any fractional bits of the timebase scale.
+ * We would need to do a bit of fixed point math on the CS ALU, or
+ * launch an actual shader to calculate this with full precision.
+ */
emit_mul_gpr0(batch, (1000000000ull / screen->devinfo.timestamp_frequency));
keep_gpr0_lower_n_bits(ice, 36);
return;
}
+
ice->vtbl.load_register_mem64(batch, CS_GPR(1), q->bo,
offsetof(struct iris_query_snapshots, start));
ice->vtbl.load_register_mem64(batch, CS_GPR(2), q->bo,
@@ -646,6 +651,7 @@ calculate_result_on_gpu(struct iris_context *ice, struct iris_query *q)
gpr0_to_bool(ice);
if (q->type == PIPE_QUERY_TIME_ELAPSED) {
+ /* TODO: This discards fractional bits (see above). */
emit_mul_gpr0(batch, (1000000000ull / screen->devinfo.timestamp_frequency));
}
}