summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/v3d
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-06-25 14:58:15 -0700
committerEric Anholt <[email protected]>2018-07-27 17:08:35 -0700
commit01b4952773e874b5fa0cc8190d846f7bbb1c18b6 (patch)
treeb32de7bae052e7fec94cfec2bc1d40cbd75daecf /src/gallium/drivers/v3d
parente92959c4e03cf17b7cd829e2e56162604069abe6 (diff)
v3d: Move clif dump BO lookup into the clif dumper.
The clif dumper is going to need information about all of our BOs if we're going to dump them for replay purposes.
Diffstat (limited to 'src/gallium/drivers/v3d')
-rw-r--r--src/gallium/drivers/v3d/v3d_job.c37
1 files changed, 15 insertions, 22 deletions
diff --git a/src/gallium/drivers/v3d/v3d_job.c b/src/gallium/drivers/v3d/v3d_job.c
index 9ab8e5107a7..20f8bcc3f32 100644
--- a/src/gallium/drivers/v3d/v3d_job.c
+++ b/src/gallium/drivers/v3d/v3d_job.c
@@ -341,26 +341,6 @@ v3d_get_job_for_fbo(struct v3d_context *v3d)
return job;
}
-static bool
-v3d_clif_dump_lookup(void *data, uint32_t addr, void **vaddr)
-{
- struct v3d_job *job = data;
- struct set_entry *entry;
-
- set_foreach(job->bos, entry) {
- struct v3d_bo *bo = (void *)entry->key;
-
- if (addr >= bo->offset &&
- addr < bo->offset + bo->size) {
- v3d_bo_map(bo);
- *vaddr = bo->map + addr - bo->offset;
- return true;
- }
- }
-
- return false;
-}
-
static void
v3d_clif_dump(struct v3d_context *v3d, struct v3d_job *job)
{
@@ -368,8 +348,19 @@ v3d_clif_dump(struct v3d_context *v3d, struct v3d_job *job)
return;
struct clif_dump *clif = clif_dump_init(&v3d->screen->devinfo,
- stderr, v3d_clif_dump_lookup,
- job);
+ stderr);
+
+ struct set_entry *entry;
+ set_foreach(job->bos, entry) {
+ struct v3d_bo *bo = (void *)entry->key;
+ char *name = ralloc_asprintf(NULL, "%s_0x%x",
+ bo->name, bo->offset);
+
+ v3d_bo_map(bo);
+ clif_dump_add_bo(clif, name, bo->offset, bo->size, bo->map);
+
+ ralloc_free(name);
+ }
fprintf(stderr, "BCL: 0x%08x..0x%08x\n",
job->submit.bcl_start, job->submit.bcl_end);
@@ -379,6 +370,8 @@ v3d_clif_dump(struct v3d_context *v3d, struct v3d_job *job)
fprintf(stderr, "RCL: 0x%08x..0x%08x\n",
job->submit.rcl_start, job->submit.rcl_end);
clif_dump_add_cl(clif, job->submit.rcl_start, job->submit.rcl_end);
+
+ clif_dump_destroy(clif);
}
/**