Gallium computes it for us.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5782>
 
         fs = panfrost_get_shader_state(ctx, PIPE_SHADER_FRAGMENT);
 
-        fragmeta->coverage_mask = 0xFFFF;
+        bool msaa = ctx->rasterizer && ctx->rasterizer->base.multisample;
+        fragmeta->coverage_mask = (msaa ? ctx->sample_mask : ~0) & 0xF;
+
         fragmeta->unknown2_3 = MALI_DEPTH_FUNC(MALI_FUNC_ALWAYS) | 0x10;
         fragmeta->unknown2_4 = 0x4e0;
 
 
 panfrost_set_sample_mask(struct pipe_context *pipe,
                          unsigned sample_mask)
 {
+        struct panfrost_context *ctx = pan_context(pipe);
+        ctx->sample_mask = sample_mask;
 }
 
 static void
         panfrost_batch_init(ctx);
         panfrost_invalidate_frame(ctx);
 
+        /* By default mask everything on */
+        ctx->sample_mask = ~0;
+
         return gallium;
 }
 
         struct pipe_blend_color blend_color;
         struct pipe_depth_stencil_alpha_state *depth_stencil;
         struct pipe_stencil_ref stencil_ref;
+        unsigned sample_mask;
 };
 
 /* Corresponds to the CSO */