[PATCH 26/26] drm/radeon: add the ib content and relocs to the ring debugfs file
Jerome Glisse
j.glisse at gmail.com
Wed Apr 25 07:36:21 PDT 2012
2012/4/25 Christian König <deathsimple at vodafone.de>:
> Signed-off-by: Christian König <deathsimple at vodafone.de>
> ---
> drivers/gpu/drm/radeon/radeon_ring.c | 22 ++++++++++++++++++++++
> 1 files changed, 22 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_ring.c b/drivers/gpu/drm/radeon/radeon_ring.c
> index 1c4348c..c563c25 100644
> --- a/drivers/gpu/drm/radeon/radeon_ring.c
> +++ b/drivers/gpu/drm/radeon/radeon_ring.c
> @@ -481,6 +481,25 @@ void radeon_ring_fini(struct radeon_device *rdev, struct radeon_ring *ring)
> */
> #if defined(CONFIG_DEBUG_FS)
>
> +static void radeon_ib_dump(struct seq_file *m, struct radeon_ib *ib)
> +{
> + unsigned i;
> +
> + seq_printf(m, "\n");
> + seq_printf(m, "\tIB relocs (%d)\n", ib->nrelocs);
> + for (i = 0; i < ib->nrelocs; ++i) {
> + struct radeon_bo *bo = ib->relocs[i].robj;
> + seq_printf(m, "\t%d: %9ld bytes @ 0x%09LX\n", i,
> + radeon_bo_size(bo), radeon_bo_gpu_offset(bo));
> + }
> + seq_printf(m, "\n");
> + seq_printf(m, "\tIB size %05u dwords\n", ib->length_dw);
> + for (i = 0; i < ib->length_dw; ++i) {
> + seq_printf(m, "\t[%05u]=0x%08X\n", i, ib->ptr[i]);
> + }
> + seq_printf(m, "\n");
> +}
> +
> static int radeon_debugfs_ring_info(struct seq_file *m, void *data)
> {
> struct drm_info_node *node = (struct drm_info_node *) m->private;
> @@ -522,6 +541,9 @@ static int radeon_debugfs_ring_info(struct seq_file *m, void *data)
> fence = NULL;
> }
> for (j = 0; j <= count; j++) {
> + if (fence && fence->emitted_at == i && fence->ib) {
> + radeon_ib_dump(m, fence->ib);
> + }
> seq_printf(m, "r[%04d]=0x%08x", i, ring->ring[i]);
> if (i == ring->rptr) {
> seq_printf(m, " <- RPTR ");
> --
> 1.7.5.4
>
NAK i would rather have a full dump as i described. I can do a patch
for that if you want.
Cheers,
Jerome
More information about the dri-devel
mailing list