From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id DFBBA6EE5F for ; Wed, 2 Jun 2021 20:11:00 +0000 (UTC) From: Ashutosh Dixit Date: Wed, 2 Jun 2021 13:10:53 -0700 Message-Id: <20210602201053.12589-1-ashutosh.dixit@intel.com> MIME-Version: 1.0 Subject: [igt-dev] [PATCH i-g-t] lib: Use fast WC reads for gem_pread fallback List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: igt-dev@lists.freedesktop.org Cc: Chris Wilson List-ID: From: Chris Wilson 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 Reviewed-by: Ashutosh Dixit --- 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 _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev