[igt-dev] [PATCH i-g-t] lib: Use fast WC reads for gem_pread fallback

Ashutosh Dixit ashutosh.dixit at intel.com
Wed Jun 2 19:54:00 UTC 2021


From: Chris Wilson <chris at chris-wilson.co.uk>

Replacing pread with an uncached read is abysmmally slow. Replacing
pread with a streaming read is still slow, but at least faster than not.

Signed-off-by: Chris Wilson <chris.p.wilson at intel.com>
Reviewed-by: Ashutosh Dixit <ashutosh.dixit at intel.com>
---
 lib/ioctl_wrappers.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
index 0c1b5e3230..619d288a8a 100644
--- a/lib/ioctl_wrappers.c
+++ b/lib/ioctl_wrappers.c
@@ -55,6 +55,7 @@
 #include "intel_io.h"
 #include "igt_debugfs.h"
 #include "igt_sysfs.h"
+#include "igt_x86.h"
 #include "config.h"
 #include "i915/gem_mman.h"
 
@@ -385,7 +386,7 @@ static void mmap_read(int fd, uint32_t handle, uint64_t offset, void *buf, uint6
 		gem_set_domain(fd, handle, I915_GEM_DOMAIN_WC, 0);
 	}
 
-	memcpy(buf, map + offset, length);
+	igt_memcpy_from_wc(buf, map + offset, length);
 	munmap(map, offset + length);
 }
 
-- 
2.31.1



More information about the igt-dev mailing list