Try /dev/fmem first when reading system memory
PATCH 1/1 Try /dev/fmem first when reading system memory
On many platforms /dev/mem is restricted to PCI I/O space only. The /dev/fmem device driver can be found
on github and it allows unrestricted access to physical memory.
Signed-off-by Tom St Denis <[email protected]>
--- src/lib/read_vram.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
src/lib/read_vram.c +4 -1
@@ -61,7 +61,9 @@ static int umr_read_sram(uint64_t address, uint32_t size, void *dst) {int fd; - fd =open ("/dev/mem" ,O_RDWR |O_DSYNC ); + fd =open ("/dev/fmem" ,O_RDWR ); +if (fd <0 ) + fd =open ("/dev/mem" ,O_RDWR |O_DSYNC );if (fd >=0 ) {memset (dst,0xFF , size);lseek (fd, address,SEEK_SET );
@@ -192,6 +194,7 @@ static int umr_read_vram_vi(struct umr_asic *asic, uint32_t vmid, uint64_t addreif (pte_fields.system) {if (umr_read_sram (start_addr, chunk_size, pdst) <0 ) {fprintf (stderr,"[ERROR] Cannot read system ram, perhaps CONFIG_STRICT_DEVMEM is set in your kernel config?\n" ); +fprintf (stderr,"[ERROR] Alternatively download and install /dev/fmem\n" );return -1 ; } }else {
Signature · 6 lines
2.12.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx