From 45ab5b1c34a7fe78f6e5f95e11f24674657ecfd3 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Wed, 10 Feb 2016 13:25:32 -0500 Subject: freedreno: query max gpu freq This will be needed to support converting from cycle counts to time for performance related queries (initially time-elapsed, but there are some additional performance counters that could be wired up). Signed-off-by: Rob Clark --- src/gallium/drivers/freedreno/freedreno_screen.c | 10 ++++++++++ src/gallium/drivers/freedreno/freedreno_screen.h | 1 + 2 files changed, 11 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c b/src/gallium/drivers/freedreno/freedreno_screen.c index 9a94e632a31..bd8373422b2 100644 --- a/src/gallium/drivers/freedreno/freedreno_screen.c +++ b/src/gallium/drivers/freedreno/freedreno_screen.c @@ -537,6 +537,16 @@ fd_screen_create(struct fd_device *dev) } screen->device_id = val; + if (fd_pipe_get_param(screen->pipe, FD_MAX_FREQ, &val)) { + DBG("could not get gpu freq"); + /* this limits what performance related queries are + * supported but is not fatal + */ + screen->max_freq = 0; + } else { + screen->max_freq = val; + } + if (fd_pipe_get_param(screen->pipe, FD_GPU_ID, &val)) { DBG("could not get gpu-id"); goto fail; diff --git a/src/gallium/drivers/freedreno/freedreno_screen.h b/src/gallium/drivers/freedreno/freedreno_screen.h index 8fb096a10dd..a81c7786390 100644 --- a/src/gallium/drivers/freedreno/freedreno_screen.h +++ b/src/gallium/drivers/freedreno/freedreno_screen.h @@ -56,6 +56,7 @@ struct fd_screen { uint32_t device_id; uint32_t gpu_id; /* 220, 305, etc */ uint32_t chip_id; /* coreid:8 majorrev:8 minorrev:8 patch:8 */ + uint32_t max_freq; uint32_t max_rts; /* max # of render targets */ void *compiler; /* currently unused for a2xx */ -- cgit v1.2.3