gallium: add PIPE_DRIVER_QUERY_FLAG_DONT_LIST
authorNicolai Hähnle <nhaehnle@gmail.com>
Thu, 19 Nov 2015 11:13:43 +0000 (12:13 +0100)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Thu, 26 Nov 2015 09:57:43 +0000 (10:57 +0100)
This allows the driver to give a hint to the HUD so that GALLIUM_HUD=help is
less spammy.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/auxiliary/hud/hud_context.c
src/gallium/include/pipe/p_defines.h

index efceb85e38d2a2c3fcafb0435fb84f5906a02d43..c5c333277021b27e490abe348de53df8871ab95b 100644 (file)
@@ -1127,12 +1127,20 @@ print_help(struct pipe_screen *screen)
    }
 
    if (screen->get_driver_query_info){
+      boolean skipping = false;
       struct pipe_driver_query_info info;
       num_queries = screen->get_driver_query_info(screen, 0, NULL);
 
       for (i = 0; i < num_queries; i++){
          screen->get_driver_query_info(screen, i, &info);
-         printf("    %s\n", info.name);
+         if (info.flags & PIPE_DRIVER_QUERY_FLAG_DONT_LIST) {
+            if (!skipping)
+               puts("    ...");
+            skipping = true;
+         } else {
+            printf("    %s\n", info.name);
+            skipping = false;
+         }
       }
    }
 
index b3c8b9f7360ed5ef2db1f1e788c622864b3ba993..b18eedd004d44ec520de09eeef7eef0f99c9303e 100644 (file)
@@ -861,6 +861,9 @@ enum pipe_driver_query_result_type
  */
 #define PIPE_DRIVER_QUERY_FLAG_BATCH     (1 << 0)
 
+/* Do not list this query in the HUD. */
+#define PIPE_DRIVER_QUERY_FLAG_DONT_LIST (1 << 1)
+
 struct pipe_driver_query_info
 {
    const char *name;