iris: Drop copy and pasted iris_timebase_scale
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 15 Jul 2019 18:51:14 +0000 (11:51 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 17 Jul 2019 00:22:48 +0000 (17:22 -0700)
Lionel moved brw_timebase_scale to gen_device_info_timebase_scale a few
months ago, so we should just use that, and not our own copy in iris.

src/gallium/drivers/iris/iris_context.h
src/gallium/drivers/iris/iris_query.c
src/gallium/drivers/iris/iris_screen.c

index a1cdb75a7323f1f2534a3e77cb49cc55d6b1360c..5d7991d6c207298c8a79d21162fbb850e1f0739b 100644 (file)
@@ -890,8 +890,6 @@ void iris_math_add32_gpr0(struct iris_context *ice,
                           struct iris_batch *batch,
                           uint32_t x);
 
-uint64_t iris_timebase_scale(const struct gen_device_info *devinfo,
-                             uint64_t gpu_timestamp);
 void iris_resolve_conditional_render(struct iris_context *ice);
 
 /* iris_resolve.c */
index eb7bc4da133b242a0a28356766878059b25a140f..8109d49c2f72aa378596429120387b181906c8e9 100644 (file)
@@ -282,13 +282,6 @@ write_overflow_values(struct iris_context *ice, struct iris_query *q, bool end)
    }
 }
 
-uint64_t
-iris_timebase_scale(const struct gen_device_info *devinfo,
-                    uint64_t gpu_timestamp)
-{
-   return (1000000000ull * gpu_timestamp) / devinfo->timestamp_frequency;
-}
-
 static uint64_t
 iris_raw_timestamp_delta(uint64_t time0, uint64_t time1)
 {
@@ -319,12 +312,12 @@ calculate_result_on_cpu(const struct gen_device_info *devinfo,
    case PIPE_QUERY_TIMESTAMP:
    case PIPE_QUERY_TIMESTAMP_DISJOINT:
       /* The timestamp is the single starting snapshot. */
-      q->result = iris_timebase_scale(devinfo, q->map->start);
+      q->result = gen_device_info_timebase_scale(devinfo, q->map->start);
       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 = gen_device_info_timebase_scale(devinfo, q->result);
       q->result &= (1ull << TIMESTAMP_BITS) - 1;
       break;
    case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
index bfb70dfdba09452ee220a4a428e1090b63e07945..2a1a95a2414e40ba8e56e8a5dc274a62f9c1dedf 100644 (file)
@@ -504,7 +504,7 @@ iris_get_timestamp(struct pipe_screen *pscreen)
 
    iris_reg_read(screen->bufmgr, TIMESTAMP | 1, &result);
 
-   result = iris_timebase_scale(&screen->devinfo, result);
+   result = gen_device_info_timebase_scale(&screen->devinfo, result);
    result &= (1ull << TIMESTAMP_BITS) - 1;
 
    return result;