diff mbox

[10/15] drm/i915: Use kmap_atomic for shmem pread

Message ID 1300801920-23130-11-git-send-email-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson March 22, 2011, 1:51 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 7f9be7a..96d4e64 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -314,13 +314,13 @@  slow_shmem_copy(struct page *dst_page,
 {
 	char *dst_vaddr, *src_vaddr;
 
-	dst_vaddr = kmap(dst_page);
-	src_vaddr = kmap(src_page);
+	dst_vaddr = kmap_atomic(dst_page);
+	src_vaddr = kmap_atomic(src_page);
 
 	memcpy(dst_vaddr + dst_offset, src_vaddr + src_offset, length);
 
-	kunmap(src_page);
-	kunmap(dst_page);
+	kunmap_atomic(src_vaddr);
+	kunmap_atomic(dst_vaddr);
 }
 
 static inline void
@@ -343,8 +343,8 @@  slow_shmem_bit17_copy(struct page *gpu_page,
 					       cpu_page, cpu_offset, length);
 	}
 
-	gpu_vaddr = kmap(gpu_page);
-	cpu_vaddr = kmap(cpu_page);
+	gpu_vaddr = kmap_atomic(gpu_page);
+	cpu_vaddr = kmap_atomic(cpu_page);
 
 	/* Copy the data, XORing A6 with A17 (1). The user already knows he's
 	 * XORing with the other bits (A9 for Y, A9 and A10 for X)
@@ -368,8 +368,8 @@  slow_shmem_bit17_copy(struct page *gpu_page,
 		length -= this_length;
 	}
 
-	kunmap(cpu_page);
-	kunmap(gpu_page);
+	kunmap_atomic(cpu_vaddr);
+	kunmap_atomic(gpu_vaddr);
 }
 
 /**