freedreno: Count blits in GL_TIME_ELAPSED and perf counter queries.
authorEric Anholt <eric@anholt.net>
Fri, 27 Mar 2020 17:54:19 +0000 (10:54 -0700)
committerMarge Bot <eric+marge@anholt.net>
Mon, 30 Mar 2020 21:35:21 +0000 (21:35 +0000)
Fixes 0 gpu time reported for glBlitFramebuffer in apitrace replay --pgpu.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4356>

src/gallium/drivers/freedreno/a2xx/fd2_query.c
src/gallium/drivers/freedreno/a4xx/fd4_query.c
src/gallium/drivers/freedreno/a5xx/fd5_query.c
src/gallium/drivers/freedreno/a6xx/fd6_blitter.c
src/gallium/drivers/freedreno/a6xx/fd6_query.c

index dc6f88ba78872ed1f9b1d1c99ee995ba5a4771d6..b51903fcf97ad93a96428af5bd9436d266e1d2f1 100644 (file)
@@ -151,7 +151,7 @@ perfcntr_accumulate_result(struct fd_acc_query *aq, void *buf,
 
 static const struct fd_acc_sample_provider perfcntr = {
                .query_type = FD_QUERY_FIRST_PERFCNTR,
-               .active = FD_STAGE_DRAW | FD_STAGE_CLEAR,
+               .active = FD_STAGE_ALL,
                .resume = perfcntr_resume,
                .pause = perfcntr_pause,
                .result = perfcntr_accumulate_result,
index 1f1ce8e87711618aea1c85e09720bfafeeea2644..ba225af82fc2174fe2266c393d5da696de73d44b 100644 (file)
@@ -259,7 +259,7 @@ static const struct fd_hw_sample_provider occlusion_predicate_conservative = {
 
 static const struct fd_hw_sample_provider time_elapsed = {
                .query_type = PIPE_QUERY_TIME_ELAPSED,
-               .active = FD_STAGE_DRAW | FD_STAGE_CLEAR,
+               .active = FD_STAGE_ALL,
                .enable = time_elapsed_enable,
                .get_sample = time_elapsed_get_sample,
                .accumulate_result = time_elapsed_accumulate_result,
index 28f296d57cff143b1b77a71692ccbfb5fe876127..6cf9e2d614029f200a2f5003570eb1fb39cd6ce0 100644 (file)
@@ -229,7 +229,7 @@ timestamp_accumulate_result(struct fd_acc_query *aq, void *buf,
 
 static const struct fd_acc_sample_provider time_elapsed = {
                .query_type = PIPE_QUERY_TIME_ELAPSED,
-               .active = FD_STAGE_DRAW | FD_STAGE_CLEAR,
+               .active = FD_STAGE_ALL,
                .size = sizeof(struct fd5_query_sample),
                .resume = timestamp_resume,
                .pause = timestamp_pause,
@@ -366,7 +366,7 @@ perfcntr_accumulate_result(struct fd_acc_query *aq, void *buf,
 
 static const struct fd_acc_sample_provider perfcntr = {
                .query_type = FD_QUERY_FIRST_PERFCNTR,
-               .active = FD_STAGE_DRAW | FD_STAGE_CLEAR,
+               .active = FD_STAGE_ALL,
                .resume = perfcntr_resume,
                .pause = perfcntr_pause,
                .result = perfcntr_accumulate_result,
index 24f4e46b89df734c9f2d67c80e21f559e4ded2ae..757e7117f7552865ea1e96755353592e21bc8d57 100644 (file)
@@ -646,6 +646,8 @@ handle_rgba_blit(struct fd_context *ctx, const struct pipe_blit_info *info)
 
        mtx_unlock(&ctx->screen->lock);
 
+       fd_batch_set_stage(batch, FD_STAGE_BLIT);
+
        emit_setup(batch);
 
        if ((info->src.resource->target == PIPE_BUFFER) &&
index f58fff7b4bac43759f4f0502c05828031e0ca0ee..374b6f060540c0cc01f70dbfac0c3f2740d58810 100644 (file)
@@ -229,7 +229,7 @@ timestamp_accumulate_result(struct fd_acc_query *aq, void *buf,
 
 static const struct fd_acc_sample_provider time_elapsed = {
                .query_type = PIPE_QUERY_TIME_ELAPSED,
-               .active = FD_STAGE_DRAW | FD_STAGE_CLEAR,
+               .active = FD_STAGE_ALL,
                .size = sizeof(struct fd6_query_sample),
                .resume = timestamp_resume,
                .pause = timestamp_pause,
@@ -547,7 +547,7 @@ perfcntr_accumulate_result(struct fd_acc_query *aq, void *buf,
 
 static const struct fd_acc_sample_provider perfcntr = {
                .query_type = FD_QUERY_FIRST_PERFCNTR,
-               .active = FD_STAGE_DRAW | FD_STAGE_CLEAR,
+               .active = FD_STAGE_ALL,
                .resume = perfcntr_resume,
                .pause = perfcntr_pause,
                .result = perfcntr_accumulate_result,