drm/i915: Move w/a 0477/WaDisableIPC:skl into intel_init_ipc()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 3 May 2019 17:38:07 +0000 (20:38 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 6 May 2019 14:53:28 +0000 (17:53 +0300)
Move the w/a to disable IPC on SKL closer to the actual code
that implements IPS. Otherwise I just end up confused as to
what is excluding SKL from considerations.

IMO this makes more sense anyway since the hw does have the
feature, we're just not supposed to use it.

And this also makes us actually disable IPC in case eg. the
BIOS enabled it when it shouldn't have.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190503173807.10834-3-ville.syrjala@linux.intel.com
drivers/gpu/drm/i915/i915_pci.c
drivers/gpu/drm/i915/intel_pm.c

index ffa2ee70a03d88c097e85a996cb02f29be05863b..d7c07a9474979dcd7e5ebb4ebe0c9d26197b0ec0 100644 (file)
@@ -600,8 +600,6 @@ static const struct intel_device_info intel_cherryview_info = {
 
 #define SKL_PLATFORM \
        GEN9_FEATURES, \
-       /* Display WA #0477 WaDisableIPC: skl */ \
-       .display.has_ipc = 0, \
        PLATFORM(INTEL_SKYLAKE)
 
 static const struct intel_device_info intel_skylake_gt1_info = {
index ce348dd6da2d9825a551a40dcb6f3478eeaa7f8f..decdd79c3805363df503c6beffa620e2e7e3f8a3 100644 (file)
@@ -6375,16 +6375,25 @@ void intel_enable_ipc(struct drm_i915_private *dev_priv)
        I915_WRITE(DISP_ARB_CTL2, val);
 }
 
+static bool intel_can_enable_ipc(struct drm_i915_private *dev_priv)
+{
+       /* Display WA #0477 WaDisableIPC: skl */
+       if (IS_SKYLAKE(dev_priv))
+               return false;
+
+       /* Display WA #1141: SKL:all KBL:all CFL */
+       if (IS_KABYLAKE(dev_priv) || IS_COFFEELAKE(dev_priv))
+               return dev_priv->dram_info.symmetric_memory;
+
+       return true;
+}
+
 void intel_init_ipc(struct drm_i915_private *dev_priv)
 {
        if (!HAS_IPC(dev_priv))
                return;
 
-       /* Display WA #1141: SKL:all KBL:all CFL */
-       if (IS_KABYLAKE(dev_priv) || IS_COFFEELAKE(dev_priv))
-               dev_priv->ipc_enabled = dev_priv->dram_info.symmetric_memory;
-       else
-               dev_priv->ipc_enabled = true;
+       dev_priv->ipc_enabled = intel_can_enable_ipc(dev_priv);
 
        intel_enable_ipc(dev_priv);
 }