freedreno: expose time-elapsed query
authorRob Clark <robclark@freedesktop.org>
Wed, 10 Feb 2016 19:40:24 +0000 (14:40 -0500)
committerRob Clark <robclark@freedesktop.org>
Wed, 17 Feb 2016 15:41:55 +0000 (10:41 -0500)
Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/freedreno_query_hw.c
src/gallium/drivers/freedreno/freedreno_screen.c

index 433c678c6d9d7cd0393b7ecb06267d09296e4820..2ac03f22b4148379942a6c57ccf5388dd927ebf2 100644 (file)
@@ -47,6 +47,8 @@ static int pidx(unsigned query_type)
                return 0;
        case PIPE_QUERY_OCCLUSION_PREDICATE:
                return 1;
+       case PIPE_QUERY_TIME_ELAPSED:
+               return 2;
        default:
                return -1;
        }
index bd8373422b2f519cfb16a78f97218ae6daf003d4..2b3ecfe664e7a48911119a7e2e5b6cc0cb4360b3 100644 (file)
@@ -298,12 +298,14 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
                return is_a3xx(screen) ? 1 : 0;
 
        /* Queries. */
-       case PIPE_CAP_QUERY_TIME_ELAPSED:
        case PIPE_CAP_QUERY_TIMESTAMP:
        case PIPE_CAP_QUERY_BUFFER_OBJECT:
                return 0;
        case PIPE_CAP_OCCLUSION_QUERY:
                return is_a3xx(screen) || is_a4xx(screen);
+       case PIPE_CAP_QUERY_TIME_ELAPSED:
+               /* only a4xx, requires new enough kernel so we know max_freq: */
+               return (screen->max_freq > 0) && is_a4xx(screen);
 
        case PIPE_CAP_MIN_TEXTURE_GATHER_OFFSET:
        case PIPE_CAP_MIN_TEXEL_OFFSET: