radeonsi: make si_cp_wait_mem more configurable
authorMarek Olšák <marek.olsak@amd.com>
Mon, 3 Dec 2018 19:58:08 +0000 (14:58 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 2 Jan 2019 20:01:54 +0000 (15:01 -0500)
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
src/gallium/drivers/radeonsi/si_fence.c
src/gallium/drivers/radeonsi/si_perfcounter.c
src/gallium/drivers/radeonsi/si_pipe.h
src/gallium/drivers/radeonsi/si_query.c
src/gallium/drivers/radeonsi/si_state_draw.c

index d385f44577408c5eb0597baf777ed3f7468fa96e..b6920c95e34aad8b1fbc8223f72cc22be9ae0134 100644 (file)
@@ -160,13 +160,11 @@ unsigned si_cp_write_fence_dwords(struct si_screen *screen)
        return dwords;
 }
 
-void si_cp_wait_mem(struct si_context *ctx,
+void si_cp_wait_mem(struct si_context *ctx, struct radeon_cmdbuf *cs,
                    uint64_t va, uint32_t ref, uint32_t mask, unsigned flags)
 {
-       struct radeon_cmdbuf *cs = ctx->gfx_cs;
-
        radeon_emit(cs, PKT3(PKT3_WAIT_REG_MEM, 5, 0));
-       radeon_emit(cs, WAIT_REG_MEM_EQUAL | WAIT_REG_MEM_MEM_SPACE(1) | flags);
+       radeon_emit(cs, WAIT_REG_MEM_MEM_SPACE(1) | flags);
        radeon_emit(cs, va);
        radeon_emit(cs, va >> 32);
        radeon_emit(cs, ref); /* reference value */
index fc2c58854bc0860a8e161df79039d130bb2dcac2..f15f310dd11faed11004cb3d14e7ac4a1cf31361 100644 (file)
@@ -701,7 +701,7 @@ static void si_pc_emit_stop(struct si_context *sctx,
                          EOP_DST_SEL_MEM, EOP_INT_SEL_NONE,
                          EOP_DATA_SEL_VALUE_32BIT,
                          buffer, va, 0, SI_NOT_QUERY);
-       si_cp_wait_mem(sctx, va, 0, 0xffffffff, 0);
+       si_cp_wait_mem(sctx, cs, va, 0, 0xffffffff, WAIT_REG_MEM_EQUAL);
 
        radeon_emit(cs, PKT3(PKT3_EVENT_WRITE, 0, 0));
        radeon_emit(cs, EVENT_TYPE(V_028A90_PERFCOUNTER_SAMPLE) | EVENT_INDEX(0));
index 4512d2529afc08fdc0e3804ac6e024ec8ea12199..957629e4633469d3c0ce038321186df50cdffd61 100644 (file)
@@ -1213,7 +1213,7 @@ void si_cp_release_mem(struct si_context *ctx,
                       struct r600_resource *buf, uint64_t va,
                       uint32_t new_fence, unsigned query_type);
 unsigned si_cp_write_fence_dwords(struct si_screen *screen);
-void si_cp_wait_mem(struct si_context *ctx,
+void si_cp_wait_mem(struct si_context *ctx, struct radeon_cmdbuf *cs,
                      uint64_t va, uint32_t ref, uint32_t mask, unsigned flags);
 void si_init_fence_functions(struct si_context *ctx);
 void si_init_screen_fence_functions(struct si_screen *screen);
index 093643bf684a0184a065751781e1b98e59405024..a1563de69702700d1ce138902bba4a6bfb7c06fb 100644 (file)
@@ -1576,7 +1576,8 @@ static void si_query_hw_get_result_resource(struct si_context *sctx,
                        va = qbuf->buf->gpu_address + qbuf->results_end - query->result_size;
                        va += params.fence_offset;
 
-                       si_cp_wait_mem(sctx, va, 0x80000000, 0x80000000, 0);
+                       si_cp_wait_mem(sctx, sctx->gfx_cs, va, 0x80000000,
+                                      0x80000000, WAIT_REG_MEM_EQUAL);
                }
 
                sctx->b.launch_grid(&sctx->b, &grid);
index cfd904e621cd00202c353da64191e3adc8bf3bd3..6454491457bb191113a672c33319e72bba64770a 100644 (file)
@@ -1056,7 +1056,8 @@ void si_emit_cache_flush(struct si_context *sctx)
                                  EOP_DATA_SEL_VALUE_32BIT,
                                  sctx->wait_mem_scratch, va,
                                  sctx->wait_mem_number, SI_NOT_QUERY);
-               si_cp_wait_mem(sctx, va, sctx->wait_mem_number, 0xffffffff, 0);
+               si_cp_wait_mem(sctx, cs, va, sctx->wait_mem_number, 0xffffffff,
+                              WAIT_REG_MEM_EQUAL);
        }
 
        /* Make sure ME is idle (it executes most packets) before continuing.