[Mesa-dev] [PATCH] panfrost: Remove panfrost_context.depth_stencil_buffer

Tomeu Vizoso tomeu.vizoso at collabora.com
Wed Jul 10 07:25:32 UTC 2019


This was stale code that was causing a SIGSEGV when using SFBD, as we
stopped creating the corresponding BO.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso at collabora.com>
---
 src/gallium/drivers/panfrost/pan_context.h | 1 -
 src/gallium/drivers/panfrost/pan_sfbd.c    | 6 ++++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_context.h b/src/gallium/drivers/panfrost/pan_context.h
index a913c8581ef5..b26abea369d3 100644
--- a/src/gallium/drivers/panfrost/pan_context.h
+++ b/src/gallium/drivers/panfrost/pan_context.h
@@ -134,7 +134,6 @@ struct panfrost_context {
         struct panfrost_memory varying_mem;
         struct panfrost_memory tiler_polygon_list;
         struct panfrost_memory tiler_dummy;
-        struct panfrost_memory depth_stencil_buffer;
 
         struct panfrost_query *occlusion_query;
 
diff --git a/src/gallium/drivers/panfrost/pan_sfbd.c b/src/gallium/drivers/panfrost/pan_sfbd.c
index 76267b746ac0..2cb3817d4bb3 100644
--- a/src/gallium/drivers/panfrost/pan_sfbd.c
+++ b/src/gallium/drivers/panfrost/pan_sfbd.c
@@ -41,6 +41,8 @@ panfrost_sfbd_clear(
                 struct mali_single_framebuffer *sfbd)
 {
         struct panfrost_context *ctx = job->ctx;
+        struct pipe_surface *zs_surf = ctx->pipe_framebuffer.zsbuf;
+        struct panfrost_resource *zs_rsrc = pan_resource(zs_surf->texture);
 
         if (job->clear & PIPE_CLEAR_COLOR) {
                 sfbd->clear_color_1 = job->clear_color;
@@ -55,14 +57,14 @@ panfrost_sfbd_clear(
                 sfbd->clear_depth_3 = job->clear_depth;
                 sfbd->clear_depth_4 = job->clear_depth;
 
-                sfbd->depth_buffer = ctx->depth_stencil_buffer.bo->gpu;
+                sfbd->depth_buffer = zs_rsrc->bo->gpu;
                 sfbd->depth_buffer_enable = MALI_DEPTH_STENCIL_ENABLE;
         }
 
         if (job->clear & PIPE_CLEAR_STENCIL) {
                 sfbd->clear_stencil = job->clear_stencil;
 
-                sfbd->stencil_buffer = ctx->depth_stencil_buffer.bo->gpu;
+                sfbd->stencil_buffer = zs_rsrc->bo->gpu;
                 sfbd->stencil_buffer_enable = MALI_DEPTH_STENCIL_ENABLE;
         }
 
-- 
2.20.1



More information about the mesa-dev mailing list