All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] lib: Use fast WC reads for gem_pread fallback
@ 2021-06-02 20:10 Ashutosh Dixit
  2021-06-02 21:17 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
  2021-06-02 23:36 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  0 siblings, 2 replies; 4+ messages in thread
From: Ashutosh Dixit @ 2021-06-02 20:10 UTC (permalink / raw)
  To: igt-dev; +Cc: Chris Wilson

From: Chris Wilson <chris@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@intel.com>
Reviewed-by: Ashutosh Dixit <ashutosh.dixit@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

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [igt-dev] [PATCH i-g-t] lib/i915/intel_memory_region: free query_info in gem_get_lmem_region_count
@ 2021-06-02 19:53 Ashutosh Dixit
  2021-06-02 19:54 ` [igt-dev] [PATCH i-g-t] lib: Use fast WC reads for gem_pread fallback Ashutosh Dixit
  0 siblings, 1 reply; 4+ messages in thread
From: Ashutosh Dixit @ 2021-06-02 19:53 UTC (permalink / raw)
  To: igt-dev; +Cc: Matthew Auld

query_info calloc'd in gem_get_query_memory_regions should be freed in
gem_get_lmem_region_count.

Cc: Andrzej Turko <andrzej.turko@linux.intel.com>
Cc: Zbigniew Kempczynski <zbigniew.kempczynski@intel.com>
Cc: Matthew Auld <matthew.auld@intel.com>
Fixes: f32993a2ed ("lib/i915/intel_memory_region: Add new memory region lib")
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
 lib/i915/intel_memory_region.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/i915/intel_memory_region.c b/lib/i915/intel_memory_region.c
index 983ac4df07..144ae12ca7 100644
--- a/lib/i915/intel_memory_region.c
+++ b/lib/i915/intel_memory_region.c
@@ -149,6 +149,7 @@ uint8_t gem_get_lmem_region_count(int fd)
 		if (query_info->regions[i].region.memory_class == I915_MEMORY_CLASS_DEVICE)
 			lmem_regions += 1;
 	}
+	free(query_info);
 
 	return lmem_regions;
 }
-- 
2.31.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-02 23:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-02 20:10 [igt-dev] [PATCH i-g-t] lib: Use fast WC reads for gem_pread fallback Ashutosh Dixit
2021-06-02 21:17 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2021-06-02 23:36 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2021-06-02 19:53 [igt-dev] [PATCH i-g-t] lib/i915/intel_memory_region: free query_info in gem_get_lmem_region_count Ashutosh Dixit
2021-06-02 19:54 ` [igt-dev] [PATCH i-g-t] lib: Use fast WC reads for gem_pread fallback Ashutosh Dixit

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.