From: Lionel Landwerlin Date: Mon, 13 Jan 2020 15:50:36 +0000 (+0200) Subject: anv: Implement Gen12 workaround for non pipelined state X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b34422db5e6693a8651364556b49a5c3a3b2300a;p=mesa.git anv: Implement Gen12 workaround for non pipelined state Signed-off-by: Lionel Landwerlin Reviewed-by: Jordan Justen Tested-by: Marge Bot Part-of: --- diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 7f1d5ae4969..addd5e80b49 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -76,6 +76,20 @@ genX(cmd_buffer_emit_state_base_address)(struct anv_cmd_buffer *cmd_buffer) #endif } +#if GEN_GEN == 12 + /* GEN:BUG:1607854226: + * + * Workaround the non pipelined state not applying in MEDIA/GPGPU pipeline + * mode by putting the pipeline temporarily in 3D mode. + */ + if (cmd_buffer->state.current_pipeline != _3D) { + anv_batch_emit(&cmd_buffer->batch, GENX(PIPELINE_SELECT), ps) { + ps.MaskBits = 3; + ps.PipelineSelection = _3D; + } + } +#endif + anv_batch_emit(&cmd_buffer->batch, GENX(STATE_BASE_ADDRESS), sba) { sba.GeneralStateBaseAddress = (struct anv_address) { NULL, 0 }; sba.GeneralStateMOCS = mocs; @@ -155,6 +169,19 @@ genX(cmd_buffer_emit_state_base_address)(struct anv_cmd_buffer *cmd_buffer) # endif } +#if GEN_GEN == 12 + /* GEN:BUG:1607854226: + * + * Put the pipeline back into compute mode. + */ + if (cmd_buffer->state.current_pipeline != _3D) { + anv_batch_emit(&cmd_buffer->batch, GENX(PIPELINE_SELECT), ps) { + ps.MaskBits = 3; + ps.PipelineSelection = cmd_buffer->state.current_pipeline; + } + } +#endif + /* After re-setting the surface state base address, we have to do some * cache flusing so that the sampler engine will pick up the new * SURFACE_STATE objects and binding tables. From the Broadwell PRM,