]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/i915/icl: Prevent incorrect DBuf enabling
authorImre Deak <imre.deak@intel.com>
Thu, 7 Mar 2019 10:32:35 +0000 (12:32 +0200)
committerImre Deak <imre.deak@intel.com>
Fri, 8 Mar 2019 08:07:49 +0000 (10:07 +0200)
Pretend that we have only 1 DBuf slice and that 1 slice is always
enabled, until we have a proper way for on-demand toggling of the second
slice.  Currently we'll try to incorrectly enable DBuf even when all
pipes are disabled and we are already runtime suspended (as the computed
number of DBuf slices will be 1 in that case).

This also means we'll leave the second slice enabled redundantly (except
when suspended), but that's an acceptable tradeoff until we have a
proper solution.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108756
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190307103235.23538-1-imre.deak@intel.com
drivers/gpu/drm/i915/intel_pm.c
drivers/gpu/drm/i915/intel_runtime_pm.c

index 9c97a95c1816b0d6cb6b1f12f0dd500e8d476a74..bece16ae6d15c0ce6ef63e8ac37e70eb1704c4e9 100644 (file)
@@ -3624,7 +3624,12 @@ static u8 intel_enabled_dbuf_slices_num(struct drm_i915_private *dev_priv)
        if (INTEL_GEN(dev_priv) < 11)
                return enabled_slices;
 
-       if (I915_READ(DBUF_CTL_S2) & DBUF_POWER_STATE)
+       /*
+        * FIXME: for now we'll only ever use 1 slice; pretend that we have
+        * only that 1 slice enabled until we have a proper way for on-demand
+        * toggling of the second slice.
+        */
+       if (0 && I915_READ(DBUF_CTL_S2) & DBUF_POWER_STATE)
                enabled_slices++;
 
        return enabled_slices;
index aa974b11928a09e051b9fae7bae67cbc80726998..676a89bb8194387e7848b70e07c8bc1985bc7dd3 100644 (file)
@@ -3576,7 +3576,11 @@ static void icl_dbuf_enable(struct drm_i915_private *dev_priv)
            !(I915_READ(DBUF_CTL_S2) & DBUF_POWER_STATE))
                DRM_ERROR("DBuf power enable timeout\n");
        else
-               dev_priv->wm.skl_hw.ddb.enabled_slices = 2;
+               /*
+                * FIXME: for now pretend that we only have 1 slice, see
+                * intel_enabled_dbuf_slices_num().
+                */
+               dev_priv->wm.skl_hw.ddb.enabled_slices = 1;
 }
 
 static void icl_dbuf_disable(struct drm_i915_private *dev_priv)
@@ -3591,7 +3595,11 @@ static void icl_dbuf_disable(struct drm_i915_private *dev_priv)
            (I915_READ(DBUF_CTL_S2) & DBUF_POWER_STATE))
                DRM_ERROR("DBuf power disable timeout!\n");
        else
-               dev_priv->wm.skl_hw.ddb.enabled_slices = 0;
+               /*
+                * FIXME: for now pretend that the first slice is always
+                * enabled, see intel_enabled_dbuf_slices_num().
+                */
+               dev_priv->wm.skl_hw.ddb.enabled_slices = 1;
 }
 
 static void icl_mbus_init(struct drm_i915_private *dev_priv)