Skip to contentSkip to conversation

lib/i915/intel_memory_region: free query_info in gem_get_lmem_region_count

PATCH New Ashutosh Dixit 1 participant 2 messages Jun 2, 2021 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/i915/intel_memory_region: free query_info in gem_get_lmem_region_count

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

Cc Andrzej Turko <[email protected]>
Cc Zbigniew Kempczynski <[email protected]>
Cc Matthew Auld <[email protected]>
Fixes f32993a2ed ("lib/i915/intel_memory_region: Add new memory region lib")
---
 lib/i915/intel_memory_region.c | 1 +
 1 file changed, 1 insertion(+)
lib/i915/intel_memory_region.c +1 -0
index 983ac4df07..144ae12ca7 100644
@@ -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;
 }
Signature · 6 lines
2.31.1

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#1 lore raw

PATCH 1/1 lib: Use fast WC reads for gem_pread fallback

From: Chris Wilson <[email protected]>

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

---
 lib/ioctl_wrappers.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
lib/ioctl_wrappers.c +2 -1
index 0c1b5e3230..619d288a8a 100644
@@ -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);
 }
 
Signature · 6 lines
2.31.1

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