etnaviv: enable full overwrite when no color buffer is present
authorLucas Stach <l.stach@pengutronix.de>
Wed, 15 Nov 2017 16:33:17 +0000 (17:33 +0100)
committerLucas Stach <dev@lynxeye.de>
Sat, 18 Nov 2017 11:33:49 +0000 (12:33 +0100)
The OVERWRITE bit disables destination fetches, which is exactly what
we want when there is no valid color buffer bound.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com>
src/gallium/drivers/etnaviv/etnaviv_blend.c
src/gallium/drivers/etnaviv/etnaviv_state.c

index 1b432bd68715586ecec53852468243f9ec05360a..9c23411d4ff777248c393ce4291353a4aaebf506 100644 (file)
@@ -131,8 +131,8 @@ etna_update_blend(struct etna_context *ctx)
     * - The color mask is 1111
     * - No blending is used
     */
-   bool full_overwrite = (rt0->colormask == 0xf) &&
-                         blend->fo_allowed;
+   bool full_overwrite = ((rt0->colormask == 0xf) && blend->fo_allowed) ||
+                         !pfb->cbufs[0];
    blend->PE_COLOR_FORMAT =
             VIVS_PE_COLOR_FORMAT_COMPONENTS(colormask) |
             COND(full_overwrite, VIVS_PE_COLOR_FORMAT_OVERWRITE);
index 59a72816462513e5c6c8527b2d8f83650d35e77b..004e3cd132dcb051709d62b2fa79248789278b97 100644 (file)
@@ -185,7 +185,7 @@ etna_set_framebuffer_state(struct pipe_context *pctx,
       /* Clearing VIVS_PE_COLOR_FORMAT_COMPONENTS__MASK and
        * VIVS_PE_COLOR_FORMAT_OVERWRITE prevents us from overwriting the
        * color target */
-      cs->PE_COLOR_FORMAT = 0;
+      cs->PE_COLOR_FORMAT = VIVS_PE_COLOR_FORMAT_OVERWRITE;
       cs->PE_COLOR_STRIDE = 0;
       cs->TS_COLOR_STATUS_BASE.bo = NULL;
       cs->TS_COLOR_SURFACE_BASE.bo = NULL;