From 43122b7392cc602e2becca070e7804d8458fdb29 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Wed, 5 Jul 2023 10:42:30 +0200 Subject: [PATCH 05/64] panfrost: Keep original BO flags when linearizing a resource Needed for the PAN_BO_SHAREABLE propagation. Signed-off-by: Boris Brezillon --- src/gallium/drivers/panfrost/pan_resource.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c index 1010053f467..5f04f5130e2 100644 --- a/src/gallium/drivers/panfrost/pan_resource.c +++ b/src/gallium/drivers/panfrost/pan_resource.c @@ -1323,10 +1323,12 @@ panfrost_ptr_unmap(struct pipe_context *pctx, struct pipe_transfer *transfer) panfrost_resource_setup(dev, prsrc, DRM_FORMAT_MOD_LINEAR, prsrc->image.layout.format); if (prsrc->image.layout.data_size > panfrost_bo_size(bo)) { + uint32_t flags = bo->flags & ~PAN_BO_DELAY_MMAP; const char *label = bo->label; + panfrost_bo_unreference(bo); bo = prsrc->image.data.bo = panfrost_bo_create( - dev, prsrc->image.layout.data_size, 0, label); + dev, prsrc->image.layout.data_size, flags, label); assert(bo); } -- 2.42.0