Skip to contentSkip to conversation

Add vram write functionality

PATCH New Tom St Denis 1 participant 1 message Aug 29, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add vram write functionality

Also add --vram-read and -vr which will eventually replace --vram and -v.

---
 doc/umr.1           |  6 ++++-
 src/app/main.c      | 43 +++++++++++++++++++++++++++++---
 src/lib/read_vram.c | 72 ++++++++++++++++++++++++++++++++++-------------------
 src/umr.h           |  6 ++++-
 4 files changed, 97 insertions(+), 30 deletions(-)
doc/umr.1 +5 -1
index 06950925b7b6..b990ff2c412f 100644
@@ -94,12 +94,16 @@ The VMID can be specified in hexadecimal (with leading '0x') or in decimal.
 Implies '-O verbose' for the duration of the command so does not require it
 to be manually specified.
 
-.IP "--vram, -v [vmid@]<address> <size>"
+.IP "--vram-read, -vr [vmid@]<address> <size>"
 Read 'size' bytes (in hex) from the address specified (in hexadecimal) from VRAM
 to stdout.  Optionally specify the VMID (in decimal or in hex with a 0x prefix)
 treating the address as a virtual address instead.  Can use 'use_pci' to
 directly access VRAM.
 
+.IP "--vram-write, -vw [vmid@]<address> <size>"
+Write 'size' bytes (in hex) to the address specified (in hexadecimal) to VRAM
+from stdin.
+
 .IP "--update, -u" <filename>
 Specify update file to add, change, or delete registers from the register
 database.  Useful for adding registers that are not including in the kernel headers.
src/app/main.c +40 -3

65 lines not on this page · raw message

src/lib/read_vram.c +47 -25

157 lines not on this page · raw message

src/umr.h +5 -1
index b6fe4ee876a7..e49c80c081d2 100644
@@ -545,7 +545,11 @@ int umr_sq_cmd_halt_waves(struct umr_asic *asic, enum umr_sq_cmd_halt_resume mod
 /* IB/ring decoding/dumping/etc */
 void umr_print_decode(struct umr_asic *asic, struct umr_ring_decoder *decoder, uint32_t ib);
 void umr_dump_ib(struct umr_asic *asic, struct umr_ring_decoder *decoder);
-int umr_read_vram(struct umr_asic *asic, uint32_t vmid, uint64_t address, uint32_t size, void *dst);
+
+// memory access
+int umr_access_vram(struct umr_asic *asic, uint32_t vmid, uint64_t address, uint32_t size, void *data, int write_en);
+#define umr_read_vram(asic, vmid, address, size, dst) umr_access_vram(asic, vmid, address, size, dst, 0)
+#define umr_write_vram(asic, vmid, address, size, src) umr_access_vram(asic, vmid, address, size, src, 1)
 
 #define RED     (options.use_colour ? "\x1b[31;1m" : "")
 #define YELLOW  (options.use_colour ? "\x1b[33;1m" : "")
Signature · 6 lines
2.12.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx