iris: 36-bit overflow fixes
authorKenneth Graunke <kenneth@whitecape.org>
Sat, 29 Sep 2018 08:39:39 +0000 (10:39 +0200)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:08 +0000 (10:26 -0800)
src/gallium/drivers/iris/iris_query.c

index 15937a8be8d3943e11a9aad41e0861d7ef1853a7..6148835e05c53576a80a08573439e68c82bbced1 100644 (file)
@@ -267,7 +267,7 @@ 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);
-      // XXX: 36-bit overflow?
+      q->result &= (1ull << 36) - 1;
       break;
    case PIPE_QUERY_TIME_ELAPSED:
       q->result = iris_raw_timestamp_delta(q->map->start, q->map->end);