diff mbox

drm/i915: Swap magics and use SZ_1M

Message ID 20180605135746.8020-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson June 5, 2018, 1:57 p.m. UTC
Since the kernel provides SZ_1M, use it in preference of 1 << 20.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michal Wajdeczko June 5, 2018, 2:13 p.m. UTC | #1
On Tue, 05 Jun 2018 15:57:46 +0200, Chris Wilson  
<chris@chris-wilson.co.uk> wrote:

> 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>
Chris Wilson June 5, 2018, 3:54 p.m. UTC | #2
Quoting Michal Wajdeczko (2018-06-05 15:13:59)
> On Tue, 05 Jun 2018 15:57:46 +0200, Chris Wilson  
> <chris@chris-wilson.co.uk> wrote:
> 
> > 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>

Thanks for pointing out the existence of SZ_1M and reviewing!
Pushed,
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index cb680ddafa0c..68fd54a38b87 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -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;