freedreno/a6xx: fix lrz overflow
authorRob Clark <robdclark@chromium.org>
Sun, 12 Jan 2020 01:30:24 +0000 (17:30 -0800)
committerMarge Bot <eric+marge@anholt.net>
Sat, 1 Feb 2020 02:40:22 +0000 (02:40 +0000)
Running the complete deqp_gles2 seems to trigger an overflow in lrz
cmdstream.  We skip the blit clear fast-path if there have been any
draws (so mid-batch clears of any attached buffer hit the 3d pipe).
Which means it is safe to simply discard any lrz clear rendering.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3569>

src/gallium/drivers/freedreno/a6xx/fd6_draw.c

index 013efb3..18f741f 100644 (file)
@@ -350,16 +350,11 @@ fd6_clear_lrz(struct fd_batch *batch, struct fd_resource *zsbuf, double depth)
        struct fd_ringbuffer *ring;
        struct fd6_context *fd6_ctx = fd6_context(batch->ctx);
 
-       // TODO mid-frame clears (ie. app doing crazy stuff)??  Maybe worth
-       // splitting both clear and lrz clear out into their own rb's.  And
-       // just throw away any draws prior to clear.  (Anything not fullscreen
-       // clear, just fallback to generic path that treats it as a normal
-       // draw
-
-       if (!batch->lrz_clear) {
-               batch->lrz_clear = fd_submit_new_ringbuffer(batch->submit, 0x1000, 0);
+       if (batch->lrz_clear) {
+               fd_ringbuffer_del(batch->lrz_clear);
        }
 
+       batch->lrz_clear = fd_submit_new_ringbuffer(batch->submit, 0x1000, 0);
        ring = batch->lrz_clear;
 
        emit_marker6(ring, 7);