radeonsi: copy r600_get_timestamp
authorNiels Ole Salscheider <niels_ole@salscheider-online.de>
Fri, 9 Aug 2013 09:59:29 +0000 (11:59 +0200)
committerTom Stellard <thomas.stellard@amd.com>
Fri, 23 Aug 2013 23:59:55 +0000 (16:59 -0700)
Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
src/gallium/drivers/radeonsi/radeonsi_pipe.c

index 335176802a834ca42e1cbe89bd65099c4347db35..2258de9380dc80cc6bb418b584602945bf982dae 100644 (file)
@@ -788,6 +788,14 @@ static int r600_init_tiling(struct r600_screen *rscreen)
        return evergreen_interpret_tiling(rscreen, tiling_config);
 }
 
+static uint64_t r600_get_timestamp(struct pipe_screen *screen)
+{
+       struct r600_screen *rscreen = (struct r600_screen*)screen;
+
+       return 1000000 * rscreen->ws->query_value(rscreen->ws, RADEON_TIMESTAMP) /
+               rscreen->info.r600_clock_crystal_freq;
+}
+
 static unsigned radeon_family_from_device(unsigned device)
 {
        switch (device) {
@@ -839,6 +847,7 @@ struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws)
        rscreen->screen.get_shader_param = r600_get_shader_param;
        rscreen->screen.get_paramf = r600_get_paramf;
        rscreen->screen.get_compute_param = r600_get_compute_param;
+       rscreen->screen.get_timestamp = r600_get_timestamp;
        rscreen->screen.is_format_supported = si_is_format_supported;
        rscreen->screen.context_create = r600_create_context;
        rscreen->screen.fence_reference = r600_fence_reference;