From adb85dc3078897bff149a7f16f9a076779462500 Mon Sep 17 00:00:00 2001 From: Olivia Lee Date: Thu, 26 Jun 2025 12:36:48 -0700 Subject: [PATCH] panvk: store BO offset in panvk_image_plane For VK_EXT_host_image_copy, we need to access image memory from the CPU after mapping the BO. The existing base field in pan_image_plane doesn't work for this because it's a GPU address and we don't have a mechanism to recover the GPU base address of an image's BO to calculate the offset. Signed-off-by: Olivia Lee Reviewed-by: Erik Faye-Lund Part-of: --- src/panfrost/vulkan/panvk_image.c | 1 + src/panfrost/vulkan/panvk_image.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/panfrost/vulkan/panvk_image.c b/src/panfrost/vulkan/panvk_image.c index 8a5f8464ead..777b6519135 100644 --- a/src/panfrost/vulkan/panvk_image.c +++ b/src/panfrost/vulkan/panvk_image.c @@ -408,6 +408,7 @@ panvk_image_plane_bind(struct panvk_device *dev, uint64_t base, uint64_t offset) { plane->plane.base = base + offset; + plane->offset = offset; /* Reset the AFBC headers */ if (drm_is_afbc(plane->image.props.modifier)) { /* Transient CPU mapping */ diff --git a/src/panfrost/vulkan/panvk_image.h b/src/panfrost/vulkan/panvk_image.h index f10b27be78f..f633cbb7ba7 100644 --- a/src/panfrost/vulkan/panvk_image.h +++ b/src/panfrost/vulkan/panvk_image.h @@ -20,6 +20,9 @@ struct panvk_device_memory; struct panvk_image_plane { struct pan_image image; struct pan_image_plane plane; + + /* Plane offset inside the image BO */ + uint64_t offset; }; struct panvk_image {