summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2014-01-22 02:02:18 +0100
committerMarek Olšák <[email protected]>2014-01-28 01:39:42 +0100
commita4c218f398a6176f2ecbe7e295020d348670a957 (patch)
treeda191a95391994e2c698c04451ff5d76c8277c17 /src/gallium/drivers/r600
parentba0c16f7b2283db9dbeef036cf54dd6b694e4eaa (diff)
r600g,radeonsi: consolidate variables for CS tracing
Reviewed-by: Michel Dänzer <[email protected]> Reviewed-by: Tom Stellard <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600')
-rw-r--r--src/gallium/drivers/r600/r600_hw_context.c6
-rw-r--r--src/gallium/drivers/r600/r600_pipe.c18
-rw-r--r--src/gallium/drivers/r600/r600_pipe.h5
-rw-r--r--src/gallium/drivers/r600/r600_state_common.c8
4 files changed, 17 insertions, 20 deletions
diff --git a/src/gallium/drivers/r600/r600_hw_context.c b/src/gallium/drivers/r600/r600_hw_context.c
index d6b0280affa..9b0c558c29e 100644
--- a/src/gallium/drivers/r600/r600_hw_context.c
+++ b/src/gallium/drivers/r600/r600_hw_context.c
@@ -54,7 +54,7 @@ void r600_need_cs_space(struct r600_context *ctx, unsigned num_dw,
for (i = 0; i < R600_NUM_ATOMS; i++) {
if (ctx->atoms[i] && ctx->atoms[i]->dirty) {
num_dw += ctx->atoms[i]->num_dw;
- if (ctx->screen->trace_bo) {
+ if (ctx->screen->b.trace_bo) {
num_dw += R600_TRACE_CS_DWORDS;
}
}
@@ -62,7 +62,7 @@ void r600_need_cs_space(struct r600_context *ctx, unsigned num_dw,
/* The upper-bound of how much space a draw command would take. */
num_dw += R600_MAX_FLUSH_CS_DWORDS + R600_MAX_DRAW_CS_DWORDS;
- if (ctx->screen->trace_bo) {
+ if (ctx->screen->b.trace_bo) {
num_dw += R600_TRACE_CS_DWORDS;
}
}
@@ -270,7 +270,7 @@ void r600_context_flush(struct r600_context *ctx, unsigned flags)
}
/* Flush the CS. */
- ctx->b.ws->cs_flush(ctx->b.rings.gfx.cs, flags, ctx->screen->cs_count++);
+ ctx->b.ws->cs_flush(ctx->b.rings.gfx.cs, flags, ctx->screen->b.cs_count++);
}
void r600_begin_new_cs(struct r600_context *ctx)
diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
index a7138969d96..eec04bfaebb 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -259,8 +259,8 @@ static struct pipe_context *r600_create_context(struct pipe_screen *screen, void
goto fail;
}
- if (rscreen->trace_bo) {
- rctx->b.rings.gfx.cs = rctx->b.ws->cs_create(rctx->b.ws, RING_GFX, rscreen->trace_bo->cs_buf);
+ if (rscreen->b.trace_bo) {
+ rctx->b.rings.gfx.cs = rctx->b.ws->cs_create(rctx->b.ws, RING_GFX, rscreen->b.trace_bo->cs_buf);
} else {
rctx->b.rings.gfx.cs = rctx->b.ws->cs_create(rctx->b.ws, RING_GFX, NULL);
}
@@ -743,9 +743,9 @@ static void r600_destroy_screen(struct pipe_screen* pscreen)
compute_memory_pool_delete(rscreen->global_pool);
}
- if (rscreen->trace_bo) {
- rscreen->b.ws->buffer_unmap(rscreen->trace_bo->cs_buf);
- pipe_resource_reference((struct pipe_resource**)&rscreen->trace_bo, NULL);
+ if (rscreen->b.trace_bo) {
+ rscreen->b.ws->buffer_unmap(rscreen->b.trace_bo->cs_buf);
+ pipe_resource_reference((struct pipe_resource**)&rscreen->b.trace_bo, NULL);
}
rscreen->b.ws->destroy(rscreen->b.ws);
@@ -860,14 +860,14 @@ struct pipe_screen *r600_screen_create(struct radeon_winsys *ws)
rscreen->global_pool = compute_memory_pool_new(rscreen);
- rscreen->cs_count = 0;
+ rscreen->b.cs_count = 0;
if (rscreen->b.info.drm_minor >= 28 && (rscreen->b.debug_flags & DBG_TRACE_CS)) {
- rscreen->trace_bo = (struct r600_resource*)pipe_buffer_create(&rscreen->b.b,
+ rscreen->b.trace_bo = (struct r600_resource*)pipe_buffer_create(&rscreen->b.b,
PIPE_BIND_CUSTOM,
PIPE_USAGE_STAGING,
4096);
- if (rscreen->trace_bo) {
- rscreen->trace_ptr = rscreen->b.ws->buffer_map(rscreen->trace_bo->cs_buf, NULL,
+ if (rscreen->b.trace_bo) {
+ rscreen->b.trace_ptr = rscreen->b.ws->buffer_map(rscreen->b.trace_bo->cs_buf, NULL,
PIPE_TRANSFER_UNSYNCHRONIZED);
}
}
diff --git a/src/gallium/drivers/r600/r600_pipe.h b/src/gallium/drivers/r600/r600_pipe.h
index 101d7405ee1..112cb269d85 100644
--- a/src/gallium/drivers/r600/r600_pipe.h
+++ b/src/gallium/drivers/r600/r600_pipe.h
@@ -204,9 +204,6 @@ struct r600_screen {
* XXX: Not sure if this is the best place for global_pool. Also,
* it's not thread safe, so it won't work with multiple contexts. */
struct compute_memory_pool *global_pool;
- struct r600_resource *trace_bo;
- uint32_t *trace_ptr;
- unsigned cs_count;
};
struct r600_pipe_sampler_view {
@@ -461,7 +458,7 @@ static INLINE void r600_emit_atom(struct r600_context *rctx, struct r600_atom *a
{
atom->emit(&rctx->b, atom);
atom->dirty = false;
- if (rctx->screen->trace_bo) {
+ if (rctx->screen->b.trace_bo) {
r600_trace_emit(rctx);
}
}
diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c
index 3a6f16753f4..d8fab1083e1 100644
--- a/src/gallium/drivers/r600/r600_state_common.c
+++ b/src/gallium/drivers/r600/r600_state_common.c
@@ -1389,7 +1389,7 @@ static void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info
(info.count_from_stream_output ? S_0287F0_USE_OPAQUE(1) : 0);
}
- if (rctx->screen->trace_bo) {
+ if (rctx->screen->b.trace_bo) {
r600_trace_emit(rctx);
}
@@ -2190,13 +2190,13 @@ void r600_trace_emit(struct r600_context *rctx)
uint64_t va;
uint32_t reloc;
- va = r600_resource_va(&rscreen->b.b, (void*)rscreen->trace_bo);
- reloc = r600_context_bo_reloc(&rctx->b, &rctx->b.rings.gfx, rscreen->trace_bo, RADEON_USAGE_READWRITE);
+ va = r600_resource_va(&rscreen->b.b, (void*)rscreen->b.trace_bo);
+ reloc = r600_context_bo_reloc(&rctx->b, &rctx->b.rings.gfx, rscreen->b.trace_bo, RADEON_USAGE_READWRITE);
radeon_emit(cs, PKT3(PKT3_MEM_WRITE, 3, 0));
radeon_emit(cs, va & 0xFFFFFFFFUL);
radeon_emit(cs, (va >> 32UL) & 0xFFUL);
radeon_emit(cs, cs->cdw);
- radeon_emit(cs, rscreen->cs_count);
+ radeon_emit(cs, rscreen->b.cs_count);
radeon_emit(cs, PKT3(PKT3_NOP, 0, 0));
radeon_emit(cs, reloc);
}