drm/i915: Replace open-coded offset_in_page()
authorChris Wilson <chris@chris-wilson.co.uk>
Sun, 21 Jul 2013 16:23:11 +0000 (17:23 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 26 Jul 2013 17:45:11 +0000 (19:45 +0200)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem_execbuffer.c

index 1734825bef3438026f3dc97914f836b00f922fd1..5b6d764e9bb2dee30bf3ad7ee177f6dcbd4b0020 100644 (file)
@@ -255,7 +255,7 @@ i915_gem_execbuffer_relocate_entry(struct drm_i915_gem_object *obj,
 
        reloc->delta += target_offset;
        if (use_cpu_reloc(obj)) {
-               uint32_t page_offset = reloc->offset & ~PAGE_MASK;
+               uint32_t page_offset = offset_in_page(reloc->offset);
                char *vaddr;
 
                ret = i915_gem_object_set_to_cpu_domain(obj, 1);
@@ -284,7 +284,7 @@ i915_gem_execbuffer_relocate_entry(struct drm_i915_gem_object *obj,
                reloc_page = io_mapping_map_atomic_wc(dev_priv->gtt.mappable,
                                                      reloc->offset & PAGE_MASK);
                reloc_entry = (uint32_t __iomem *)
-                       (reloc_page + (reloc->offset & ~PAGE_MASK));
+                       (reloc_page + offset_in_page(reloc->offset));
                iowrite32(reloc->delta, reloc_entry);
                io_mapping_unmap_atomic(reloc_page);
        }