Mesa (main): panfrost: Don't ralloc panfrost_blend_state

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jul 7 13:34:29 UTC 2021


Module: Mesa
Branch: main
Commit: c08dd038dc7278ede3c0bb7712910b382739ac6e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c08dd038dc7278ede3c0bb7712910b382739ac6e

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Tue Jul  6 17:55:21 2021 -0400

panfrost: Don't ralloc panfrost_blend_state

Pointless divergence from other CSO creates.

Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Acked-by: Boris Brezillon <boris.brezillon at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11745>

---

 src/gallium/drivers/panfrost/pan_cmdstream.c | 3 +--
 src/gallium/drivers/panfrost/pan_context.c   | 8 +-------
 2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c
index e5f972ff3d5..965108a2415 100644
--- a/src/gallium/drivers/panfrost/pan_cmdstream.c
+++ b/src/gallium/drivers/panfrost/pan_cmdstream.c
@@ -3456,9 +3456,8 @@ static void *
 panfrost_create_blend_state(struct pipe_context *pipe,
                             const struct pipe_blend_state *blend)
 {
-        struct panfrost_context *ctx = pan_context(pipe);
         struct panfrost_device *dev = pan_device(pipe->screen);
-        struct panfrost_blend_state *so = rzalloc(ctx, struct panfrost_blend_state);
+        struct panfrost_blend_state *so = CALLOC_STRUCT(panfrost_blend_state);
         so->base = *blend;
 
         so->pan.logicop_enable = blend->logicop_enable;
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 04659fe6eff..5d8b37d49b1 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -142,12 +142,6 @@ panfrost_bind_blend_state(struct pipe_context *pipe, void *cso)
         ctx->dirty_shader[PIPE_SHADER_FRAGMENT] |= PAN_DIRTY_STAGE_RENDERER;
 }
 
-static void
-panfrost_delete_blend_state(struct pipe_context *pipe, void *cso)
-{
-        ralloc_free(cso);
-}
-
 static void
 panfrost_set_blend_color(struct pipe_context *pipe,
                          const struct pipe_blend_color *blend_color)
@@ -1119,7 +1113,7 @@ panfrost_create_context(struct pipe_screen *screen, void *priv, unsigned flags)
         gallium->set_stream_output_targets = panfrost_set_stream_output_targets;
 
         gallium->bind_blend_state   = panfrost_bind_blend_state;
-        gallium->delete_blend_state = panfrost_delete_blend_state;
+        gallium->delete_blend_state = panfrost_generic_cso_delete;
 
         gallium->set_blend_color = panfrost_set_blend_color;
 



More information about the mesa-commit mailing list