summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2018-09-29 10:47:01 +0200
committerKenneth Graunke <[email protected]>2019-02-21 10:26:08 -0800
commit0395eba20f1e370e584e99dd337b8560cd90ee5e (patch)
tree41d88051aee2b9cb37c4290f071572f546efe981 /src
parent57f8a623c522e0f39428568807946469b4e6ba1f (diff)
iris: magic number 36 -> #define
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/iris/iris_query.c8
-rw-r--r--src/gallium/drivers/iris/iris_screen.c3
2 files changed, 5 insertions, 6 deletions
diff --git a/src/gallium/drivers/iris/iris_query.c b/src/gallium/drivers/iris/iris_query.c
index 6e7b0057817..b9a7823afe9 100644
--- a/src/gallium/drivers/iris/iris_query.c
+++ b/src/gallium/drivers/iris/iris_query.c
@@ -88,7 +88,6 @@
#define MI_ALU2(op, x, y) \
((MI_ALU_##op << 20) | (MI_ALU_##x << 10) | (MI_ALU_##y))
-
struct iris_query {
enum pipe_query_type type;
int index;
@@ -248,13 +247,12 @@ static uint64_t
iris_raw_timestamp_delta(uint64_t time0, uint64_t time1)
{
if (time0 > time1) {
- return (1ULL << 36) + time1 - time0;
+ return (1ULL << TIMESTAMP_BITS) + time1 - time0;
} else {
return time1 - time0;
}
}
-
static void
calculate_result_on_cpu(const struct gen_device_info *devinfo,
struct iris_query *q)
@@ -268,12 +266,12 @@ calculate_result_on_cpu(const struct gen_device_info *devinfo,
case PIPE_QUERY_TIMESTAMP_DISJOINT:
/* The timestamp is the single starting snapshot. */
q->result = iris_timebase_scale(devinfo, q->map->start);
- q->result &= (1ull << 36) - 1;
+ q->result &= (1ull << TIMESTAMP_BITS) - 1;
break;
case PIPE_QUERY_TIME_ELAPSED:
q->result = iris_raw_timestamp_delta(q->map->start, q->map->end);
q->result = iris_timebase_scale(devinfo, q->result);
- q->result &= (1ull << 36) - 1;
+ q->result &= (1ull << TIMESTAMP_BITS) - 1;
break;
case PIPE_QUERY_OCCLUSION_COUNTER:
case PIPE_QUERY_PRIMITIVES_GENERATED:
diff --git a/src/gallium/drivers/iris/iris_screen.c b/src/gallium/drivers/iris/iris_screen.c
index ca670dc8a33..af0790e5edf 100644
--- a/src/gallium/drivers/iris/iris_screen.c
+++ b/src/gallium/drivers/iris/iris_screen.c
@@ -43,6 +43,7 @@
#include "util/ralloc.h"
#include "drm-uapi/i915_drm.h"
#include "iris_context.h"
+#include "iris_defines.h"
#include "iris_pipe.h"
#include "iris_resource.h"
#include "iris_screen.h"
@@ -381,7 +382,7 @@ iris_get_timestamp(struct pipe_screen *pscreen)
iris_reg_read(screen->bufmgr, TIMESTAMP | 1, &result);
result = iris_timebase_scale(&screen->devinfo, result);
- result &= (1ull << 36) - 1;
+ result &= (1ull << TIMESTAMP_BITS) - 1;
return result;
}