summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-03-01 20:18:13 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-03-25 21:33:19 +0200
commitb88a04128782dbea1649344c6f1d202800c46612 (patch)
treeafc0fd34a1e0ad8d2ad93b65d4ff2f6c9e5fd687
parentad905cad0312be5bec3240db2100a173495af65c (diff)
drm/i915: mark pwrite/pread slowpaths with unlikelypwrite-pread
Beside helping the compiler untangle this maze they double-up as documentation for which a parts aren't performance-critical but just around to keep old (but already dead-slow) userspace from breaking. Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index cbd3bad121cb..755b5f9b00df 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -318,7 +318,7 @@ shmem_pread_fast(struct page *page, int shmem_page_offset, int page_length,
char *vaddr;
int ret;
- if (page_do_bit17_swizzling)
+ if (unlikely(page_do_bit17_swizzling))
return -EINVAL;
vaddr = kmap_atomic(page);
@@ -337,7 +337,7 @@ static void
shmem_clflush_swizzled_range(char *addr, unsigned long length,
bool swizzled)
{
- if (swizzled) {
+ if (unlikely(swizzled)) {
unsigned long start = (unsigned long) addr;
unsigned long end = (unsigned long) addr + length;
@@ -649,7 +649,7 @@ shmem_pwrite_fast(struct page *page, int shmem_page_offset, int page_length,
char *vaddr;
int ret;
- if (page_do_bit17_swizzling)
+ if (unlikely(page_do_bit17_swizzling))
return -EINVAL;
vaddr = kmap_atomic(page);
@@ -680,7 +680,7 @@ shmem_pwrite_slow(struct page *page, int shmem_page_offset, int page_length,
int ret;
vaddr = kmap(page);
- if (needs_clflush_before || page_do_bit17_swizzling)
+ if (unlikely(needs_clflush_before || page_do_bit17_swizzling))
shmem_clflush_swizzled_range(vaddr + shmem_page_offset,
page_length,
page_do_bit17_swizzling);