freedreno: query max gpu freq
authorRob Clark <robclark@freedesktop.org>
Wed, 10 Feb 2016 18:25:32 +0000 (13:25 -0500)
committerRob Clark <robclark@freedesktop.org>
Wed, 17 Feb 2016 15:41:55 +0000 (10:41 -0500)
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 <robclark@freedesktop.org>
configure.ac
src/gallium/drivers/freedreno/freedreno_screen.c
src/gallium/drivers/freedreno/freedreno_screen.h

index 57330cb55cb6c65ffbd5d965eb80555726447ba2..d4ce99a813bd4fd9f8ffb90c804e216c4f7d7b82 100644 (file)
@@ -74,7 +74,7 @@ LIBDRM_AMDGPU_REQUIRED=2.4.63
 LIBDRM_INTEL_REQUIRED=2.4.61
 LIBDRM_NVVIEUX_REQUIRED=2.4.66
 LIBDRM_NOUVEAU_REQUIRED=2.4.66
-LIBDRM_FREEDRENO_REQUIRED=2.4.65
+LIBDRM_FREEDRENO_REQUIRED=2.4.67
 DRI2PROTO_REQUIRED=2.6
 DRI3PROTO_REQUIRED=1.0
 PRESENTPROTO_REQUIRED=1.0
index 9a94e632a31bb8f431efdf807280b2e4bf3fa0e5..bd8373422b2f519cfb16a78f97218ae6daf003d4 100644 (file)
@@ -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;
index 8fb096a10ddf48071e32ef32c960bf58d5ac4e1a..a81c77863902c8e051a036e0eb9c8f87cfb02967 100644 (file)
@@ -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 */