[Mesa-stable] [Mesa-dev] [PATCH] anv/blorp: Emit depth flush and stall prior to HiZ clears

Jason Ekstrand jason at jlekstrand.net
Fri Aug 31 21:41:54 UTC 2018


On Fri, Aug 31, 2018 at 4:35 PM Nanley Chery <nanleychery at gmail.com> wrote:

> On Fri, Aug 31, 2018 at 04:04:22PM -0500, Jason Ekstrand wrote:
> > We had the flush/stall after the clear but missed the one that needs to
> > go before the clear.
> >
>
> Does this fix the GPU Hang in DiRT 3?
>

It appears to mostly fix it, yes.  The remaining hanging seems like it's
maybe a kernel hang?


> > Cc: mesa-stable at lists.freedesktop.org
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107760
> > ---
> >  src/intel/vulkan/anv_blorp.c | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> >
> > diff --git a/src/intel/vulkan/anv_blorp.c b/src/intel/vulkan/anv_blorp.c
> > index 3dfc8087630..532e8185c0e 100644
> > --- a/src/intel/vulkan/anv_blorp.c
> > +++ b/src/intel/vulkan/anv_blorp.c
> > @@ -1605,6 +1605,16 @@ anv_image_hiz_clear(struct anv_cmd_buffer
> *cmd_buffer,
> >                                     ISL_AUX_USAGE_NONE, &stencil);
> >     }
> >
> > +   /* From the Sky Lake PRM Volume 7, "Depth Buffer Clear":
> > +    *
> > +    *    "If other rendering operations have preceded this clear, a
> > +    *    PIPE_CONTROL with depth cache flush enabled, Depth Stall bit
> enabled
> > +    *    must be issued before the rectangle primitive used for the
> depth
> > +    *    buffer clear operation."
> > +    */
> > +   cmd_buffer->state.pending_pipe_bits |=
> > +      ANV_PIPE_DEPTH_CACHE_FLUSH_BIT | ANV_PIPE_DEPTH_STALL_BIT;
> > +
>
> The PRMs say this pipecontrol is needed only if you're doing a clear
> with WM_STATE or 3DSTATE_WM.
>

It does seem to imply that, yes.  In GL, we just pull out the big hammer
and surrournd every HZ op with that pipe control on both ends regardless of
what kind of HiZ op it is.  I know I found cases in GL where these sorts of
flushes are needed around ambiguates as well.


> I wonder if we should be doing the pipecontrol that comes after
> blorp_hiz_clear_depth_stencil() in the case of stencil-only HIZ clears
> as well?
>

Probably?  But I don't think that's related.  The hang I observed was with
a depth resolve immediately followed by a fast clear.


> If that doesn't fix it, I think it'd be good to comment that we've
> observed this pipecontrol be necessary for 3DSTATE_WM_HZ_OP.
>

 I'm happy to add some comments.  We just need to decide how big of a
hammer to use.  Like I said above, in GL we pull out a pretty big one.

--Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-stable/attachments/20180831/52a64e72/attachment.html>


More information about the mesa-stable mailing list