#include "si_public.h"
#include "si_shader_internal.h"
#include "sid.h"
+#include "ac_shadowed_regs.h"
#include "util/disk_cache.h"
#include "util/u_log.h"
#include "util/u_memory.h"
{"check_vm", DBG(CHECK_VM), "Check VM faults and dump debug info."},
{"reserve_vmid", DBG(RESERVE_VMID), "Force VMID reservation per context."},
{"zerovram", DBG(ZERO_VRAM), "Clear VRAM allocations."},
+ {"shadowregs", DBG(SHADOW_REGS), "Enable CP register shadowing."},
/* 3D engine options: */
{"nogfx", DBG(NO_GFX), "Disable graphics. Only multimedia compute paths can be used."},
si_resource_reference(&sctx->index_ring, NULL);
si_resource_reference(&sctx->barrier_buf, NULL);
si_resource_reference(&sctx->last_ib_barrier_buf, NULL);
+ si_resource_reference(&sctx->shadowed_regs, NULL);
pb_reference(&sctx->gds, NULL);
pb_reference(&sctx->gds_oa, NULL);
* https://gitlab.freedesktop.org/mesa/mesa/-/issues/1889
*/
(sctx->chip_class != GFX8 || sscreen->debug_flags & DBG(FORCE_SDMA)) &&
+ /* SDMA causes corruption on gfx9 APUs:
+ * https://gitlab.freedesktop.org/mesa/mesa/-/issues/2814
+ *
+ * While we could keep buffer copies and clears enabled, let's disable
+ * everything, because neither gfx8 nor gfx10 enable SDMA, and it's not
+ * easy to test.
+ */
+ (sctx->chip_class != GFX9 || sscreen->debug_flags & DBG(FORCE_SDMA)) &&
/* SDMA timeouts sometimes on gfx10 so disable it for now. See:
* https://bugs.freedesktop.org/show_bug.cgi?id=111481
* https://gitlab.freedesktop.org/mesa/mesa/-/issues/1907
si_init_msaa_functions(sctx);
si_init_shader_functions(sctx);
si_init_state_functions(sctx);
- si_init_cs_preamble_state(sctx);
si_init_streamout_functions(sctx);
si_init_viewport_functions(sctx);
/* The remainder of this function initializes the gfx CS and must be last. */
assert(sctx->gfx_cs->current.cdw == 0);
- si_begin_new_gfx_cs(sctx);
+
+ if (sctx->has_graphics) {
+ si_init_cp_reg_shadowing(sctx);
+ }
+
+ si_begin_new_gfx_cs(sctx, true);
assert(sctx->gfx_cs->current.cdw == sctx->initial_gfx_cs_size);
/* Initialize per-context buffers. */
RADEON_DOMAIN_OA);
}
+ ac_print_shadowed_regs(&sscreen->info);
+
STATIC_ASSERT(sizeof(union si_vgt_stages_key) == 4);
return &sscreen->b;
}