From 0a266f0256025d271945adb3478fc2c1291d4c79 Mon Sep 17 00:00:00 2001 From: Qiang Yu Date: Tue, 15 Oct 2024 14:48:38 +0800 Subject: [PATCH] radeonsi: really support eglExportDMABUFImageQueryMESA MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now it should return explicite modifier and plane number. Acked-by: Pierre-Eric Pelloux-Prayer Reviewed-by: Marek Olšák Acked-by: Daniel Stone Part-of: --- src/gallium/drivers/radeonsi/si_texture.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gallium/drivers/radeonsi/si_texture.c b/src/gallium/drivers/radeonsi/si_texture.c index dd9f7e56db1..16555343aa4 100644 --- a/src/gallium/drivers/radeonsi/si_texture.c +++ b/src/gallium/drivers/radeonsi/si_texture.c @@ -669,6 +669,14 @@ static bool si_resource_get_param(struct pipe_screen *screen, struct pipe_contex struct si_texture *tex = (struct si_texture *)resource; struct winsys_handle whandle; + /* Compute texture modifier when needed. + * This allows to return the correct values for the PIPE_RESOURCE_PARAM_NPLANES and + * PIPE_RESOURCE_PARAM_MODIFIER queries. + */ + if ((param == PIPE_RESOURCE_PARAM_NPLANES || param == PIPE_RESOURCE_PARAM_MODIFIER) && + resource->target != PIPE_BUFFER) + ac_compute_surface_modifier(&sscreen->info, &tex->surface, resource->nr_samples); + switch (param) { case PIPE_RESOURCE_PARAM_NPLANES: if (resource->target == PIPE_BUFFER)