panfrost: Use correct NO_DITHER field on MFBD
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 17 Jul 2019 23:19:45 +0000 (16:19 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 18 Jul 2019 17:42:43 +0000 (10:42 -0700)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/gallium/drivers/panfrost/pan_blend_cso.c
src/gallium/drivers/panfrost/pan_context.c
src/panfrost/include/panfrost-job.h

index f2dafe062cecd61740a9c7536339cb82be40d5df..5055d2d854e840ff8a18c799099d16884e1b8122 100644 (file)
@@ -142,7 +142,9 @@ panfrost_bind_blend_state(struct pipe_context *pipe,
         if (!blend)
                 return;
 
-        SET_BIT(ctx->fragment_shader_core.unknown2_4, MALI_NO_DITHER, !blend->dither);
+        if (ctx->require_sfbd) {
+                SET_BIT(ctx->fragment_shader_core.unknown2_4, MALI_NO_DITHER, !blend->dither);
+        }
 
         /* Shader itself is not dirty, but the shader core is */
         ctx->dirty |= PAN_DIRTY_FS;
index 26276cde0738bccb8c63a76e19b1c4f9db731303..c022e950c001221eed621b79711770d341d6a6c8 100644 (file)
@@ -1225,6 +1225,9 @@ panfrost_emit_for_draw(struct panfrost_context *ctx, bool with_vertex_data)
                                 if (is_srgb)
                                         rts[i].flags |= MALI_BLEND_SRGB;
 
+                                if (!ctx->blend->base.dither)
+                                        rts[i].flags |= MALI_BLEND_NO_DITHER;
+
                                 /* TODO: sRGB in blend shaders is currently
                                  * unimplemented. Contact me (Alyssa) if you're
                                  * interested in working on this. We have
index 297d0806adcee227645484f5732ffd43efd65adf..b7312a60720ea26cfa139a6e678b5b1cf25bf3a8 100644 (file)
@@ -439,6 +439,9 @@ union midgard_blend {
 
 #define MALI_BLEND_SRGB (0x400)
 
+/* Dithering is specified here for MFBD, otherwise NO_DITHER for SFBD */
+#define MALI_BLEND_NO_DITHER (0x800)
+
 struct midgard_blend_rt {
         /* Flags base value of 0x200 to enable the render target.
          * OR with 0x1 for blending (anything other than REPLACE).