drm/i915: Move edram detection early_sanitize
authorBen Widawsky <benjamin.widawsky@intel.com>
Sat, 5 Oct 2013 04:22:50 +0000 (21:22 -0700)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 10 Oct 2013 10:47:07 +0000 (12:47 +0200)
In order to be able to have virtual functions for the MMIO, we need to
use the raw access function. To keep things simple, just move this to
our early_sanitize code in uncore.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_dma.c
drivers/gpu/drm/i915/intel_uncore.c

index ff2083e805ee3929123be66a2f021d995d7add05..3316a6f37ceca1e47c1d32a9e52f9839611580a7 100644 (file)
@@ -1542,16 +1542,6 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
 
        intel_uncore_early_sanitize(dev);
 
-       if (IS_HASWELL(dev) && (I915_READ(HSW_EDRAM_PRESENT) == 1)) {
-               /* The docs do not explain exactly how the calculation can be
-                * made. It is somewhat guessable, but for now, it's always
-                * 128MB.
-                * NB: We can't write IDICR yet because we do not have gt funcs
-                * set up */
-               dev_priv->ellc_size = 128;
-               DRM_INFO("Found %zuMB of eLLC\n", dev_priv->ellc_size);
-       }
-
        ret = i915_gem_gtt_init(dev);
        if (ret)
                goto out_regs;
index bfc1a65fcd9055e13550712ca32ab034b5a059cd..2d16590d5478f02a48163e23c0beda3cb14cc8aa 100644 (file)
@@ -222,6 +222,17 @@ void intel_uncore_early_sanitize(struct drm_device *dev)
 
        if (HAS_FPGA_DBG_UNCLAIMED(dev))
                __raw_i915_write32(dev_priv, FPGA_DBG, FPGA_DBG_RM_NOCLAIM);
+
+       if (IS_HASWELL(dev) &&
+           (__raw_i915_read32(dev_priv, HSW_EDRAM_PRESENT) == 1)) {
+               /* The docs do not explain exactly how the calculation can be
+                * made. It is somewhat guessable, but for now, it's always
+                * 128MB.
+                * NB: We can't write IDICR yet because we do not have gt funcs
+                * set up */
+               dev_priv->ellc_size = 128;
+               DRM_INFO("Found %zuMB of eLLC\n", dev_priv->ellc_size);
+       }
 }
 
 void intel_uncore_init(struct drm_device *dev)