i965: Use WARN_ONCE for the single-primitive-exceeded-aperture message.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 30 Dec 2014 20:21:03 +0000 (12:21 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 1 Jan 2015 01:06:51 +0000 (17:06 -0800)
This makes it show up via ARB_debug_output and is also less code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
src/mesa/drivers/dri/i965/brw_draw.c

index c581cc0f5c8299a0dca17d12592d36cb15e8030b..5cd3f01cb1f6519e93b3aab703a0320b7a135346 100644 (file)
@@ -520,15 +520,10 @@ retry:
            fail_next = true;
            goto retry;
         } else {
-           if (intel_batchbuffer_flush(brw) == -ENOSPC) {
-              static bool warned = false;
-
-              if (!warned) {
-                 fprintf(stderr, "i965: Single primitive emit exceeded"
-                         "available aperture space\n");
-                 warned = true;
-              }
-           }
+            int ret = intel_batchbuffer_flush(brw);
+            WARN_ONCE(ret == -ENOSPC,
+                      "i965: Single primitive emit exceeded "
+                      "available aperture space\n");
         }
       }