Skip to contentSkip to conversation

drm/nouveau: add some basic debugfs dumping for nouveau's clients and vm mappings

PATCH New Maarten Lankhorst 1 participant 1 message Apr 17, 2014

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

PATCH 1/1 drm/nouveau: add some basic debugfs dumping for nouveau's clients and vm mappings

This adds some basic debug information about the internal nouveau state. making it slightly easier to determine which bo belongs to which vm address, as long as that program is still running.

---

drivers/gpu/drm/nouveau/core/include/subdev/vm.h +6 -0
index c9509039f94b..945ca4efe97c 100644
@@ -50,6 +50,12 @@ struct nouveau_vma {
 	struct nouveau_mm_node *node;
 	u64 offset;
 	u32 access;
+	enum nouveau_vma_mapping {
+		NOUVEAU_MAP_UNMAPPED,
+		NOUVEAU_MAP_SG,
+		NOUVEAU_MAP_GART,
+		NOUVEAU_MAP_VRAM
+	} mapping;
 };
 
 struct nouveau_vm {
drivers/gpu/drm/nouveau/core/subdev/vm/base.c +5 -0
index 7dd680ff2f6f..6deb6de88717 100644
@@ -70,6 +70,7 @@ nouveau_vm_map_at(struct nouveau_vma *vma, u64 delta, struct nouveau_mem *node)
 	}
 
 	vmm->flush(vm);
+	vma->mapping = NOUVEAU_MAP_VRAM;
 }
 
 static void
@@ -128,6 +129,7 @@ nouveau_vm_map_sg_table(struct nouveau_vma *vma, u64 delta, u64 length,
 	}
 finish:
 	vmm->flush(vm);
+	vma->mapping = NOUVEAU_MAP_SG;
 }
 
 static void
@@ -166,6 +168,7 @@ nouveau_vm_map_sg(struct nouveau_vma *vma, u64 delta, u64 length,
 	}
 
 	vmm->flush(vm);
+	vma->mapping = NOUVEAU_MAP_GART;
 }
 
 void
@@ -213,6 +216,7 @@ nouveau_vm_unmap_at(struct nouveau_vma *vma, u64 delta, u64 length)
 	}
 
 	vmm->flush(vm);
+	vma->mapping = NOUVEAU_MAP_UNMAPPED;
 }
 
 void
@@ -330,6 +334,7 @@ nouveau_vm_get(struct nouveau_vm *vm, u64 size, u32 page_shift,
 	nouveau_vm_ref(vm, &vma->vm, NULL);
 	vma->offset = (u64)vma->node->offset << 12;
 	vma->access = access;
+	vma->mapping = NOUVEAU_MAP_UNMAPPED;
 	return 0;
 }
 
drivers/gpu/drm/nouveau/nouveau_abi16.c +2 -0
index 900fae01793e..ba2d43fb37c6 100644
@@ -47,6 +47,8 @@ nouveau_abi16_get(struct drm_file *file_priv, struct drm_device *dev)
 		struct nouveau_abi16 *abi16;
 		cli->abi16 = abi16 = kzalloc(sizeof(*abi16), GFP_KERNEL);
 		if (cli->abi16) {
+			abi16->file = file_priv;
+
 			INIT_LIST_HEAD(&abi16->channels);
 			abi16->client = nv_object(cli);
 
drivers/gpu/drm/nouveau/nouveau_abi16.h +1 -0
index 90004081a501..79a66f0180a8 100644
@@ -31,6 +31,7 @@ struct nouveau_abi16 {
 	struct nouveau_object *client;
 	struct nouveau_object *device;
 	struct list_head channels;
+	struct drm_file *file;
 	u64 handles;
 };
 
drivers/gpu/drm/nouveau/nouveau_debugfs.c +204 -0

217 lines not on this page · raw message