Skip to contentSkip to conversation

radeon faulty command stream dumping

RFC In review [email protected] 3 participants 7 messages May 16, 2012 – May 21, 2012

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

Attached is 2 patch for dumping everything needed to replay faulty command stream. I haven't add a module option in the radeon patch but the idea would be to enable the dumping only if it's requested.

I know AMD folks would like to reuse AMD internal format, but unless we can quickly get ACK to release it i would rather have this facility in and then latter add a userspace tools that can convert btw this format and the AMD format.

The format is described in rati.h, it would be come some kind of API. That's the reason why i changed the whole radeon family files, so it can be share btw kernel and userspace.

The replayer is available at:
git://people.freedesktop.org/~glisse/joujou

replayx replay a rati file under X and show the front buffer of the replayed command stream. It's not yet fully functional but i will work on r6xx with :
http://people.freedesktop.org/~glisse/lockup/dump-0000.rati

tati convert a rati file to text version so human can alter command stream or buffer to try to find the issue. It's not yet done either idea is to add comment to print register offset next to packet to make it easier.

I tested the kernel bits against couple variation of faulty command stream (bad shader, bad vertex count, bad index count, ...) and it seems to work ok.

The userspace tools need to grow the unrelocate capacity before being able to replay kernel captured command stream.

Mesa patch to dump command stream in same format as kernel:
http://people.freedesktop.org/~glisse/lockup/0001-radeong-add-rati-command-stream-dumping.patch

libdrm patch needed to either build the joujou or mesa with the patch
http://people.freedesktop.org/~glisse/lockup/0001-radeon-add-rati-dumping-helper.patch

(Also a bonus is that i regenerated cleanier header definition for r6xx see replayx_r6xxd.h)

Cheers,
Jerome

#1 lore raw

PATCH 1/2 drm/debugfs: allow driver to provide a custom read callback

From: Jerome Glisse <[email protected]>

Allow driver to provide a custom read callback for debugfs file. Usefull if driver try to dump big buffer, avoid double buffering.

---
 drivers/gpu/drm/drm_debugfs.c             |   19 ++++++++++++++++---
 drivers/gpu/drm/i915/i915_debugfs.c       |    2 +-
 drivers/gpu/drm/nouveau/nouveau_debugfs.c |    4 ++--
 drivers/gpu/drm/radeon/radeon_device.c    |    4 ++--
 include/drm/drmP.h                        |    8 +++++++-
 5 files changed, 28 insertions(+), 9 deletions(-)
drivers/gpu/drm/drm_debugfs.c +16 -3
index 1c7a1c0..d5194e6 100644
@@ -63,11 +63,22 @@ static int drm_debugfs_open(struct inode *inode, struct file *file)
 	return single_open(file, node->info_ent->show, node);
 }
 
+static ssize_t drm_debugfs_read(struct file *filp, char __user *ubuf,
+				size_t max, loff_t *ppos)
+{
+	struct seq_file *m = filp->private_data;
+	struct drm_info_node *node = (struct drm_info_node *) m->private;
+
+	if (node->read) {
+		return node->read(filp, ubuf, max, ppos);
+	}
+	return seq_read(filp, ubuf, max, ppos);
+}
 
 static const struct file_operations drm_debugfs_fops = {
 	.owner = THIS_MODULE,
 	.open = drm_debugfs_open,
-	.read = seq_read,
+	.read = drm_debugfs_read,
 	.llseek = seq_lseek,
 	.release = single_release,
 };
