From ea5e190b91d6ae1948605f20466f1c1c9b1e7299 Mon Sep 17 00:00:00 2001 From: Qiang Yu Date: Tue, 9 Sep 2025 14:36:37 +0800 Subject: [PATCH] panfrost: fix lowered multi plane resource offset/stride param get EGL is going to really export each plane's offset/stride, panfrost need to fix for passing the piglit test: spec@ext_image_dma_buf_import@ext_image_dma_buf_import-export Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13853 Reviewed-by: Boris Brezillon Reviewed-by: Eric R. Smith Acked-by: Erik Faye-Lund Part-of: --- src/gallium/drivers/panfrost/pan_resource.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c index 549380fdecb..615ead9d22a 100644 --- a/src/gallium/drivers/panfrost/pan_resource.c +++ b/src/gallium/drivers/panfrost/pan_resource.c @@ -535,7 +535,12 @@ panfrost_resource_get_param(struct pipe_screen *pscreen, enum pipe_resource_param param, unsigned usage, uint64_t *value) { - struct panfrost_resource *rsrc = pan_resource(prsc); + struct panfrost_resource *rsrc = + pan_resource(util_resource_at_index(prsc, plane)); + + /* Lowered multi plane resource gets each plane allocated independently. */ + if (!rsrc->image.planes[plane]) + plane = 0; switch (param) { case PIPE_RESOURCE_PARAM_STRIDE: