Commit 2a76c061 authored by Rohan Garg's avatar Rohan Garg
Browse files

panfrost: Label buffer objects for better visibility



Label buffer objects for better visibility of lifetimes,
purpose and debugging.
Signed-off-by: default avatarRohan Garg <rohan.garg@collabora.com>
parent 38a6a687
Pipeline #145768 waiting for manual action with stages
......@@ -31,6 +31,7 @@
#include <panfrost-job.h>
#include "pan_bo.h"
#include "pan_context.h"
#include "util/u_drm.h"
/* TODO: What does this actually have to be? */
#define ALIGNMENT 128
......@@ -75,6 +76,7 @@ panfrost_allocate_transient(struct panfrost_batch *batch, size_t sz)
PAN_BO_ACCESS_RW |
PAN_BO_ACCESS_VERTEX_TILER |
PAN_BO_ACCESS_FRAGMENT);
util_set_buffer_label(bo->dev->fd, bo->gem_handle, "Command Stream Pool");
if (sz < TRANSIENT_SLAB_SIZE) {
batch->transient_bo = bo;
......
......@@ -34,6 +34,7 @@
#include "nir/tgsi_to_nir.h"
#include "midgard/midgard_compile.h"
#include "bifrost/bifrost_compile.h"
#include "util/u_drm.h"
#include "util/u_dynarray.h"
#include "tgsi/tgsi_dump.h"
......@@ -158,6 +159,12 @@ panfrost_shader_compile(struct panfrost_context *ctx,
* I bet someone just thought that would be a cute pun. At least,
* that's how I'd do it. */
/* TODO: Figure out why enabling this breaks weston
util_set_buffer_label(state->bo->dev->fd,
state->bo->gem_handle,
"Shader upload");
*/
if (size) {
state->bo = pan_bo_create(dev, size, PAN_BO_EXECUTE);
memcpy(state->bo->cpu, dst, size);
......
......@@ -27,6 +27,7 @@
#include <stdio.h>
#include "util/u_memory.h"
#include "util/u_drm.h"
#include "pan_blend_shaders.h"
#include "pan_blending.h"
#include "pan_bo.h"
......@@ -275,7 +276,9 @@ panfrost_get_blend_for_context(struct panfrost_context *ctx, unsigned rti, struc
PAN_BO_ACCESS_VERTEX_TILER |
PAN_BO_ACCESS_FRAGMENT);
}
util_set_buffer_label((*bo)->dev->fd,
(*bo)->gem_handle,
"Blend Shader");
/* Size check */
assert((*shader_offset + shader->size) < 4096);
......
......@@ -32,6 +32,7 @@
#include "util/hash_table.h"
#include "util/ralloc.h"
#include "util/format/u_format.h"
#include "util/u_drm.h"
#include "util/u_pack_color.h"
#include "pan_util.h"
#include "pandecode/decode.h"
......@@ -647,6 +648,9 @@ panfrost_batch_get_polygon_list(struct panfrost_batch *batch, unsigned size)
PAN_BO_ACCESS_RW |
PAN_BO_ACCESS_VERTEX_TILER |
PAN_BO_ACCESS_FRAGMENT);
util_set_buffer_label(batch->polygon_list->dev->fd,
batch->polygon_list->gem_handle,
"Polygon List");
}
return batch->polygon_list->gpu;
......@@ -672,6 +676,9 @@ panfrost_batch_get_scratchpad(struct panfrost_batch *batch,
PAN_BO_ACCESS_VERTEX_TILER |
PAN_BO_ACCESS_FRAGMENT);
}
util_set_buffer_label(batch->scratchpad->dev->fd,
batch->scratchpad->gem_handle,
"Scratchpad");
return batch->scratchpad;
}
......@@ -707,6 +714,9 @@ panfrost_batch_get_tiler_heap(struct panfrost_batch *batch)
PAN_BO_ACCESS_RW |
PAN_BO_ACCESS_VERTEX_TILER |
PAN_BO_ACCESS_FRAGMENT);
util_set_buffer_label(batch->tiler_heap->dev->fd,
batch->tiler_heap->gem_handle,
"Tiler Heap");
assert(batch->tiler_heap);
return batch->tiler_heap;
}
......@@ -763,6 +773,9 @@ panfrost_batch_get_tiler_dummy(struct panfrost_batch *batch)
PAN_BO_ACCESS_RW |
PAN_BO_ACCESS_VERTEX_TILER |
PAN_BO_ACCESS_FRAGMENT);
util_set_buffer_label(batch->tiler_dummy->dev->fd,
batch->tiler_dummy->gem_handle,
"Dummy Tiler");
assert(batch->tiler_dummy);
return batch->tiler_dummy;
}
......
......@@ -35,6 +35,7 @@
#include "state_tracker/winsys_handle.h"
#include "util/format/u_format.h"
#include "util/u_drm.h"
#include "util/u_memory.h"
#include "util/u_surface.h"
#include "util/u_transfer.h"
......@@ -383,6 +384,7 @@ static void
panfrost_resource_create_bo(struct panfrost_device *dev, struct panfrost_resource *pres)
{
struct pipe_resource *res = &pres->base;
char *label;
/* Based on the usage, figure out what storing will be used. There are
* various tradeoffs:
......@@ -433,6 +435,12 @@ panfrost_resource_create_bo(struct panfrost_device *dev, struct panfrost_resourc
/* We create a BO immediately but don't bother mapping, since we don't
* care to map e.g. FBOs which the CPU probably won't touch */
pres->bo = pan_bo_create(dev, bo_size, PAN_BO_DELAY_MMAP);
asprintf(&label, "%d resource", res->bind);
util_set_buffer_label(pres->bo->dev->fd,
pres->bo->gem_handle,
label);
free(label);
}
void
......@@ -849,6 +857,8 @@ panfrost_resource_hint_layout(
enum mali_texture_layout layout,
signed weight)
{
char *label = NULL;
/* Nothing to do, although a sophisticated implementation might store
* the hint */
......@@ -893,11 +903,14 @@ panfrost_resource_hint_layout(
/* If we grew in size, reallocate the BO */
if (new_size > rsrc->bo->size) {
label = util_get_buffer_label(rsrc->bo->dev->fd, rsrc->bo->gem_handle);
panfrost_bo_unreference(rsrc->bo);
rsrc->bo = pan_bo_create(dev, new_size, PAN_BO_DELAY_MMAP);
}
/* TODO: If there are textures bound, regenerate their descriptors */
util_set_buffer_label(rsrc->bo->dev->fd, rsrc->bo->gem_handle, label);
free(label);
}
static void
......
......@@ -34,6 +34,7 @@
#include "os/os_mman.h"
#include "util/u_drm.h"
#include "util/u_inlines.h"
#include "util/u_math.h"
......@@ -280,6 +281,8 @@ panfrost_bo_cache_put(struct panfrost_bo *bo)
drmIoctl(dev->fd, DRM_IOCTL_PANFROST_MADVISE, &madv);
util_set_buffer_label(bo->dev->fd, bo->gem_handle, "Userspace BO cache");
/* Add us to the bucket */
list_addtail(&bo->bucket_link, bucket);
......
......@@ -51,6 +51,7 @@ bifrost_compiler = executable(
inc_gallium_aux,
inc_include,
inc_src,
inc_util,
inc_panfrost,
inc_panfrost_hw,
],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment