broadcom: add cl_nobin debug option

Dumps the command list, excluding the binary resources.

v2 (Juan):
 - Make this option independent from `cl`

v3 (Iago):
 - Rename option name
 - Fix style issues
 - Do not print BO ranges

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12803>
This commit is contained in:
Juan A. Suarez Romero 2021-09-10 13:08:22 +02:00 committed by Marge Bot
parent d220d8cb51
commit 9c158fcc70
8 changed files with 27 additions and 7 deletions

View file

@ -52,7 +52,7 @@ clif_dump_add_address_to_worklist(struct clif_dump *clif,
struct clif_dump *
clif_dump_init(const struct v3d_device_info *devinfo,
FILE *out, bool pretty)
FILE *out, bool pretty, bool nobin)
{
struct clif_dump *clif = rzalloc(NULL, struct clif_dump);
@ -60,6 +60,7 @@ clif_dump_init(const struct v3d_device_info *devinfo,
clif->out = out;
clif->spec = v3d_spec_load(devinfo);
clif->pretty = pretty;
clif->nobin = nobin;
list_inithead(&clif->worklist);
@ -238,6 +239,9 @@ static void
clif_dump_binary(struct clif_dump *clif, struct clif_bo *bo,
uint32_t start, uint32_t end)
{
if (clif->pretty && clif->nobin)
return;
if (start == end)
return;

View file

@ -32,7 +32,7 @@ struct clif_dump;
struct drm_v3d_submit_cl;
struct clif_dump *clif_dump_init(const struct v3d_device_info *devinfo,
FILE *output, bool pretty);
FILE *output, bool pretty, bool nobin);
void clif_dump(struct clif_dump *clif, const struct drm_v3d_submit_cl *submit);
void clif_dump_destroy(struct clif_dump *clif);

View file

@ -54,6 +54,11 @@ struct clif_dump {
* output.
*/
bool pretty;
/**
* Flag to no dump the binary resources.
*/
bool nobin;
};
enum reloc_worklist_type {

View file

@ -42,6 +42,8 @@ uint32_t V3D_DEBUG = 0;
static const struct debug_named_value debug_control[] = {
{ "cl", V3D_DEBUG_CL,
"Dump command list during creation" },
{ "cl_nobin", V3D_DEBUG_CL_NO_BIN,
"Dump command listduring creation, excluding binary resources" },
{ "clif", V3D_DEBUG_CLIF,
"Dump command list (CLIF format) during creation", },
{ "qpu", V3D_DEBUG_QPU,

View file

@ -62,6 +62,7 @@ extern uint32_t V3D_DEBUG;
#define V3D_DEBUG_TMU_32BIT (1 << 18)
#define V3D_DEBUG_TMU_16BIT (1 << 19)
#define V3D_DEBUG_NO_LOOP_UNROLL (1 << 20)
#define V3D_DEBUG_CL_NO_BIN (1 << 21)
#define V3D_DEBUG_SHADERS (V3D_DEBUG_TGSI | V3D_DEBUG_NIR | \
V3D_DEBUG_VIR | V3D_DEBUG_QPU | \

View file

@ -34,12 +34,16 @@ v3dv_clif_dump(struct v3dv_device *device,
struct v3dv_job *job,
struct drm_v3d_submit_cl *submit)
{
if (!(V3D_DEBUG & (V3D_DEBUG_CL | V3D_DEBUG_CLIF)))
if (!(V3D_DEBUG & (V3D_DEBUG_CL |
V3D_DEBUG_CL_NO_BIN |
V3D_DEBUG_CLIF)))
return;
struct clif_dump *clif = clif_dump_init(&device->devinfo,
stderr,
V3D_DEBUG & V3D_DEBUG_CL);
V3D_DEBUG & (V3D_DEBUG_CL |
V3D_DEBUG_CL_NO_BIN),
V3D_DEBUG & V3D_DEBUG_CL_NO_BIN);
set_foreach(job->bos, entry) {
struct v3dv_bo *bo = (void *)entry->key;

View file

@ -426,12 +426,16 @@ v3d_get_job_for_fbo(struct v3d_context *v3d)
static void
v3d_clif_dump(struct v3d_context *v3d, struct v3d_job *job)
{
if (!(V3D_DEBUG & (V3D_DEBUG_CL | V3D_DEBUG_CLIF)))
if (!(V3D_DEBUG & (V3D_DEBUG_CL |
V3D_DEBUG_CL_NO_BIN |
V3D_DEBUG_CLIF)))
return;
struct clif_dump *clif = clif_dump_init(&v3d->screen->devinfo,
stderr,
V3D_DEBUG & V3D_DEBUG_CL);
V3D_DEBUG & (V3D_DEBUG_CL |
V3D_DEBUG_CL_NO_BIN),
V3D_DEBUG & V3D_DEBUG_CL_NO_BIN);
set_foreach(job->bos, entry) {
struct v3d_bo *bo = (void *)entry->key;

View file

@ -42,7 +42,7 @@ vc4_dump_cl(void *cl, uint32_t size, bool is_render)
};
struct v3d_spec *spec = v3d_spec_load(&devinfo);
struct clif_dump *clif = clif_dump_init(&devinfo, stderr, true);
struct clif_dump *clif = clif_dump_init(&devinfo, stderr, true, false);
uint32_t offset = 0, hw_offset = 0;
uint8_t *p = cl;