@@ -86,7 +97,8 @@ static const struct file_operations drm_debugfs_fops = {
  * gdm_debugfs_lists in the given root directory.
  */
 int drm_debugfs_create_files(struct drm_info_list *files, int count,
-			     struct dentry *root, struct drm_minor *minor)
+			     struct dentry *root, struct drm_minor *minor,
+			     drm_debugfs_read_t read)
 {
 	struct drm_device *dev = minor->dev;
 	struct dentry *ent;
@@ -118,6 +130,7 @@ int drm_debugfs_create_files(struct drm_info_list *files, int count,
 		tmp->minor = minor;
 		tmp->dent = ent;
 		tmp->info_ent = &files[i];
+		tmp->read = read;
 
 		mutex_lock(&minor->debugfs_lock);
 		list_add(&tmp->list, &minor->debugfs_list);
@@ -159,7 +172,7 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id,
 	}
 
 	ret = drm_debugfs_create_files(drm_debugfs_list, DRM_DEBUGFS_ENTRIES,
-				       minor->debugfs_root, minor);
+				       minor->debugfs_root, minor, NULL);
 	if (ret) {
 		debugfs_remove(minor->debugfs_root);
 		minor->debugfs_root = NULL;
drivers/gpu/drm/i915/i915_debugfs.c +1 -1
index 950f72a..636c4f4 100644
@@ -2018,7 +2018,7 @@ int i915_debugfs_init(struct drm_minor *minor)
 
 	return drm_debugfs_create_files(i915_debugfs_list,
 					I915_DEBUGFS_ENTRIES,
-					minor->debugfs_root, minor);
+					minor->debugfs_root, minor, NULL);
 }
 
 void i915_debugfs_cleanup(struct drm_minor *minor)
drivers/gpu/drm/nouveau/nouveau_debugfs.c +2 -2
index fa2ec49..12cbc5c 100644
@@ -94,7 +94,7 @@ nouveau_debugfs_channel_init(struct nouveau_channel *chan)
 
 	ret = drm_debugfs_create_files(&chan->debugfs.info, 1,
 				       dev_priv->debugfs.channel_root,
-				       chan->dev->primary);
+				       chan->dev->primary, NULL);
 	if (ret == 0)
 		chan->debugfs.active = true;
 	return ret;
@@ -186,7 +186,7 @@ int
 nouveau_debugfs_init(struct drm_minor *minor)
 {
 	drm_debugfs_create_files(nouveau_debugfs_list, NOUVEAU_DEBUGFS_ENTRIES,
-				 minor->debugfs_root, minor);
+				 minor->debugfs_root, minor, NULL);
 	return 0;
 }
 
drivers/gpu/drm/radeon/radeon_device.c +2 -2
index 3d41525..944ac11 100644
@@ -1039,10 +1039,10 @@ int radeon_debugfs_add_files(struct radeon_device *rdev,
 #if defined(CONFIG_DEBUG_FS)
 	drm_debugfs_create_files(files, nfiles,
 				 rdev->ddev->control->debugfs_root,
-				 rdev->ddev->control);
+				 rdev->ddev->control, NULL);
 	drm_debugfs_create_files(files, nfiles,
 				 rdev->ddev->primary->debugfs_root,
-				 rdev->ddev->primary);
+				 rdev->ddev->primary, NULL);
 #endif
 	return 0;
 }
include/drm/drmP.h +7 -1
index efd1249..1e41407 100644
@@ -1011,6 +1011,8 @@ struct drm_info_node {
 	struct drm_minor *minor;
 	struct drm_info_list *info_ent;
 	struct dentry *dent;
+	/* read callback */
+	ssize_t (*read)(struct file *filp, char __user *ubuf,size_t max, loff_t *ppos);
 };
 
 /**
@@ -1528,10 +1530,14 @@ extern int drm_proc_cleanup(struct drm_minor *minor, struct proc_dir_entry *root
 
 				/* Debugfs support */
 #if defined(CONFIG_DEBUG_FS)
+typedef ssize_t (drm_debugfs_read_t)(struct file *filp, char __user *ubuf,
+				     size_t max, loff_t *ppos);
+
 extern int drm_debugfs_init(struct drm_minor *minor, int minor_id,
 			    struct dentry *root);
 extern int drm_debugfs_create_files(struct drm_info_list *files, int count,
-				    struct dentry *root, struct drm_minor *minor);
+				    struct dentry *root, struct drm_minor *minor,
+				    drm_debugfs_read_t read);
 extern int drm_debugfs_remove_files(struct drm_info_list *files, int count,
                                     struct drm_minor *minor);
 extern int drm_debugfs_cleanup(struct drm_minor *minor);
Signature · 1 line
1.7.7.6
#2 lore raw

