From e9991d5ff1e8d471a75f2bab22b2776aef90cabd Mon Sep 17 00:00:00 2001 From: Charlie Turner Date: Thu, 17 Jun 2021 12:43:27 +0100 Subject: [PATCH] radv: Provide a toggle to avoid warnings about unsupported devices. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the CI, we have such devices, and this message is printed many hundreds of times. This results in a useless spam which makes it difficult to see real issues. v2 from Martin: - Reword the commit message a bit - Add a SoB Signed-off-by: Martin Peres Reviewed-by: Eric Engestrom Acked-by: Andres Gomez Acked-by: Samuel Iglesias Gonsálvez Acked-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_device.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 87687a87cb0..4b8eab2ed75 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -29,6 +29,7 @@ #include #include +#include "util/debug.h" #include "util/disk_cache.h" #include "radv_cs.h" #include "radv_debug.h" @@ -520,6 +521,15 @@ radv_physical_device_get_supported_extensions(const struct radv_physical_device }; } +static void +warn_non_conformant_implementation() +{ + if (env_var_as_boolean("RADV_IGNORE_CONFORMANCE_WARNING", false)) + return; + fprintf(stderr, + "WARNING: radv is not a conformant vulkan implementation, testing use only.\n"); +} + static VkResult radv_physical_device_try_create(struct radv_instance *instance, drmDevicePtr drm_device, struct radv_physical_device **device_out) @@ -649,8 +659,7 @@ radv_physical_device_try_create(struct radv_instance *instance, drmDevicePtr drm #endif if (device->rad_info.chip_class < GFX8 || device->rad_info.chip_class > GFX10) - fprintf(stderr, - "WARNING: radv is not a conformant vulkan implementation, testing use only.\n"); + warn_non_conformant_implementation(); radv_get_driver_uuid(&device->driver_uuid); radv_get_device_uuid(&device->rad_info, &device->device_uuid);