summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-03-25 19:47:43 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-03-27 13:41:41 +0200
commite7e58eb5c0d1d7d1a42fcb2b5a247d28ec08b47e (patch)
tree50757627f2cb424548fa4af48552facade94cab3
parent23c18c71da801fb7ce11acc3041e4f10a1bb5cb0 (diff)
drm/i915: mark pwrite/pread slowpaths with unlikely
Beside helping the compiler untangle this maze they double-up as documentation for which parts of the code aren't performance-critical but just around to keep old (but already dead-slow) userspace from breaking. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> 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 c964dfbdb57..b8c6248b25c 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -298,7 +298,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);
@@ -317,7 +317,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;
@@ -629,7 +629,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);
@@ -660,7 +660,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);