radeonsi: fix timestamp queries for compute-only contexts
authorMarek Olšák <marek.olsak@amd.com>
Mon, 27 May 2019 20:09:33 +0000 (16:09 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 30 May 2019 01:13:35 +0000 (21:13 -0400)
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
src/gallium/drivers/radeonsi/si_fence.c

index 1d67fd87b90ec3c169ffc10be4fef1df3959ccbb..6d914a1b1840923f1f01d635ebf9747195d0523b 100644 (file)
@@ -79,8 +79,11 @@ void si_cp_release_mem(struct si_context *ctx, struct radeon_cmdbuf *cs,
        unsigned sel = EOP_DST_SEL(dst_sel) |
                       EOP_INT_SEL(int_sel) |
                       EOP_DATA_SEL(data_sel);
+       bool compute_ib = !ctx->has_graphics ||
+                         cs == ctx->prim_discard_compute_cs;
 
-       if (ctx->chip_class >= GFX9 || cs == ctx->prim_discard_compute_cs) {
+       if (ctx->chip_class >= GFX9 ||
+           (compute_ib && ctx->chip_class >= GFX7)) {
                /* A ZPASS_DONE or PIXEL_STAT_DUMP_EVENT (of the DB occlusion
                 * counters) must immediately precede every timestamp event to
                 * prevent a GPU hang on GFX9.
@@ -88,8 +91,7 @@ void si_cp_release_mem(struct si_context *ctx, struct radeon_cmdbuf *cs,
                 * Occlusion queries don't need to do it here, because they
                 * always do ZPASS_DONE before the timestamp.
                 */
-               if (ctx->chip_class == GFX9 &&
-                   cs != ctx->prim_discard_compute_cs &&
+               if (ctx->chip_class == GFX9 && !compute_ib &&
                    query_type != PIPE_QUERY_OCCLUSION_COUNTER &&
                    query_type != PIPE_QUERY_OCCLUSION_PREDICATE &&
                    query_type != PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE) {