From c34c7b1f3b2356a053bad7afa18383bfd9c79038 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Mon, 10 Mar 2025 13:17:59 +0100 Subject: [PATCH] panvk: correct VkPhysicalDeviceProperties::deviceName We currently report a deviceName as e.g. "Mali-G610 (Panfrost)", but panfrost has nothing to di with the physical device, and the suffix doesn't belong there at all. So let's remove that suffix from PanVK. This results in output like this from vulkaninfo: ---8<--- VkPhysicalDeviceProperties: --------------------------- apiVersion = 1.1.305 (4198705) driverVersion = 25.0.99 (104857699) vendorID = 0x13b5 deviceID = 0xa8670000 deviceType = PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU deviceName = Mali-G610 pipelineCacheUUID = ---8<--- We already sort of namedrop Panfrost in the driver properties: ---8<--- VkPhysicalDeviceDriverPropertiesKHR: ------------------------------------ driverID = DRIVER_ID_MESA_PANVK driverName = panvk driverInfo = Mesa 25.1.0-devel (git-136dd9f985) conformanceVersion: major = 1 minor = 4 subminor = 1 patch = 2 ---8<--- While this might techically speaking be a regression, PanVK has been marked as experimental until Mesa 25.0. But to reduce the risk of people starting to depend on this behavior, let's also backport this change to the 25.0 release. The patch looks a bit funny, because we add the " (Panfrost)"-suffix in common code, and this moves it to the Gallium driver. But effectively, this means PanVK is the only driver that sees a change of behavior. Backport-to: 25.0 Reviewed-by: John Anthony Reviewed-by: Boris Brezillon Part-of: --- src/gallium/drivers/panfrost/pan_screen.c | 5 ++++- src/gallium/drivers/panfrost/pan_screen.h | 1 + src/panfrost/lib/pan_props.c | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c index 4444df2589e..a043fbe4df9 100644 --- a/src/gallium/drivers/panfrost/pan_screen.c +++ b/src/gallium/drivers/panfrost/pan_screen.c @@ -85,7 +85,7 @@ static const struct debug_named_value panfrost_debug_options[] = { static const char * panfrost_get_name(struct pipe_screen *screen) { - return pan_device(screen)->model->name; + return pan_screen(screen)->renderer_string; } static const char * @@ -817,6 +817,9 @@ panfrost_create_screen(int fd, const struct pipe_screen_config *config, return NULL; } + snprintf(screen->renderer_string, sizeof(screen->renderer_string), + "%s (Panfrost)", dev->model->name); + screen->force_afbc_packing = dev->debug & PAN_DBG_FORCE_PACK; if (!screen->force_afbc_packing) screen->force_afbc_packing = driQueryOptionb(config->options, diff --git a/src/gallium/drivers/panfrost/pan_screen.h b/src/gallium/drivers/panfrost/pan_screen.h index 813563d983c..c53338fffea 100644 --- a/src/gallium/drivers/panfrost/pan_screen.h +++ b/src/gallium/drivers/panfrost/pan_screen.h @@ -123,6 +123,7 @@ struct panfrost_screen { struct panfrost_pool desc; } mempools; + char renderer_string[100]; struct panfrost_vtable vtbl; struct disk_cache *disk_cache; unsigned max_afbc_packing_ratio; diff --git a/src/panfrost/lib/pan_props.c b/src/panfrost/lib/pan_props.c index 278abfd2661..3b0fa994f53 100644 --- a/src/panfrost/lib/pan_props.c +++ b/src/panfrost/lib/pan_props.c @@ -40,7 +40,7 @@ min_rev_anisotropic_, tib_size_, quirks_) \ { \ .gpu_id = gpu_id_, .gpu_variant = gpu_variant_, \ - .name = "Mali-" shortname " (Panfrost)", \ + .name = "Mali-" shortname, \ .performance_counters = counters_, \ .min_rev_anisotropic = min_rev_anisotropic_, \ .tilebuffer_size = tib_size_, .quirks = quirks_, \