[Intel-gfx] [RFC][PATCH] drm/i915 Prefetch data from memory

ling.ma at intel.com ling.ma at intel.com
Tue Jul 21 08:18:32 CEST 2009


We read data from memory(WB type), in most cases we need not 
care about prefetch because hardware data prefetch is good enough.
However here our gpu address is not continuous, hardware prefetch
is not effective, so we intends to prefetch data in advance.

Thanks
Ma Ling

Signed-off-by: Ma Ling <ling.ma at intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 5bf4203..815e02f 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -227,7 +227,10 @@ slow_shmem_bit17_copy(struct page *gpu_page,
 		int cacheline_end = ALIGN(gpu_offset + 1, 64);
 		int this_length = min(cacheline_end - gpu_offset, length);
 		int swizzled_gpu_offset = gpu_offset ^ 64;
+		int next_gpu_cache_line_addr = gpu_vaddr +
+					((gpu_offset + this_length) ^ 64);
 
+		prefetch(next_gpu_cache_line_addr);
 		if (is_read) {
 			memcpy(cpu_vaddr + cpu_offset,
 			       gpu_vaddr + swizzled_gpu_offset,
-- 
1.5.4.4




More information about the Intel-gfx mailing list