[v2] panfrost: Remove panfrost_context.depth_stencil_buffer

Submitted by Tomeu Vizoso on July 10, 2019, 7:32 a.m.

Details

Message ID 20190710073226.36649-1-tomeu.vizoso@collabora.com
State New
Headers show
Series "panfrost: Remove panfrost_context.depth_stencil_buffer" ( rev: 2 ) in Mesa

Not browsing as part of any series.

Commit Message

Tomeu Vizoso July 10, 2019, 7:32 a.m.
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@collabora.com>
---
 src/gallium/drivers/panfrost/pan_context.h | 1 -
 src/gallium/drivers/panfrost/pan_sfbd.c    | 8 ++++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

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..b8c314d222f0 100644
--- a/src/gallium/drivers/panfrost/pan_sfbd.c
+++ b/src/gallium/drivers/panfrost/pan_sfbd.c
@@ -55,14 +55,18 @@  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;
+                struct pipe_surface *surf = ctx->pipe_framebuffer.zsbuf;
+                struct panfrost_resource *rsrc = pan_resource(surf->texture);
+                sfbd->depth_buffer = 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;
+                struct pipe_surface *surf = ctx->pipe_framebuffer.zsbuf;
+                struct panfrost_resource *rsrc = pan_resource(surf->texture);
+                sfbd->stencil_buffer = rsrc->bo->gpu;
                 sfbd->stencil_buffer_enable = MALI_DEPTH_STENCIL_ENABLE;
         }
 

Comments