From 357c40b56cd78f62181e08b6dac7411144673c32 Mon Sep 17 00:00:00 2001 From: Rafael Antognolli Date: Wed, 14 Mar 2018 15:59:10 -0700 Subject: anv: Enable object level preemption. --- src/intel/vulkan/genX_state.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/intel/vulkan/genX_state.c b/src/intel/vulkan/genX_state.c index c6e5404691..c130fba7b0 100644 --- a/src/intel/vulkan/genX_state.c +++ b/src/intel/vulkan/genX_state.c @@ -169,6 +169,24 @@ genX(init_device_state)(struct anv_device *device) gen10_emit_wa_lri_to_cache_mode_zero(&batch); #endif +#if GEN_GEN >= 9 + /* A fixed function pipe flush is required before modifying this field */ + anv_batch_emit(&batch, GENX(PIPE_CONTROL), pipe) { + pipe.PipeControlFlushEnable = true; + } + + /* enable object level preemption */ + uint32_t csc1; + + anv_pack_struct(&csc1, GENX(CS_CHICKEN1), + .ReplayMode = ObjectLevelPreemption, + .ReplayModeMask = 1); + anv_batch_emit(&batch, GENX(MI_LOAD_REGISTER_IMM), lri) { + lri.RegisterOffset = GENX(CS_CHICKEN1_num); + lri.DataDWord = csc1; + } +#endif + anv_batch_emit(&batch, GENX(MI_BATCH_BUFFER_END), bbe); assert(batch.next <= batch.end); -- cgit v1.2.3