OSDN Git Service

broadcom/vc4: Fix use-after-free trying to mix a quad and tile clear.
authorEric Anholt <eric@anholt.net>
Mon, 18 Sep 2017 22:17:31 +0000 (15:17 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 18 Sep 2017 23:16:00 +0000 (16:16 -0700)
commit9940fb42058e0b0815e0edb202ca69b7853aead5
tree5238c20c875aede58c2db1ab9c209761c04dc948
parentd88a75182d5fccb956fbfccddf627aa1831465be
broadcom/vc4: Fix use-after-free trying to mix a quad and tile clear.

The blitter will bind just the depth buffer, which flushes the current job
if we had both a color and depth/stencil.  If the clear was doing partial
depth/stencil (quad-based) and color (tile-based), we'd go on to try to
set up the rest of the tile clear in the now flushed job.

Instead, move the partial clear up before we start setting up the job for
the current FBO state, and re-fetch the job if we're continuing on to a
tile-based clear.  Fixes valgrind failures in fbo-depthtex.

Fixes: 9421a6065c4e ("vc4: Fix fallback to quad clears of depth in GLX.")
src/gallium/drivers/vc4/vc4_draw.c