PATCH 2/2 drm/radeon: add lockup faulty command recording

In reply to [email protected]

From: Jerome Glisse <[email protected]>

This try to identify the faulty user command stream that caused lockup. If it finds one it create big blob that contains all information needed to replay the faulty command stream.

---
 drivers/gpu/drm/radeon/r100.c          |    6 +-
 drivers/gpu/drm/radeon/r300.c          |    2 +-
 drivers/gpu/drm/radeon/r420.c          |    2 +-
 drivers/gpu/drm/radeon/r600.c          |    2 +-
 drivers/gpu/drm/radeon/r600_cs.c       |    4 +-
 drivers/gpu/drm/radeon/radeon.h        |   72 +++++++++-----
 drivers/gpu/drm/radeon/radeon_cs.c     |   68 ++++++++++++--
 drivers/gpu/drm/radeon/radeon_device.c |   25 +++++-
 drivers/gpu/drm/radeon/radeon_family.h |  145 ++++++++++++++--------------
 drivers/gpu/drm/radeon/radeon_fence.c  |    2 +-
 drivers/gpu/drm/radeon/radeon_gart.c   |   10 ++-
 drivers/gpu/drm/radeon/radeon_object.h |   12 ++-
 drivers/gpu/drm/radeon/radeon_pm.c     |    2 +-
 drivers/gpu/drm/radeon/radeon_ring.c   |   21 ++++-
 drivers/gpu/drm/radeon/radeon_sa.c     |  112 ++++++++++++++++++++++
 drivers/gpu/drm/radeon/radeon_ttm.c    |    2 +-
 drivers/gpu/drm/radeon/rs400.c         |    2 +-
 drivers/gpu/drm/radeon/rv515.c         |    4 +-
 include/drm/rati.h                     |  163 ++++++++++++++++++++++++++++++++
 19 files changed, 524 insertions(+), 132 deletions(-)
 create mode 100644 include/drm/rati.h
