Revert "switch over from ttm trace to iova debugfs entry (v3)"
PATCH 1/2 Revert "switch over from ttm trace to iova debugfs entry (v3)"
This reverts commit 0e1c378fce66db833e08770d888dda1c5ec7936a.
--- src/lib/CMakeLists.txt | 1 + src/lib/close_asic.c | 2 +- src/lib/discover.c | 3 - src/lib/free_maps.c | 44 ++++++++++ src/lib/read_vram.c | 218 ++++++++++++++++++++++++++++++++++++++++++++----- src/umr.h | 14 +++- 6 files changed, 254 insertions(+), 28 deletions(-) create mode 100644 src/lib/free_maps.c
src/lib/CMakeLists.txt +1 -0
@@ -14,6 +14,7 @@ add_library(umrcore STATIC discover.c dump_ib.c find_reg.c + free_maps.c mmio.c query_drm.c read_sensor.c
src/lib/close_asic.c +1 -1
@@ -29,6 +29,7 @@void umr_free_asic (struct umr_asic *asic) {int x; +umr_free_maps (asic);if (asic->pci.mem !=NULL ) {// free PCI mapping pci_device_unmap_range (asic->pci.pdevice, asic->pci.mem, asic->pci.pdevice->regions[asic->pci.region].size);
@@ -56,7 +57,6 @@ void umr_close_asic(struct umr_asic *asic)cond_close (asic->fd.vram);cond_close (asic->fd.gpr);cond_close (asic->fd.drm); -cond_close (asic->fd.iova);umr_free_asic (asic); } }
src/lib/discover.c +0 -3
@@ -222,8 +222,6 @@ struct umr_asic *umr_discover_asic(struct umr_options *options) asic->fd.vram =open (fname,O_RDWR );snprintf (fname,sizeof (fname)-1 ,"/sys/kernel/debug/dri/%d/amdgpu_gpr" , asic->instance); asic->fd.gpr =open (fname,O_RDWR ); -snprintf (fname,sizeof (fname)-1 ,"/sys/kernel/debug/dri/%d/amdgpu_iova" , asic->instance); - asic->fd.iova =open (fname,O_RDWR ); asic->fd.drm =-1 ;// default to closed // if appending to the fd list remember to update close_asic() and discover_by_did()... }else {
@@ -237,7 +235,6 @@ struct umr_asic *umr_discover_asic(struct umr_options *options) asic->fd.vram =-1 ; asic->fd.gpr =-1 ; asic->fd.drm =-1 ; - asic->fd.iova =-1 ; }if (options->use_pci) {
src/lib/free_maps.c new file +44 -0
44 lines not on this page · raw message
src/lib/read_vram.c +196 -22
277 lines not on this page · raw message
src/umr.h +12 -2
@@ -210,6 +210,17 @@ struct umr_options { } pci; }; +struct umr_dma_maps { +struct umr_map { +uint64_t + dma_addr, + phys_addr, + key; +int valid; +struct umr_map *left, *right; + } *maps; +}; +struct umr_asic {char *asicname;int no_blocks;
@@ -232,8 +243,7 @@ struct umr_asic { drm, wave, vram, - gpr, - iova; + gpr; } fd;struct {struct pci_device *pdevice;
Signature · 6 lines
2.12.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 2/2 switch over from ttm trace to iova debugfs entry (v3)
(v3): Use original version of iova file but add support for non-iommu hosts.
Signed-off-by Tom St Denis <[email protected]>
--- src/lib/CMakeLists.txt | 1 - src/lib/close_asic.c | 2 +- src/lib/discover.c | 3 + src/lib/free_maps.c | 44 ------------- src/lib/read_vram.c | 169 ++----------------------------------------------- src/umr.h | 14 +--- 6 files changed, 13 insertions(+), 220 deletions(-) delete mode 100644 src/lib/free_maps.c
src/lib/CMakeLists.txt +0 -1
@@ -14,7 +14,6 @@ add_library(umrcore STATIC discover.c dump_ib.c find_reg.c - free_maps.c mmio.c query_drm.c read_sensor.c
src/lib/close_asic.c +1 -1
@@ -29,7 +29,6 @@void umr_free_asic (struct umr_asic *asic) {int x; -umr_free_maps (asic);if (asic->pci.mem !=NULL ) {// free PCI mapping pci_device_unmap_range (asic->pci.pdevice, asic->pci.mem, asic->pci.pdevice->regions[asic->pci.region].size);
@@ -57,6 +56,7 @@ void umr_close_asic(struct umr_asic *asic)cond_close (asic->fd.vram);cond_close (asic->fd.gpr);cond_close (asic->fd.drm); +cond_close (asic->fd.iova);umr_free_asic (asic); } }
src/lib/discover.c +3 -0
@@ -222,6 +222,8 @@ struct umr_asic *umr_discover_asic(struct umr_options *options) asic->fd.vram =open (fname,O_RDWR );snprintf (fname,sizeof (fname)-1 ,"/sys/kernel/debug/dri/%d/amdgpu_gpr" , asic->instance); asic->fd.gpr =open (fname,O_RDWR ); +snprintf (fname,sizeof (fname)-1 ,"/sys/kernel/debug/dri/%d/amdgpu_iova" , asic->instance); + asic->fd.iova =open (fname,O_RDWR ); asic->fd.drm =-1 ;// default to closed // if appending to the fd list remember to update close_asic() and discover_by_did()... }else {
@@ -235,6 +237,7 @@ struct umr_asic *umr_discover_asic(struct umr_options *options) asic->fd.vram =-1 ; asic->fd.gpr =-1 ; asic->fd.drm =-1 ; + asic->fd.iova =-1 ; }if (options->use_pci) {
src/lib/free_maps.c deleted +0 -44
44 lines not on this page · raw message
src/lib/read_vram.c +7 -162
185 lines not on this page · raw message
src/umr.h +2 -12
@@ -210,17 +210,6 @@ struct umr_options { } pci; }; -struct umr_dma_maps { -struct umr_map { -uint64_t - dma_addr, - phys_addr, - key; -int valid; -struct umr_map *left, *right; - } *maps; -}; -struct umr_asic {char *asicname;int no_blocks;
@@ -243,7 +232,8 @@ struct umr_asic { drm, wave, vram, - gpr; + gpr, + iova; } fd;struct {struct pci_device *pdevice;
Signature · 6 lines
2.12.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx