From 3fee3d1319768e6304edbe71296d68eeba973685 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Sat, 23 Mar 2019 09:32:38 -0700 Subject: [PATCH] iris: Print the memzone name when allocating BOs with INTEL_DEBUG=buf This gives me an idea of what kinds of buffers are being allocated on the fly which could help inform our cache decisions. --- src/gallium/drivers/iris/iris_bufmgr.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/iris/iris_bufmgr.c b/src/gallium/drivers/iris/iris_bufmgr.c index e0d167913d2..56261d4a947 100644 --- a/src/gallium/drivers/iris/iris_bufmgr.c +++ b/src/gallium/drivers/iris/iris_bufmgr.c @@ -117,6 +117,21 @@ atomic_add_unless(int *v, int add, int unless) return c == unless; } +static const char * +memzone_name(enum iris_memory_zone memzone) +{ + const char *names[] = { + [IRIS_MEMZONE_SHADER] = "shader", + [IRIS_MEMZONE_BINDER] = "binder", + [IRIS_MEMZONE_SURFACE] = "surface", + [IRIS_MEMZONE_DYNAMIC] = "dynamic", + [IRIS_MEMZONE_OTHER] = "other", + [IRIS_MEMZONE_BORDER_COLOR_POOL] = "bordercolor", + }; + assert(memzone < ARRAY_SIZE(names)); + return names[memzone]; +} + /** * Iris fixed-size bucketing VMA allocator. * @@ -662,8 +677,8 @@ skip_cache: } } - DBG("bo_create: buf %d (%s) %llub\n", bo->gem_handle, bo->name, - (unsigned long long) size); + DBG("bo_create: buf %d (%s) (%s memzone) %llub\n", bo->gem_handle, + bo->name, memzone_name(memzone), (unsigned long long) size); return bo; -- 2.30.2