panfrost: Drop implicit blend pooling
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 17 Aug 2020 23:32:59 +0000 (19:32 -0400)
committerTomeu Vizoso <tomeu.vizoso@collabora.com>
Thu, 20 Aug 2020 16:15:00 +0000 (18:15 +0200)
We dropped blend shader pools a long time ago for various reasons, but
the indirection required remained. Oops.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6373>

src/gallium/drivers/panfrost/pan_blend.h
src/gallium/drivers/panfrost/pan_blend_cso.c
src/gallium/drivers/panfrost/pan_cmdstream.c

index 49ad8d9b3d743d1c412db41b835e9b031168910a..22993dd94a97e2024a216c0fd7bd42878811673a 100644 (file)
@@ -115,7 +115,7 @@ void
 panfrost_blend_context_init(struct pipe_context *pipe);
 
 struct panfrost_blend_final
-panfrost_get_blend_for_context(struct panfrost_context *ctx, unsigned rt, struct panfrost_bo **bo, unsigned *shader_offset);
+panfrost_get_blend_for_context(struct panfrost_context *ctx, unsigned rt);
 
 struct panfrost_blend_shader *
 panfrost_get_blend_shader(
index 01b4fd33a105fa4873056d2224ab9d0d44579c74..1e5c1bf072e1d6be5099a8d9ea93fa77d07434e8 100644 (file)
@@ -219,7 +219,7 @@ panfrost_blend_constant(float *out, float *in, unsigned mask)
 /* Create a final blend given the context */
 
 struct panfrost_blend_final
-panfrost_get_blend_for_context(struct panfrost_context *ctx, unsigned rti, struct panfrost_bo **bo, unsigned *shader_offset)
+panfrost_get_blend_for_context(struct panfrost_context *ctx, unsigned rti)
 {
         struct panfrost_batch *batch = panfrost_get_batch_for_fbo(ctx);
 
@@ -268,32 +268,24 @@ panfrost_get_blend_for_context(struct panfrost_context *ctx, unsigned rti, struc
         final.shader.work_count = shader->work_count;
         final.shader.first_tag = shader->first_tag;
 
-        /* Upload the shader, sharing a BO */
-        if (!(*bo)) {
-                *bo = panfrost_batch_create_bo(batch, 4096,
+        /* Upload the shader */
+        struct panfrost_bo *bo = panfrost_batch_create_bo(batch, shader->size,
                    PAN_BO_EXECUTE,
                    PAN_BO_ACCESS_PRIVATE |
                    PAN_BO_ACCESS_READ |
-                   PAN_BO_ACCESS_VERTEX_TILER |
                    PAN_BO_ACCESS_FRAGMENT);
-        }
-
-        /* Size check */
-        assert((*shader_offset + shader->size) < 4096);
 
-        memcpy((*bo)->cpu + *shader_offset, shader->buffer, shader->size);
-        final.shader.gpu = (*bo)->gpu + *shader_offset;
+        memcpy(bo->cpu, shader->buffer, shader->size);
+        final.shader.gpu = bo->gpu;
 
         if (shader->patch_index) {
                 /* We have to specialize the blend shader to use constants, so
                  * patch in the current constants */
 
-                float *patch = (float *) ((*bo)->cpu + *shader_offset + shader->patch_index);
+                float *patch = (float *) (bo->cpu + shader->patch_index);
                 memcpy(patch, ctx->blend_color.color, sizeof(float) * 4);
         }
 
-        *shader_offset += shader->size;
-
         return final;
 }
 
index bd01daccf91439111fd4a9e8fe83f9aadc0fe087..d3bbf40f6dcdf419fee8b7861fbe30c944055f41 100644 (file)
@@ -554,12 +554,9 @@ panfrost_frag_meta_blend_update(struct panfrost_context *ctx,
         unsigned rt_count = MAX2(ctx->pipe_framebuffer.nr_cbufs, 1);
 
         struct panfrost_blend_final blend[PIPE_MAX_COLOR_BUFS];
-        unsigned shader_offset = 0;
-        struct panfrost_bo *shader_bo = NULL;
 
         for (unsigned c = 0; c < rt_count; ++c)
-                blend[c] = panfrost_get_blend_for_context(ctx, c, &shader_bo,
-                                                          &shader_offset);
+                blend[c] = panfrost_get_blend_for_context(ctx, c);
 
         /* Disable shader execution if we can */
         if (dev->quirks & MIDGARD_SHADERLESS