v3d: Reduce the stale BO reclamation spam with dump_stats set.
authorEric Anholt <eric@anholt.net>
Tue, 17 Jul 2018 20:21:58 +0000 (13:21 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 20 Jul 2018 18:11:29 +0000 (11:11 -0700)
This was obviously meant to be when we were actually freeing a BO, not
just when there was at least one BO in the list.

src/gallium/drivers/v3d/v3d_bufmgr.c

index f7a851f9d43129be3c85ef7d89268eed960a0d85..1b4acc6fca8bd92425bb9f07d792ee5e8dc6fafc 100644 (file)
@@ -238,14 +238,13 @@ free_stale_bos(struct v3d_screen *screen, time_t time)
 
         list_for_each_entry_safe(struct v3d_bo, bo, &cache->time_list,
                                  time_list) {
-                if (dump_stats && !freed_any) {
-                        fprintf(stderr, "Freeing stale BOs:\n");
-                        v3d_bo_dump_stats(screen);
-                        freed_any = true;
-                }
-
                 /* If it's more than a second old, free it. */
                 if (time - bo->free_time > 2) {
+                        if (dump_stats && !freed_any) {
+                                fprintf(stderr, "Freeing stale BOs:\n");
+                                v3d_bo_dump_stats(screen);
+                                freed_any = true;
+                        }
                         v3d_bo_remove_from_cache(cache, bo);
                         v3d_bo_free(bo);
                 } else {