From d4f662a25227a3d469a516ba0acb6dc4d1a71bcb Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Thu, 26 Nov 2020 15:35:20 +0100 Subject: [PATCH] panfrost: Update the resource layout when doing a tile -> linear conversion If we don't do that the stride in texture/framebuffer descriptors is wrong, leading to page faults when those buffers are accessed. Fixes: 00360cd5c85e ("panfrost: Calculate the row stride at resource creation time") Signed-off-by: Boris Brezillon Reviewed-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_resource.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c index c96546398f1..4727483e44f 100644 --- a/src/gallium/drivers/panfrost/pan_resource.c +++ b/src/gallium/drivers/panfrost/pan_resource.c @@ -1044,8 +1044,6 @@ panfrost_ptr_unmap(struct pipe_context *pctx, assert(transfer->box.depth == 1); if (panfrost_should_linear_convert(prsrc, transfer)) { - prsrc->modifier = DRM_FORMAT_MOD_LINEAR; - util_copy_rect( bo->ptr.cpu + prsrc->slices[0].offset, prsrc->base.format, @@ -1056,6 +1054,8 @@ panfrost_ptr_unmap(struct pipe_context *pctx, trans->map, transfer->stride, 0, 0); + + panfrost_resource_setup(dev, prsrc, NULL, DRM_FORMAT_MOD_LINEAR); } else { panfrost_store_tiled_image( bo->ptr.cpu + prsrc->slices[transfer->level].offset,