drm/i915: Rework PPGTT init code
authorBen Widawsky <benjamin.widawsky@intel.com>
Tue, 9 Apr 2013 01:43:53 +0000 (18:43 -0700)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 18 Apr 2013 07:43:14 +0000 (09:43 +0200)
This rework will help if future platforms choose to be a bit different.
Should have no functional impact.

v2: Don't move around the vtable setup (Daniel)

v3: Squash in the disable-by-default patch.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net> (v1)
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem_gtt.c

index b4ba488e5c83b313244aa8df2382970837bc4ce5..b13ba9d53b19a9012b7e18ab43edbb085ba47793 100644 (file)
@@ -238,7 +238,11 @@ static int i915_gem_init_aliasing_ppgtt(struct drm_device *dev)
        ppgtt->dev = dev;
        ppgtt->scratch_page_dma_addr = dev_priv->gtt.scratch_page_dma;
 
-       ret = gen6_ppgtt_init(ppgtt);
+       if (INTEL_INFO(dev)->gen < 8)
+               ret = gen6_ppgtt_init(ppgtt);
+       else
+               BUG();
+
        if (ret)
                kfree(ppgtt);
        else