radeonsi: Enable loading into CE RAM.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Wed, 20 Apr 2016 23:22:02 +0000 (01:22 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Thu, 21 Apr 2016 10:50:58 +0000 (12:50 +0200)
We need to enable a bit in the CONTEXT_CONTROL packet for the
loads to work.

v2: Style issues.

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_descriptors.c
src/gallium/drivers/radeonsi/si_hw_context.c
src/gallium/drivers/radeonsi/si_state.h

index 1580e61e17f837056e62a01d94cbf8e72a9787e5..2306a8b23ec53415eccbc900166a639f6a42bdb2 100644 (file)
@@ -185,6 +185,14 @@ static void si_reinitialize_ce_ram(struct si_context *sctx,
        desc->ce_ram_dirty = false;
 }
 
+void si_ce_enable_loads(struct radeon_winsys_cs *ib)
+{
+       radeon_emit(ib, PKT3(PKT3_CONTEXT_CONTROL, 1, 0));
+       radeon_emit(ib, CONTEXT_CONTROL_LOAD_ENABLE(1) |
+                       CONTEXT_CONTROL_LOAD_CE_RAM(1));
+       radeon_emit(ib, CONTEXT_CONTROL_SHADOW_ENABLE(1));
+}
+
 static bool si_upload_descriptors(struct si_context *sctx,
                                  struct si_descriptors *desc,
                                  struct r600_atom * atom)
index e3abb7f67cc4179a616dac816228e94318e64ac4..e6018f3b29dd3f51578767c265c38ff91a8beb8b 100644 (file)
@@ -202,6 +202,11 @@ void si_begin_new_cs(struct si_context *ctx)
        if (ctx->init_config_gs_rings)
                si_pm4_emit(ctx, ctx->init_config_gs_rings);
 
+       if (ctx->ce_preamble_ib)
+               si_ce_enable_loads(ctx->ce_preamble_ib);
+       else if (ctx->ce_ib)
+               si_ce_enable_loads(ctx->ce_ib);
+
        ctx->framebuffer.dirty_cbufs = (1 << 8) - 1;
        ctx->framebuffer.dirty_zsbuf = true;
        si_mark_atom_dirty(ctx, &ctx->framebuffer.atom);
index c4b2b458241c63c14050e3bb812fa73b78e79f67..cbe91dd43d7214ad50713df047abfaa4e5b70191 100644 (file)
@@ -251,6 +251,7 @@ struct si_buffer_resources {
        } while(0)
 
 /* si_descriptors.c */
+void si_ce_enable_loads(struct radeon_winsys_cs *ib);
 void si_set_ring_buffer(struct pipe_context *ctx, uint shader, uint slot,
                        struct pipe_resource *buffer,
                        unsigned stride, unsigned num_records,