gallium/radeon: clean up EOP_DATA_SEL magic numbers
authorMarek Olšák <marek.olsak@amd.com>
Fri, 18 Aug 2017 19:14:01 +0000 (21:14 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 22 Aug 2017 11:29:47 +0000 (13:29 +0200)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/amd/common/r600d_common.h
src/gallium/drivers/radeon/r600_query.c
src/gallium/drivers/radeonsi/si_perfcounter.c
src/gallium/drivers/radeonsi/si_state_draw.c

index 0b61215f2bcc2f9005d76b06557c03be9afa9c76..57757469e522b87fc4f232c3438d06d8337fbe22 100644 (file)
 #define PKT3_EVENT_WRITE                       0x46
 #define PKT3_EVENT_WRITE_EOP                   0x47
 #define         EOP_DATA_SEL(x)                         ((x) << 29)
-               /* 0 - discard
-                * 1 - send low 32bit data
-                * 2 - send 64bit data
-                * 3 - send 64bit GPU counter value
-                * 4 - send 64bit sys counter value
-                */
+#define                        EOP_DATA_SEL_DISCARD            0
+#define                        EOP_DATA_SEL_VALUE_32BIT        1
+#define                        EOP_DATA_SEL_VALUE_64BIT        2
+#define                        EOP_DATA_SEL_TIMESTAMP          3
 #define PKT3_RELEASE_MEM                       0x49 /* GFX9+ */
 #define PKT3_SET_CONFIG_REG                   0x68
 #define PKT3_SET_CONTEXT_REG                  0x69
index 98bdd80d7398d9d68156556c264f3670f50088fb..ca048722672e3edb7692e21f8747ad1298ca3f5b 100644 (file)
@@ -778,7 +778,8 @@ static void r600_query_hw_do_emit_start(struct r600_common_context *ctx,
                         * (bottom-of-pipe)
                         */
                        r600_gfx_write_event_eop(ctx, EVENT_TYPE_BOTTOM_OF_PIPE_TS,
-                                                0, 3, NULL, va, 0, query->b.type);
+                                                0, EOP_DATA_SEL_TIMESTAMP,
+                                                NULL, va, 0, query->b.type);
                }
                break;
        case PIPE_QUERY_PIPELINE_STATISTICS:
@@ -863,7 +864,8 @@ static void r600_query_hw_do_emit_stop(struct r600_common_context *ctx,
                /* fall through */
        case PIPE_QUERY_TIMESTAMP:
                r600_gfx_write_event_eop(ctx, EVENT_TYPE_BOTTOM_OF_PIPE_TS,
-                                        0, 3, NULL, va, 0, query->b.type);
+                                        0, EOP_DATA_SEL_TIMESTAMP, NULL, va,
+                                        0, query->b.type);
                fence_va = va + 8;
                break;
        case PIPE_QUERY_PIPELINE_STATISTICS: {
@@ -885,7 +887,8 @@ static void r600_query_hw_do_emit_stop(struct r600_common_context *ctx,
                        RADEON_PRIO_QUERY);
 
        if (fence_va)
-               r600_gfx_write_event_eop(ctx, EVENT_TYPE_BOTTOM_OF_PIPE_TS, 0, 1,
+               r600_gfx_write_event_eop(ctx, EVENT_TYPE_BOTTOM_OF_PIPE_TS, 0,
+                                        EOP_DATA_SEL_VALUE_32BIT,
                                         query->buffer.buf, fence_va, 0x80000000,
                                         query->b.type);
 }
index aa09e0ef6a32d65f990d84ab4cdf3e72dd21a14c..4a543ea24492d40f9e410187c55d847a81b0c068 100644 (file)
@@ -614,7 +614,8 @@ static void si_pc_emit_stop(struct r600_common_context *ctx,
 {
        struct radeon_winsys_cs *cs = ctx->gfx.cs;
 
-       r600_gfx_write_event_eop(ctx, EVENT_TYPE_BOTTOM_OF_PIPE_TS, 0, 1,
+       r600_gfx_write_event_eop(ctx, EVENT_TYPE_BOTTOM_OF_PIPE_TS, 0,
+                                EOP_DATA_SEL_VALUE_32BIT,
                                 buffer, va, 0, R600_NOT_QUERY);
        r600_gfx_wait_fence(ctx, va, 0, 0xffffffff);
 
index 3bec6396875907751e88c58cf0c2c5044f66ac7b..ebc362ed03e2b7f3c72b12d95a93c54b930b1660 100644 (file)
@@ -899,7 +899,8 @@ void si_emit_cache_flush(struct si_context *sctx)
                        /* Necessary for DCC */
                        if (rctx->chip_class == VI)
                                r600_gfx_write_event_eop(rctx, V_028A90_FLUSH_AND_INV_CB_DATA_TS,
-                                                        0, 0, NULL, 0, 0, R600_NOT_QUERY);
+                                                        0, EOP_DATA_SEL_DISCARD, NULL,
+                                                        0, 0, R600_NOT_QUERY);
                }
                if (rctx->flags & SI_CONTEXT_FLUSH_AND_INV_DB)
                        cp_coher_cntl |= S_0085F0_DB_ACTION_ENA(1) |
@@ -998,7 +999,8 @@ void si_emit_cache_flush(struct si_context *sctx)
                va = sctx->wait_mem_scratch->gpu_address;
                sctx->wait_mem_number++;
 
-               r600_gfx_write_event_eop(rctx, cb_db_event, tc_flags, 1,
+               r600_gfx_write_event_eop(rctx, cb_db_event, tc_flags,
+                                        EOP_DATA_SEL_VALUE_32BIT,
                                         sctx->wait_mem_scratch, va,
                                         sctx->wait_mem_number, R600_NOT_QUERY);
                r600_gfx_wait_fence(rctx, va, sctx->wait_mem_number, 0xffffffff);