drm/i915: Swap magics and use SZ_1M
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 5 Jun 2018 13:57:46 +0000 (14:57 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 5 Jun 2018 15:16:41 +0000 (16:16 +0100)
Since the kernel provides SZ_1M, use it in preference of 1 << 20.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180605135746.8020-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_gem.c

index c41997595183685fed958c989d090d94587d9e8d..23374f3dd79d386e40efe21dd7ba70f5026ecdad 100644 (file)
@@ -1999,7 +1999,7 @@ compute_partial_view(struct drm_i915_gem_object *obj,
  */
 int i915_gem_fault(struct vm_fault *vmf)
 {
-#define MIN_CHUNK_PAGES ((1 << 20) >> PAGE_SHIFT) /* 1 MiB */
+#define MIN_CHUNK_PAGES (SZ_1M >> PAGE_SHIFT)
        struct vm_area_struct *area = vmf->vma;
        struct drm_i915_gem_object *obj = to_intel_bo(area->vm_private_data);
        struct drm_device *dev = obj->base.dev;