From 3c92abe359379066a166f86fe7bfbb4da8029478 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 18 Dec 2020 14:25:51 +0100 Subject: [PATCH] panfrost: Use panfrost_get_layer_stride() instead of open-coding it If we don't do that we don't account for CRC buffers. Signed-off-by: Boris Brezillon Reviewed-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_resource.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c index aafb0a9c474..2229ecf8a64 100644 --- a/src/gallium/drivers/panfrost/pan_resource.c +++ b/src/gallium/drivers/panfrost/pan_resource.c @@ -882,7 +882,8 @@ panfrost_ptr_map(struct pipe_context *pctx, if (drm_is_afbc(rsrc->layout.modifier)) { struct panfrost_resource *staging = pan_alloc_staging(ctx, rsrc, level, box); transfer->base.stride = staging->layout.slices[0].line_stride; - transfer->base.layer_stride = transfer->base.stride * box->height; + transfer->base.layer_stride = + panfrost_get_layer_stride(&staging->layout, level); transfer->staging.rsrc = &staging->base;