summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/iris/iris_screen.c
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2018-09-28 15:42:51 +0200
committerKenneth Graunke <[email protected]>2019-02-21 10:26:08 -0800
commit1d91eba7dcfb37151399b21b419b0bef26a4431a (patch)
treecad2591f8bc1b246df9f568641239c9b2208d0dc /src/gallium/drivers/iris/iris_screen.c
parent36fbcfb06c7e733a42fc8f9444faa81631ae2852 (diff)
iris: glGet timestamps, more correct timestamps
Diffstat (limited to 'src/gallium/drivers/iris/iris_screen.c')
-rw-r--r--src/gallium/drivers/iris/iris_screen.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gallium/drivers/iris/iris_screen.c b/src/gallium/drivers/iris/iris_screen.c
index efc6a7045da..658ecc1f591 100644
--- a/src/gallium/drivers/iris/iris_screen.c
+++ b/src/gallium/drivers/iris/iris_screen.c
@@ -374,7 +374,16 @@ iris_get_compute_param(struct pipe_screen *pscreen,
static uint64_t
iris_get_timestamp(struct pipe_screen *pscreen)
{
- return 0;
+ struct iris_screen *screen = (struct iris_screen *) pscreen;
+ const unsigned TIMESTAMP = 0x2358;
+ uint64_t result;
+
+ iris_reg_read(screen->bufmgr, TIMESTAMP, &result);
+
+ result = iris_timebase_scale(&screen->devinfo, result);
+ result &= (1ull << 36) - 1;
+
+ return result;
}
static void