radv: only display options that are enabled
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 14 Mar 2018 11:01:49 +0000 (12:01 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 15 Mar 2018 16:19:52 +0000 (17:19 +0100)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_debug.c

index c8794d06ea8f26df9dcbece00fe15c1f07127c57..f3b79004f6931ec1df014d8fe8df84bb5c85e5c0 100644 (file)
@@ -598,23 +598,27 @@ radv_dump_enabled_options(struct radv_device *device, FILE *f)
 {
        uint64_t mask;
 
-       fprintf(f, "Enabled debug options: ");
+       if (device->instance->debug_flags) {
+               fprintf(f, "Enabled debug options: ");
 
-       mask = device->instance->debug_flags;
-       while (mask) {
-               int i = u_bit_scan64(&mask);
-               fprintf(f, "%s, ", radv_get_debug_option_name(i));
+               mask = device->instance->debug_flags;
+               while (mask) {
+                       int i = u_bit_scan64(&mask);
+                       fprintf(f, "%s, ", radv_get_debug_option_name(i));
+               }
+               fprintf(f, "\n");
        }
-       fprintf(f, "\n");
 
-       fprintf(f, "Enabled perftest options: ");
+       if (device->instance->perftest_flags) {
+               fprintf(f, "Enabled perftest options: ");
 
-       mask = device->instance->perftest_flags;
-       while (mask) {
-               int i = u_bit_scan64(&mask);
-               fprintf(f, "%s, ", radv_get_perftest_option_name(i));
+               mask = device->instance->perftest_flags;
+               while (mask) {
+                       int i = u_bit_scan64(&mask);
+                       fprintf(f, "%s, ", radv_get_perftest_option_name(i));
+               }
+               fprintf(f, "\n");
        }
-       fprintf(f, "\n");
 }
 
 static void