[Intel-gfx] [PATCH] drm/i915: Use memset64() to prefill the GTT page

Chris Wilson chris at chris-wilson.co.uk
Tue Sep 26 09:53:53 UTC 2017


Take advantage of optimised memset64() instead of open coding it to
prefill the GTT pages.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
Needs backmerge from 4.14-rc1, but it's tantalisingly close.
---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 0477949805e1..74062897d331 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -486,10 +486,8 @@ static void fill_page_dma(struct i915_address_space *vm,
 			  const u64 val)
 {
 	u64 * const vaddr = kmap_atomic(p->page);
-	int i;
 
-	for (i = 0; i < 512; i++)
-		vaddr[i] = val;
+	memset64(vaddr, val, PAGE_SIZE / sizeof(val));
 
 	kunmap_atomic(vaddr);
 }
-- 
2.14.1



More information about the Intel-gfx mailing list