[igt-dev] [PATCH i-g-t 1/2] benchmarks/gem_latency: change gtt to device coherent mapping

Ashutosh Dixit ashutosh.dixit at intel.com
Thu Jan 30 04:36:41 UTC 2020


From: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>

On newer gens with no mappable aperture we have to switch to
GEM_MMAP_OFFSET when reasonable. As gem_mmap__device_coherent()
wrapper was written to choose best maping method we can change gtt
mapping to it.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
---
 benchmarks/gem_latency.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/benchmarks/gem_latency.c b/benchmarks/gem_latency.c
index 0fc4b05ea..7269e22d2 100644
--- a/benchmarks/gem_latency.c
+++ b/benchmarks/gem_latency.c
@@ -242,7 +242,7 @@ static void setup_latency(struct producer *p, int gen, unsigned flags)
 	if (gem_has_llc(fd))
 		map = gem_mmap__cpu(fd, handle, 0, 4096, PROT_WRITE);
 	else
-		map = gem_mmap__gtt(fd, handle, 4096, PROT_WRITE);
+		map = gem_mmap__device_coherent(fd, handle, 0, 4096, PROT_WRITE);
 
 	p->latency_dispatch.exec[0].relocation_count = 1;
 	p->latency_dispatch.exec[0].relocs_ptr =
-- 
2.25.0



More information about the igt-dev mailing list