From: Eric Anholt Date: Wed, 27 Jun 2018 23:58:55 +0000 (-0700) Subject: v3d: Include commands to run the BCL and RCL in CLIF dumps. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2df6f1a3dfcec9abc256c4648484e704b62d5210;p=mesa.git v3d: Include commands to run the BCL and RCL in CLIF dumps. --- diff --git a/src/broadcom/clif/clif_dump.c b/src/broadcom/clif/clif_dump.c index a637ba5999f..9562686c6d3 100644 --- a/src/broadcom/clif/clif_dump.c +++ b/src/broadcom/clif/clif_dump.c @@ -24,6 +24,7 @@ #include #include #include +#include "drm-uapi/v3d_drm.h" #include "clif_dump.h" #include "clif_private.h" #include "util/list.h" @@ -202,11 +203,6 @@ clif_process_worklist(struct clif_dump *clif) } } -void clif_dump(struct clif_dump *clif) -{ - clif_process_worklist(clif); -} - void clif_dump_add_cl(struct clif_dump *clif, uint32_t start, uint32_t end) { @@ -216,6 +212,35 @@ clif_dump_add_cl(struct clif_dump *clif, uint32_t start, uint32_t end) entry->cl.end = end; } +void +clif_dump(struct clif_dump *clif, const struct drm_v3d_submit_cl *submit) +{ + clif_dump_add_cl(clif, submit->bcl_start, submit->bcl_end); + clif_dump_add_cl(clif, submit->rcl_start, submit->rcl_end); + + clif_process_worklist(clif); + + out(clif, "@add_bin 0\n "); + out_address(clif, submit->bcl_start); + out(clif, "\n "); + out_address(clif, submit->bcl_end); + out(clif, "\n "); + out_address(clif, submit->qma); + out(clif, "\n %d\n ", submit->qms); + out_address(clif, submit->qts); + out(clif, "\n"); + out(clif, "@wait_bin_all_cores\n"); + + out(clif, "@add_render 0\n "); + out_address(clif, submit->rcl_start); + out(clif, "\n "); + out_address(clif, submit->rcl_end); + out(clif, "\n "); + out_address(clif, submit->qma); + out(clif, "\n"); + out(clif, "@wait_render_all_cores\n"); +} + void clif_dump_add_bo(struct clif_dump *clif, const char *name, uint32_t offset, uint32_t size, void *vaddr) diff --git a/src/broadcom/clif/clif_dump.h b/src/broadcom/clif/clif_dump.h index f0a8f9a1f14..8de3a2cbea4 100644 --- a/src/broadcom/clif/clif_dump.h +++ b/src/broadcom/clif/clif_dump.h @@ -29,10 +29,11 @@ struct v3d_device_info; struct clif_dump; +struct drm_v3d_submit_cl; struct clif_dump *clif_dump_init(const struct v3d_device_info *devinfo, FILE *output, bool pretty); -void clif_dump(struct clif_dump *clif); +void clif_dump(struct clif_dump *clif, const struct drm_v3d_submit_cl *submit); void clif_dump_destroy(struct clif_dump *clif); void clif_dump_add_bo(struct clif_dump *clif, const char *name, diff --git a/src/broadcom/clif/clif_private.h b/src/broadcom/clif/clif_private.h index 8753ba229f8..109701c3bc7 100644 --- a/src/broadcom/clif/clif_private.h +++ b/src/broadcom/clif/clif_private.h @@ -105,4 +105,18 @@ out(struct clif_dump *clif, const char *fmt, ...) va_end(args); } +static inline void +out_address(struct clif_dump *clif, uint32_t addr) +{ + struct clif_bo *bo = clif_lookup_bo(clif, addr); + if (bo) { + out(clif, "[%s+0x%08x] /* 0x%08x */", + bo->name, addr - bo->offset, addr); + } else if (addr) { + out(clif, "/* XXX: BO unknown */ 0x%08x", addr); + } else { + out(clif, "[null]"); + } +} + #endif /* CLIF_PRIVATE_H */ diff --git a/src/gallium/drivers/v3d/v3d_job.c b/src/gallium/drivers/v3d/v3d_job.c index d7df04c03c9..3645305f4f0 100644 --- a/src/gallium/drivers/v3d/v3d_job.c +++ b/src/gallium/drivers/v3d/v3d_job.c @@ -363,16 +363,7 @@ v3d_clif_dump(struct v3d_context *v3d, struct v3d_job *job) ralloc_free(name); } - fprintf(stderr, "BCL: 0x%08x..0x%08x\n", - job->submit.bcl_start, job->submit.bcl_end); - - clif_dump_add_cl(clif, job->submit.bcl_start, job->submit.bcl_end); - - 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(clif); + clif_dump(clif, &job->submit); clif_dump_destroy(clif); }