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 <olivia.lee@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35910>
This commit is contained in:
Olivia Lee 2025-06-26 12:36:48 -07:00 committed by Marge Bot
parent 4f8d0e81c4
commit adb85dc307
2 changed files with 4 additions and 0 deletions

View file

@ -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 */

View file

@ -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 {