Module: Mesa
Branch: main
Commit: e9991d5ff1e8d471a75f2bab22b2776aef90cabd
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e9991d5ff1e8d471a75f2bab22b2776aef90cabd

Author: Charlie Turner <[email protected]>
Date:   Thu Jun 17 12:43:27 2021 +0100

radv: Provide a toggle to avoid warnings about unsupported devices.

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 <[email protected]>
Reviewed-by: Eric Engestrom <[email protected]>
Acked-by: Andres Gomez <[email protected]>
Acked-by: Samuel Iglesias Gonsálvez <[email protected]>
Acked-by: Samuel Pitoiset <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11491>

---

 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 <stdbool.h>
 #include <string.h>
 
+#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);

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to