ac: correct PKT3_COPY_DATA definitions
authorMarek Olšák <marek.olsak@amd.com>
Fri, 21 Sep 2018 07:30:18 +0000 (03:30 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Sun, 7 Oct 2018 01:50:09 +0000 (21:50 -0400)
src/amd/common/sid.h
src/amd/vulkan/radv_cmd_buffer.c
src/amd/vulkan/radv_query.c
src/gallium/drivers/radeonsi/si_compute.c
src/gallium/drivers/radeonsi/si_perfcounter.c
src/gallium/drivers/radeonsi/si_query.c
src/gallium/drivers/radeonsi/si_state_draw.c

index d20b5484223b6d2605e4f1e88db0018869afd677..b3321ea3a77bd8d26017b4ccf74611bcfa673123 100644 (file)
 #define PKT3_COPY_DATA                        0x40
 #define                COPY_DATA_SRC_SEL(x)            ((x) & 0xf)
 #define                        COPY_DATA_REG           0
-#define                        COPY_DATA_MEM           1
+#define                        COPY_DATA_SRC_MEM       1 /* only valid as source */
+#define                 COPY_DATA_TC_L2         2
+#define                 COPY_DATA_GDS           3
 #define                 COPY_DATA_PERF          4
 #define                 COPY_DATA_IMM           5
 #define                 COPY_DATA_TIMESTAMP     9
 #define                COPY_DATA_DST_SEL(x)            (((unsigned)(x) & 0xf) << 8)
-#define                 COPY_DATA_MEM_ASYNC     5
+#define                 COPY_DATA_DST_MEM_GRBM 1 /* sync across GRBM, deprecated */
+#define                 COPY_DATA_TC_L2         2
+#define                 COPY_DATA_GDS           3
+#define                 COPY_DATA_PERF          4
+#define                 COPY_DATA_DST_MEM       5
 #define                COPY_DATA_COUNT_SEL             (1 << 16)
 #define                COPY_DATA_WR_CONFIRM            (1 << 20)
+#define                COPY_DATA_ENGINE_PFP            (1 << 30)
 #define PKT3_PFP_SYNC_ME                      0x42
 #define PKT3_SURFACE_SYNC                      0x43 /* deprecated on CIK, use ACQUIRE_MEM */
 #define PKT3_ME_INITIALIZE                     0x44 /* not on CIK */
index d492456d6b88060660f3c1db6cc069dcd99b647c..339704990e26137d9902d0874b1d6917e19d0473 100644 (file)
@@ -1297,7 +1297,7 @@ radv_load_ds_clear_metadata(struct radv_cmd_buffer *cmd_buffer,
                ++reg_count;
 
        radeon_emit(cs, PKT3(PKT3_COPY_DATA, 4, 0));
-       radeon_emit(cs, COPY_DATA_SRC_SEL(COPY_DATA_MEM) |
+       radeon_emit(cs, COPY_DATA_SRC_SEL(COPY_DATA_SRC_MEM) |
                        COPY_DATA_DST_SEL(COPY_DATA_REG) |
                        (reg_count == 2 ? COPY_DATA_COUNT_SEL : 0));
        radeon_emit(cs, va);
@@ -1427,7 +1427,7 @@ radv_load_color_clear_metadata(struct radv_cmd_buffer *cmd_buffer,
        uint32_t reg = R_028C8C_CB_COLOR0_CLEAR_WORD0 + cb_idx * 0x3c;
 
        radeon_emit(cs, PKT3(PKT3_COPY_DATA, 4, cmd_buffer->state.predicating));
-       radeon_emit(cs, COPY_DATA_SRC_SEL(COPY_DATA_MEM) |
+       radeon_emit(cs, COPY_DATA_SRC_SEL(COPY_DATA_SRC_MEM) |
                        COPY_DATA_DST_SEL(COPY_DATA_REG) |
                        COPY_DATA_COUNT_SEL);
        radeon_emit(cs, va);
@@ -3741,7 +3741,7 @@ radv_emit_dispatch_packets(struct radv_cmd_buffer *cmd_buffer,
                if (loc->sgpr_idx != -1) {
                        for (unsigned i = 0; i < 3; ++i) {
                                radeon_emit(cs, PKT3(PKT3_COPY_DATA, 4, 0));
-                               radeon_emit(cs, COPY_DATA_SRC_SEL(COPY_DATA_MEM) |
+                               radeon_emit(cs, COPY_DATA_SRC_SEL(COPY_DATA_SRC_MEM) |
                                                COPY_DATA_DST_SEL(COPY_DATA_REG));
                                radeon_emit(cs, (va +  4 * i));
                                radeon_emit(cs, (va + 4 * i) >> 32);
index 41af16ba768ba025c961e659150c52f38ac2ab6c..63a2b6a7d7cb006921e9a44c9b850b9ebcddf69a 100644 (file)
@@ -1053,8 +1053,8 @@ void radv_CmdCopyQueryPoolResults(
                                uint64_t avail_dest_va = dest_va + elem_size;
 
                                radeon_emit(cs, PKT3(PKT3_COPY_DATA, 4, 0));
-                               radeon_emit(cs, COPY_DATA_SRC_SEL(COPY_DATA_MEM) |
-                                               COPY_DATA_DST_SEL(COPY_DATA_MEM));
+                               radeon_emit(cs, COPY_DATA_SRC_SEL(COPY_DATA_SRC_MEM) |
+                                               COPY_DATA_DST_SEL(COPY_DATA_DST_MEM_GRBM));
                                radeon_emit(cs, local_src_va);
                                radeon_emit(cs, local_src_va >> 32);
                                radeon_emit(cs, avail_dest_va);
@@ -1062,8 +1062,8 @@ void radv_CmdCopyQueryPoolResults(
                        }
 
                        radeon_emit(cs, PKT3(PKT3_COPY_DATA, 4, 0));
-                       radeon_emit(cs, COPY_DATA_SRC_SEL(COPY_DATA_MEM) |
-                                       COPY_DATA_DST_SEL(COPY_DATA_MEM) |
+                       radeon_emit(cs, COPY_DATA_SRC_SEL(COPY_DATA_SRC_MEM) |
+                                       COPY_DATA_DST_SEL(COPY_DATA_DST_MEM_GRBM) |
                                        ((flags & VK_QUERY_RESULT_64_BIT) ? COPY_DATA_COUNT_SEL : 0));
                        radeon_emit(cs, local_src_va);
                        radeon_emit(cs, local_src_va >> 32);
index e0c6902fec46926d73119b57558e2842a7429726..cbcd8e79c7b21b18a2b9ad83e9b35e793097d466 100644 (file)
@@ -734,7 +734,7 @@ static void si_setup_tgsi_user_data(struct si_context *sctx,
 
                        for (i = 0; i < 3; ++i) {
                                radeon_emit(cs, PKT3(PKT3_COPY_DATA, 4, 0));
-                               radeon_emit(cs, COPY_DATA_SRC_SEL(COPY_DATA_MEM) |
+                               radeon_emit(cs, COPY_DATA_SRC_SEL(COPY_DATA_SRC_MEM) |
                                                COPY_DATA_DST_SEL(COPY_DATA_REG));
                                radeon_emit(cs, (va + 4 * i));
                                radeon_emit(cs, (va + 4 * i) >> 32);
index c4f6e164fb5b7ab47f8af64d0cf0cf65498b0577..de71572c8aa08eb864dcee7e208496391d2d6395 100644 (file)
@@ -559,7 +559,7 @@ static void si_pc_emit_start(struct si_context *sctx,
 
        radeon_emit(cs, PKT3(PKT3_COPY_DATA, 4, 0));
        radeon_emit(cs, COPY_DATA_SRC_SEL(COPY_DATA_IMM) |
-                       COPY_DATA_DST_SEL(COPY_DATA_MEM));
+                       COPY_DATA_DST_SEL(COPY_DATA_DST_MEM_GRBM));
        radeon_emit(cs, 1); /* immediate */
        radeon_emit(cs, 0); /* unused */
        radeon_emit(cs, va);
@@ -616,7 +616,7 @@ static void si_pc_emit_read(struct si_context *sctx,
 
                        radeon_emit(cs, PKT3(PKT3_COPY_DATA, 4, 0));
                        radeon_emit(cs, COPY_DATA_SRC_SEL(COPY_DATA_PERF) |
-                                       COPY_DATA_DST_SEL(COPY_DATA_MEM) |
+                                       COPY_DATA_DST_SEL(COPY_DATA_DST_MEM_GRBM) |
                                        COPY_DATA_COUNT_SEL); /* 64 bits */
                        radeon_emit(cs, reg >> 2);
                        radeon_emit(cs, 0); /* unused */
@@ -629,7 +629,7 @@ static void si_pc_emit_read(struct si_context *sctx,
                for (idx = 0; idx < count; ++idx) {
                        radeon_emit(cs, PKT3(PKT3_COPY_DATA, 4, 0));
                        radeon_emit(cs, COPY_DATA_SRC_SEL(COPY_DATA_IMM) |
-                                       COPY_DATA_DST_SEL(COPY_DATA_MEM) |
+                                       COPY_DATA_DST_SEL(COPY_DATA_DST_MEM_GRBM) |
                                        COPY_DATA_COUNT_SEL);
                        radeon_emit(cs, 0); /* immediate */
                        radeon_emit(cs, 0);
index 80e84c23937a68f01c749b629df466d07964ca57..bdd7e2c060c2433fc374190da7af86803f4a9cf5 100644 (file)
@@ -799,7 +799,7 @@ static void si_query_hw_do_emit_start(struct si_context *sctx,
                radeon_emit(cs, PKT3(PKT3_COPY_DATA, 4, 0));
                radeon_emit(cs, COPY_DATA_COUNT_SEL |
                                COPY_DATA_SRC_SEL(COPY_DATA_TIMESTAMP) |
-                               COPY_DATA_DST_SEL(COPY_DATA_MEM_ASYNC));
+                               COPY_DATA_DST_SEL(COPY_DATA_DST_MEM));
                radeon_emit(cs, 0);
                radeon_emit(cs, 0);
                radeon_emit(cs, va);
index b1d7437edb99a21be4299811b39409e9945cda55..fceb9debc474248d2f5791cd499282779a9514c7 100644 (file)
@@ -671,7 +671,7 @@ static void si_emit_draw_packets(struct si_context *sctx,
                                       t->stride_in_dw);
 
                radeon_emit(cs, PKT3(PKT3_COPY_DATA, 4, 0));
-               radeon_emit(cs, COPY_DATA_SRC_SEL(COPY_DATA_MEM) |
+               radeon_emit(cs, COPY_DATA_SRC_SEL(COPY_DATA_SRC_MEM) |
                            COPY_DATA_DST_SEL(COPY_DATA_REG) |
                            COPY_DATA_WR_CONFIRM);
                radeon_emit(cs, va);     /* src address lo */