From a0da2bc1201163304865fff9c94b6a713a0cdab6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tapani=20P=C3=A4lli?= Date: Mon, 16 Sep 2024 07:53:25 +0300 Subject: [PATCH] iris: fix issues with memory object updates via glBufferSubData MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Disable aysnc mapping in case we are updating a external memobj. Fixes following Piglit tests: spec@ext_external_objects@vk-pix-buf-update-errors spec@ext_external_objects@vk-vert-buf-update-errors Cc: mesa-stable Signed-off-by: Tapani Pälli Reviewed-by: José Roberto de Souza Part-of: (cherry picked from commit 0e02de5a50cbbd89db5715ecc534d3b4c546d882) --- .pick_status.json | 2 +- src/gallium/drivers/iris/iris_resource.c | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index e1fa32d0d92..74d1afca4ee 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -84,7 +84,7 @@ "description": "iris: fix issues with memory object updates via glBufferSubData", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c index 1227d9024b5..b58bdef8eb7 100644 --- a/src/gallium/drivers/iris/iris_resource.c +++ b/src/gallium/drivers/iris/iris_resource.c @@ -2547,6 +2547,15 @@ iris_transfer_map(struct pipe_context *ctx, usage |= PIPE_MAP_UNSYNCHRONIZED; } + /* We are dealing with external memory object PIPE_BUFFER, disable + * async mapping because of sync issues. + */ + if (!res->mod_info && + res->external_format != PIPE_FORMAT_NONE && + resource->target == PIPE_BUFFER) { + usage &= ~PIPE_MAP_UNSYNCHRONIZED; + } + /* Avoid using GPU copies for persistent/coherent buffers, as the idea * there is to access them simultaneously on the CPU & GPU. This also * avoids trying to use GPU copies for our u_upload_mgr buffers which