[Mesa-dev] [PATCH 16/16] i965/icl: Add render target flush after uploading binding table

Kenneth Graunke kenneth at whitecape.org
Wed Feb 14 00:17:30 UTC 2018


On Tuesday, February 13, 2018 11:15:16 AM PST Anuj Phogat wrote:
> From PIPE_CONTROL command description in gfxspecs:
> 
> "Whenever a Binding Table Index (BTI) used by a Render Taget Message
>  points to a different RENDER_SURFACE_STATE, SW must issue a Render
>  Target Cache Flush by enabling this bit. When render target flush
>  is set due to new association of BTI, PS Scoreboard Stall bit must
>  be set in this packet."
> 
> Fixes a fulsim error and a GPU hang described in below JIRA.
> 
> JIRA: MD5-322
> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
> ---
>  src/mesa/drivers/dri/i965/brw_binding_tables.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_binding_tables.c b/src/mesa/drivers/dri/i965/brw_binding_tables.c
> index 73f5e56010..170daebc24 100644
> --- a/src/mesa/drivers/dri/i965/brw_binding_tables.c
> +++ b/src/mesa/drivers/dri/i965/brw_binding_tables.c
> @@ -93,6 +93,20 @@ brw_upload_binding_table(struct brw_context *brw,
>        OUT_BATCH(stage_state->bind_bo_offset);
>        ADVANCE_BATCH();
>     }
> +
> +   /* From PIPE_CONTROL command description in gfxspecs:
> +
> +      "Whenever a Binding Table Index (BTI) used by a Render Taget Message
> +       points to a different RENDER_SURFACE_STATE, SW must issue a Render
> +       Target Cache Flush by enabling this bit. When render target flush
> +       is set due to new association of BTI, PS Scoreboard Stall bit must
> +       be set in this packet."
> +   */
> +   if (devinfo->gen >= 11) {
> +      brw_emit_pipe_control_flush(brw,
> +                                  PIPE_CONTROL_RENDER_TARGET_FLUSH |
> +                                  PIPE_CONTROL_STALL_AT_SCOREBOARD);
> +   }
>  }
>  
>  /**
> 

This is overkill.  It'll do a RT flush when we change the binding
tables in any stage, for any reason.  Only the pixel shader's binding
tables have render target surfaces.  And, we might change other surfaces
(textures, UBOs, etc) without changing the render targets.

I would move this to update_renderbuffer_surfaces() in
brw_wm_surface_state.c.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180213/7224cdb3/attachment.sig>


More information about the mesa-dev mailing list