I'd like to be able to move the prefetch call site around.
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
}
}
-static void cik_emit_prefetch_L2(struct si_context *sctx, struct r600_atom *atom)
+void cik_emit_prefetch_L2(struct si_context *sctx)
{
/* Prefetch shaders and VBO descriptors to TC L2. */
if (si_pm4_state_changed(sctx, ls))
}
if (si_pm4_state_changed(sctx, ps))
cik_prefetch_shader_async(sctx, sctx->queued.named.ps);
+
+ sctx->prefetch_L2 = false;
}
void si_init_cp_dma_functions(struct si_context *sctx)
{
sctx->b.clear_buffer = si_clear_buffer;
-
- si_init_atom(sctx, &sctx->prefetch_L2, &sctx->atoms.s.prefetch_L2,
- cik_emit_prefetch_L2);
}
* cache is needed. */
si_mark_atom_dirty(sctx, &sctx->shader_userdata.atom);
if (sctx->b.chip_class >= CIK)
- si_mark_atom_dirty(sctx, &sctx->prefetch_L2);
+ sctx->prefetch_L2 = true;
sctx->vertex_buffers_dirty = false;
sctx->vertex_buffer_pointer_dirty = true;
return true;
si_ce_restore_all_descriptors_at_ib_start(ctx);
if (ctx->b.chip_class >= CIK)
- si_mark_atom_dirty(ctx, &ctx->prefetch_L2);
+ ctx->prefetch_L2 = true;
/* CLEAR_STATE disables all colorbuffers, so only enable bound ones. */
ctx->framebuffer.dirty_cbufs =
bool gfx_flush_in_progress:1;
bool compute_is_busy:1;
+ bool prefetch_L2:1;
/* Atoms (direct states). */
union si_state_atoms atoms;
union si_state emitted;
/* Atom declarations. */
- struct r600_atom prefetch_L2;
struct si_framebuffer framebuffer;
struct si_sample_locs msaa_sample_locs;
struct r600_atom db_render_state;
unsigned user_flags);
void cik_prefetch_TC_L2_async(struct si_context *sctx, struct pipe_resource *buf,
uint64_t offset, unsigned size);
+void cik_emit_prefetch_L2(struct si_context *sctx);
void si_init_cp_dma_functions(struct si_context *sctx);
/* si_debug.c */
union si_state_atoms {
struct {
/* The order matters. */
- struct r600_atom *prefetch_L2;
struct r600_atom *render_cond;
struct r600_atom *streamout_begin;
struct r600_atom *streamout_enable; /* must be after streamout_begin */
if (sctx->b.flags)
si_emit_cache_flush(sctx);
+ if (sctx->prefetch_L2)
+ cik_emit_prefetch_L2(sctx);
+
/* Emit state atoms. */
mask = sctx->dirty_atoms;
while (mask) {
}
if (sctx->b.chip_class >= CIK)
- si_mark_atom_dirty(sctx, &sctx->prefetch_L2);
+ sctx->prefetch_L2 = true;
sctx->do_update_shaders = false;
return true;