drivers/gpu/drm/radeon/r100.c +3 -3
index 0874a6d..8ed365f 100644
@@ -2694,7 +2694,7 @@ static struct drm_info_list r100_debugfs_mc_info_list[] = {
 int r100_debugfs_rbbm_init(struct radeon_device *rdev)
 {
 #if defined(CONFIG_DEBUG_FS)
-	return radeon_debugfs_add_files(rdev, r100_debugfs_rbbm_list, 1);
+	return radeon_debugfs_add_files(rdev, r100_debugfs_rbbm_list, 1, NULL);
 #else
 	return 0;
 #endif
@@ -2703,7 +2703,7 @@ int r100_debugfs_rbbm_init(struct radeon_device *rdev)
 int r100_debugfs_cp_init(struct radeon_device *rdev)
 {
 #if defined(CONFIG_DEBUG_FS)
-	return radeon_debugfs_add_files(rdev, r100_debugfs_cp_list, 2);
+	return radeon_debugfs_add_files(rdev, r100_debugfs_cp_list, 2, NULL);
 #else
 	return 0;
 #endif
@@ -2712,7 +2712,7 @@ int r100_debugfs_cp_init(struct radeon_device *rdev)
 int r100_debugfs_mc_info_init(struct radeon_device *rdev)
 {
 #if defined(CONFIG_DEBUG_FS)
-	return radeon_debugfs_add_files(rdev, r100_debugfs_mc_info_list, 1);
+	return radeon_debugfs_add_files(rdev, r100_debugfs_mc_info_list, 1, NULL);
 #else
 	return 0;
 #endif
drivers/gpu/drm/radeon/r300.c +1 -1
index 97722a3..edb9eeb 100644
@@ -586,7 +586,7 @@ static struct drm_info_list rv370_pcie_gart_info_list[] = {
 static int rv370_debugfs_pcie_gart_info_init(struct radeon_device *rdev)
 {
 #if defined(CONFIG_DEBUG_FS)
-	return radeon_debugfs_add_files(rdev, rv370_pcie_gart_info_list, 1);
+	return radeon_debugfs_add_files(rdev, rv370_pcie_gart_info_list, 1, NULL);
 #else
 	return 0;
 #endif
drivers/gpu/drm/radeon/r420.c +1 -1
index 99137be..4eddcfc 100644
@@ -491,7 +491,7 @@ static struct drm_info_list r420_pipes_info_list[] = {
 int r420_debugfs_pipes_info_init(struct radeon_device *rdev)
 {
 #if defined(CONFIG_DEBUG_FS)
-	return radeon_debugfs_add_files(rdev, r420_pipes_info_list, 1);
+	return radeon_debugfs_add_files(rdev, r420_pipes_info_list, 1, NULL);
 #else
 	return 0;
 #endif
drivers/gpu/drm/radeon/r600.c +1 -1
index 4c0d8c9..afc458a 100644
@@ -3589,7 +3589,7 @@ static struct drm_info_list r600_mc_info_list[] = {
 int r600_debugfs_mc_info_init(struct radeon_device *rdev)
 {
 #if defined(CONFIG_DEBUG_FS)
-	return radeon_debugfs_add_files(rdev, r600_mc_info_list, ARRAY_SIZE(r600_mc_info_list));
+	return radeon_debugfs_add_files(rdev, r600_mc_info_list, ARRAY_SIZE(r600_mc_info_list), NULL);
 #else
 	return 0;
 #endif
drivers/gpu/drm/radeon/r600_cs.c +2 -2
index 0133f5f..0518c45 100644
@@ -97,7 +97,7 @@ struct gpu_formats {
 	unsigned blockheight;
 	unsigned blocksize;
 	unsigned valid_color;
-	enum radeon_family min_family;
+	unsigned min_family;
 };
 
 static const struct gpu_formats color_formats_table[] = {
@@ -185,7 +185,7 @@ bool r600_fmt_is_valid_color(u32 format)
 	return false;
 }
 
-bool r600_fmt_is_valid_texture(u32 format, enum radeon_family family)
+bool r600_fmt_is_valid_texture(u32 format, unsigned family)
 {
 	if (format >= ARRAY_SIZE(color_formats_table))
 		return false;
drivers/gpu/drm/radeon/radeon.h +45 -27

131 lines not on this page · raw message

drivers/gpu/drm/radeon/radeon_cs.c +61 -7

127 lines not on this page · raw message

drivers/gpu/drm/radeon/radeon_device.c +22 -3
index 944ac11..e785742 100644
@@ -38,6 +38,7 @@
 #include "atom.h"
 
 static const char radeon_family_name[][16] = {
+	"UNKNOWN",
 	"R100",
 	"RV100",
 	"RS100",
@@ -722,6 +723,14 @@ int radeon_device_init(struct radeon_device *rdev,
 	rdev->mc.gtt_size = radeon_gart_size * 1024 * 1024;
 	rdev->accel_working = false;
 
+	/* initializa blob dumping */
+	rdev->blob_dump = true;
+	rdev->blob_header.id = RATI_HEADER;
+	rdev->blob_header.ver = 1;
+	rdev->blob_header.pciid = rdev->pdev->vendor << 16;
+	rdev->blob_header.pciid |= rdev->pdev->device;
+	rdev->blob_header.family = rdev->family;
+
 	DRM_INFO("initializing kernel modesetting (%s 0x%04X:0x%04X 0x%04X:0x%04X).\n",
 		radeon_family_name[rdev->family], pdev->vendor, pdev->device,
 		pdev->subsystem_vendor, pdev->subsystem_device);
@@ -860,6 +869,10 @@ void radeon_device_fini(struct radeon_device *rdev)
 	iounmap(rdev->rmmio);
 	rdev->rmmio = NULL;
 	radeon_debugfs_remove_files(rdev);
+
+	rdev->blob_size = 0;
+	vfree(rdev->blob);
+	rdev->blob = NULL;
 }
 
 
@@ -987,6 +1000,11 @@ int radeon_gpu_reset(struct radeon_device *rdev)
 	int r;
 	int resched;
 
+	/* FIXME we should detect which ring caused a lockup and pass
+	 * appropriate ring parameter here
+	 */
+	radeon_sa_bo_faulty(rdev, &rdev->ring_tmp_bo, RADEON_RING_TYPE_GFX_INDEX);
+
 	radeon_save_bios_scratch_regs(rdev);
 	/* block TTM */
 	resched = ttm_bo_lock_delayed_workqueue(&rdev->mman.bdev);
@@ -1015,7 +1033,8 @@ int radeon_gpu_reset(struct radeon_device *rdev)
  */
 int radeon_debugfs_add_files(struct radeon_device *rdev,
 			     struct drm_info_list *files,
-			     unsigned nfiles)
+			     unsigned nfiles,
+			     drm_debugfs_read_t read)
 {
 	unsigned i;
 
@@ -1039,10 +1058,10 @@ int radeon_debugfs_add_files(struct radeon_device *rdev,
 #if defined(CONFIG_DEBUG_FS)
 	drm_debugfs_create_files(files, nfiles,
 				 rdev->ddev->control->debugfs_root,
-				 rdev->ddev->control, NULL);
+				 rdev->ddev->control, read);
 	drm_debugfs_create_files(files, nfiles,
 				 rdev->ddev->primary->debugfs_root,
-				 rdev->ddev->primary, NULL);
+				 rdev->ddev->primary, read);
 #endif
 	return 0;
 }
drivers/gpu/drm/radeon/radeon_family.h +71 -74

161 lines not on this page · raw message

drivers/gpu/drm/radeon/radeon_fence.c +1 -1
index 11f5f40..b4979c9 100644
@@ -618,7 +618,7 @@ static struct drm_info_list radeon_debugfs_fence_list[] = {
 int radeon_debugfs_fence_init(struct radeon_device *rdev)
 {
 #if defined(CONFIG_DEBUG_FS)
-	return radeon_debugfs_add_files(rdev, radeon_debugfs_fence_list, 1);
+	return radeon_debugfs_add_files(rdev, radeon_debugfs_fence_list, 1, NULL);
 #else
 	return 0;
 #endif
drivers/gpu/drm/radeon/radeon_gart.c +7 -3
index 8e9ef34..f9d7249 100644
@@ -433,7 +433,7 @@ retry_id:
 	vm->id = id;
 	list_add_tail(&vm->list, &rdev->vm_manager.lru_vm);
 	return radeon_vm_bo_update_pte(rdev, vm, rdev->ring_tmp_bo.bo,
-				       &rdev->ring_tmp_bo.bo->tbo.mem);
+				       &rdev->ring_tmp_bo.bo->tbo.mem, NULL);
 }
 
 /* object have to be reserved */
@@ -540,7 +540,8 @@ static u64 radeon_vm_get_addr(struct radeon_device *rdev,
 int radeon_vm_bo_update_pte(struct radeon_device *rdev,
 			    struct radeon_vm *vm,
 			    struct radeon_bo *bo,
-			    struct ttm_mem_reg *mem)
+			    struct ttm_mem_reg *mem,
+			    uint64_t *vm_offset)
 {
 	struct radeon_bo_va *bo_va;
 	unsigned ngpu_pages, i;
@@ -560,6 +561,9 @@ int radeon_vm_bo_update_pte(struct radeon_device *rdev,
 	if (bo_va->valid)
 		return 0;
 
+	if (vm_offset) {
+		*vm_offset = bo_va->soffset;
+	}
 	ngpu_pages = radeon_bo_ngpu_pages(bo);
 	bo_va->flags &= ~RADEON_VM_PAGE_VALID;
 	bo_va->flags &= ~RADEON_VM_PAGE_SYSTEM;
@@ -597,7 +601,7 @@ int radeon_vm_bo_rmv(struct radeon_device *rdev,
 
 	mutex_lock(&vm->mutex);
 	radeon_mutex_lock(&rdev->cs_mutex);
-	radeon_vm_bo_update_pte(rdev, vm, bo, NULL);
+	radeon_vm_bo_update_pte(rdev, vm, bo, NULL, NULL);
 	radeon_mutex_unlock(&rdev->cs_mutex);
 	list_del(&bo_va->vm_list);
 	mutex_unlock(&vm->mutex);
drivers/gpu/drm/radeon/radeon_object.h +11 -1
index befec7d..f9f4561 100644
@@ -93,6 +93,11 @@ static inline unsigned radeon_bo_gpu_page_alignment(struct radeon_bo *bo)
 	return (bo->tbo.mem.page_alignment << PAGE_SHIFT) / RADEON_GPU_PAGE_SIZE;
 }
 
+static inline unsigned radeon_bo_alignment(struct radeon_bo *bo)
+{
+	return (bo->tbo.mem.page_alignment << PAGE_SHIFT);
+}
+
 /**
  * radeon_bo_mmap_offset - return mmap offset of bo
  * @bo:	radeon object for which we query the offset
@@ -152,7 +157,7 @@ static inline uint64_t radeon_sa_bo_gpu_addr(struct radeon_sa_bo *sa_bo)
 	return sa_bo->manager->gpu_addr + sa_bo->soffset;
 }
 
-static inline void * radeon_sa_bo_cpu_addr(struct radeon_sa_bo *sa_bo)
+static inline void *radeon_sa_bo_cpu_addr(struct radeon_sa_bo *sa_bo)
 {
 	return sa_bo->manager->cpu_ptr + sa_bo->soffset;
 }
@@ -173,7 +178,12 @@ extern int radeon_sa_bo_new(struct radeon_device *rdev,
 extern void radeon_sa_bo_free(struct radeon_device *rdev,
 			      struct radeon_sa_bo **sa_bo,
 			      struct radeon_fence *fence);
+extern void radeon_sa_bo_faulty(struct radeon_device *rdev,
+				struct radeon_sa_manager *sa_manager,
+				unsigned ring);
 #if defined(CONFIG_DEBUG_FS)
+extern ssize_t radeon_blob_read(struct file *filp, char __user *ubuf,
+				size_t max, loff_t *ppos);
 extern void radeon_sa_bo_dump_debug_info(struct radeon_sa_manager *sa_manager,
 					 struct seq_file *m);
 #endif
drivers/gpu/drm/radeon/radeon_pm.c +1 -1
index 0882554..ee4fd15 100644
@@ -876,7 +876,7 @@ static struct drm_info_list radeon_pm_info_list[] = {
 static int radeon_debugfs_pm_init(struct radeon_device *rdev)
 {
 #if defined(CONFIG_DEBUG_FS)
-	return radeon_debugfs_add_files(rdev, radeon_pm_info_list, ARRAY_SIZE(radeon_pm_info_list));
+	return radeon_debugfs_add_files(rdev, radeon_pm_info_list, ARRAY_SIZE(radeon_pm_info_list), NULL);
 #else
 	return 0;
 #endif
drivers/gpu/drm/radeon/radeon_ring.c +18 -3
index a5dee76..f364f64 100644
@@ -494,11 +494,21 @@ static int radeon_debugfs_sa_info(struct seq_file *m, void *data)
 	radeon_sa_bo_dump_debug_info(&rdev->ring_tmp_bo, m);
 
 	return 0;
+}
+
+static int radeon_debugfs_lockup(struct seq_file *m, void *data)
+{
+	/* empty, should never be call */
+	return 0;
 
 }
 
 static struct drm_info_list radeon_debugfs_sa_list[] = {
-        {"radeon_sa_info", &radeon_debugfs_sa_info, 0, NULL},
+	{"radeon_sa_info", &radeon_debugfs_sa_info, 0, NULL},
+};
+
+static struct drm_info_list radeon_debugfs_lockup_list[] = {
+	{"radeon_lockup", &radeon_debugfs_lockup, 0, NULL},
 };
 
 #endif
@@ -515,7 +525,7 @@ int radeon_debugfs_ring_init(struct radeon_device *rdev, struct radeon_ring *rin
 		if (&rdev->ring[ridx] != ring)
 			continue;
 
-		r = radeon_debugfs_add_files(rdev, info, 1);
+		r = radeon_debugfs_add_files(rdev, info, 1, NULL);
 		if (r)
 			return r;
 	}
@@ -525,8 +535,13 @@ int radeon_debugfs_ring_init(struct radeon_device *rdev, struct radeon_ring *rin
 
 int radeon_debugfs_sa_init(struct radeon_device *rdev)
 {
+	int r;
 #if defined(CONFIG_DEBUG_FS)
-	return radeon_debugfs_add_files(rdev, radeon_debugfs_sa_list, 1);
+	r = radeon_debugfs_add_files(rdev, radeon_debugfs_sa_list, 1, NULL);
+	if (r) {
+		return r;
+	}
+	return radeon_debugfs_add_files(rdev, radeon_debugfs_lockup_list, 1, radeon_blob_read);
 #else
 	return 0;
 #endif
drivers/gpu/drm/radeon/radeon_sa.c +112 -0

131 lines not on this page · raw message

drivers/gpu/drm/radeon/radeon_ttm.c +1 -1
index 0f6aee8..b01c3c6 100644
@@ -903,7 +903,7 @@ static int radeon_ttm_debugfs_init(struct radeon_device *rdev)
 		radeon_mem_types_list[i++].data = NULL;
 	}
 #endif
-	return radeon_debugfs_add_files(rdev, radeon_mem_types_list, i);
+	return radeon_debugfs_add_files(rdev, radeon_mem_types_list, i, NULL);
 
 #endif
 	return 0;
drivers/gpu/drm/radeon/rs400.c +1 -1
index a464eb5..b135601 100644
@@ -364,7 +364,7 @@ static struct drm_info_list rs400_gart_info_list[] = {
 static int rs400_debugfs_pcie_gart_info_init(struct radeon_device *rdev)
 {
 #if defined(CONFIG_DEBUG_FS)
-	return radeon_debugfs_add_files(rdev, rs400_gart_info_list, 1);
+	return radeon_debugfs_add_files(rdev, rs400_gart_info_list, 1, NULL);
 #else
 	return 0;
 #endif
drivers/gpu/drm/radeon/rv515.c +2 -2
index 7f08ced..9a74cf2 100644
@@ -264,7 +264,7 @@ static struct drm_info_list rv515_ga_info_list[] = {
 int rv515_debugfs_pipes_info_init(struct radeon_device *rdev)
 {
 #if defined(CONFIG_DEBUG_FS)
-	return radeon_debugfs_add_files(rdev, rv515_pipes_info_list, 1);
+	return radeon_debugfs_add_files(rdev, rv515_pipes_info_list, 1, NULL);
 #else
 	return 0;
 #endif
@@ -273,7 +273,7 @@ int rv515_debugfs_pipes_info_init(struct radeon_device *rdev)
 int rv515_debugfs_ga_info_init(struct radeon_device *rdev)
 {
 #if defined(CONFIG_DEBUG_FS)
-	return radeon_debugfs_add_files(rdev, rv515_ga_info_list, 1);
+	return radeon_debugfs_add_files(rdev, rv515_ga_info_list, 1, NULL);
 #else
 	return 0;
 #endif
include/drm/rati.h new file +163 -0

163 lines not on this page · raw message

Signature · 1 line
1.7.7.6
maintainer
#3 lore raw

Re: [PATCH 2/2] drm/radeon: add lockup faulty command recording

Quoted 5 lines · On Wed, May 16, 2012 at 10:22 PM, <[email protected]> wrote:

From: Jerome Glisse <[email protected]>

This try to identify the faulty user command stream that caused lockup. If it finds one it create big blob that contains all information needed to replay the faulty command stream.

Can you state what exactly is going to end up in the dump?

ring? IB? what about vertex buffers or index buffers, the thing is should we be concentrating on replay
or just disecting the contents of the ring/IB for stupid things.

I know the Intel guys do the latter mostly and they seem to be quite adept at finding bugs in
mesa/ddx from it, when its the obviously reproducible type of hang, as opposed to the this GPU needs a really messed up workaround.

Otherwise I dislike the making of implicit ABI from the family and flags, if we ever have to reorder these it will become painful,

and the whitespace cleanups should be in another patch, they make it harder to see what is different, also pointless enum->defines.

Dave.

#4 lore raw

Re: [PATCH 2/2] drm/radeon: add lockup faulty command recording

Quoted 18 lines · Dave Airlie
Quoted 5 lines · On Wed, May 16, 2012 at 10:22 PM,  <[email protected]> wrote:

From: Jerome Glisse <[email protected]>

This try to identify the faulty user command stream that caused lockup. If it finds one it create big blob that contains all information needed to replay the faulty command stream.

Can you state what exactly is going to end up in the dump?

ring? IB? what about vertex buffers or index buffers, the thing is should we be concentrating on replay
or just disecting the contents of the ring/IB for stupid things.

I know the Intel guys do the latter mostly and they seem to be quite adept at finding bugs in
mesa/ddx from it, when its the obviously reproducible type of hang, as opposed to the this GPU needs a really messed up workaround.

Quoted 7 lines

Otherwise I dislike the making of implicit ABI from the family and flags, if we ever have to reorder these it will become painful,

and the whitespace cleanups should be in another patch, they make it harder to see what is different, also pointless enum->defines.

Dave.

It dumps ib + all bo relocated with the ib. So everything you need to fully replay the ib.

The way to use it is pick the dump turn draw packet into nop. Enable draw packet one by one until you lockup. Once you have the draw packet that triger the lockup, replace the fragment shader it use by a dumb nop frag shader and see if it lockup. If it doesn't lockup than it's fragment shader issue, if it does still lockup than it's either vertex/indices issue or vertex shader issue. You try replacing the vertex shader by something dumb but it's more complex to do than replacing frag shader.

Cheers,
Jerome

#5 lore raw

Re: [PATCH 2/2] drm/radeon: add lockup faulty command recording

In reply to Dave Airlie
Quoted 7 lines · Dave Airlie
Quoted 5 lines · On Wed, May 16, 2012 at 10:22 PM, <[email protected]> wrote:

From: Jerome Glisse <[email protected]>

This try to identify the faulty user command stream that caused lockup. If it finds one it create big blob that contains all information needed to replay the faulty command stream.

Quoted 5 lines

Can you state what exactly is going to end up in the dump?

ring? IB? what about vertex buffers or index buffers, the thing is should we be concentrating on replay
or just disecting the contents of the ring/IB for stupid things.

We just dump the batchbuffer and ignore all indirect state objects. Additionally we dump the instruction rings, associated hw state and the current hw state of crtcs (for pageflip/scanline wait related hangs). It's mostly good for hangs where the kernel screwed up things royally. For repeatable hangs (even due to hw quirks) the mesa team mostly switched to replaying apitraces, and also replaying them through our internal hw simulator (hence the recent set of patches to add AUB trace dumping to libdrm-intel).
-Daniel

Signature · 3 lines
Daniel Vetter
Mail: [email protected]
Mobile: +41 (0)79 365 57 48
#6 lore raw

Re: [PATCH 2/2] drm/radeon: add lockup faulty command recording

Quoted 14 lines · Daniel Vetter
Quoted 7 lines · Dave Airlie
Quoted 5 lines · On Wed, May 16, 2012 at 10:22 PM,  <[email protected]> wrote:

From: Jerome Glisse <[email protected]>

This try to identify the faulty user command stream that caused lockup. If it finds one it create big blob that contains all information needed to replay the faulty command stream.

Quoted 5 lines

Can you state what exactly is going to end up in the dump?

ring? IB? what about vertex buffers or index buffers, the thing is should we be concentrating on replay
or just disecting the contents of the ring/IB for stupid things.

Quoted 13 lines

We just dump the batchbuffer and ignore all indirect state objects. Additionally we dump the instruction rings, associated hw state and the current hw state of crtcs (for pageflip/scanline wait related hangs). It's mostly good for hangs where the kernel screwed up things royally. For repeatable hangs (even due to hw quirks) the mesa team mostly switched to replaying apitraces, and also replaying them through our internal hw simulator (hence the recent set of patches to add AUB trace dumping to libdrm-intel).
-Daniel
--
Daniel Vetter
Mail: [email protected]
Mobile: +41 (0)79 365 57 48

I have the feeling that for the lockup we get we often can't tell which app (GL, X or some X client) trigger lockup. That's why i think having a complete dump in kernel is usefull for us.

Cheers,
Jerome