summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_resource.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2017-05-12 16:05:44 -0700
committerEric Anholt <[email protected]>2017-09-27 10:21:49 -0700
commita8fd58eae59607ac42eaa7187b0d9e6c51b83af9 (patch)
tree0adfc15b49ea1fc60eaf84691f18dcce4069e83f /src/gallium/drivers/vc4/vc4_resource.c
parent673dda8330769309a319d3e7f24a029cd72a1caf (diff)
vc4: Add labels to BOs for debug builds or with VC4_DEBUG=surf set.
This has proven to be incredibly useful for debugging CMA allocation failures and driving memory management improvements. However, we don't want to burden entry and exit from the BO cache with the labeling ioctl's overhead on release builds.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_resource.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_resource.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc4/vc4_resource.c b/src/gallium/drivers/vc4/vc4_resource.c
index 853f7bbfa17..cdcbcc917e0 100644
--- a/src/gallium/drivers/vc4/vc4_resource.c
+++ b/src/gallium/drivers/vc4/vc4_resource.c
@@ -675,6 +675,11 @@ vc4_resource_create_with_modifiers(struct pipe_screen *pscreen,
goto fail;
}
+ vc4_bo_label(screen, rsc->bo, "%sresource %dx%d@%d/%d",
+ (tmpl->bind & PIPE_BIND_SCANOUT) ? "scanout " : "",
+ tmpl->width0, tmpl->height0,
+ rsc->cpp * 8, prsc->last_level);
+
return prsc;
fail:
vc4_resource_destroy(pscreen, prsc);