]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
drm/i915: Move intel_init_clock_gating() to i915_gem_init()
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 10 Nov 2017 14:26:30 +0000 (14:26 +0000)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 14 Feb 2020 06:42:20 +0000 (01:42 -0500)
BugLink: https://bugs.launchpad.net/bugs/1862840
Despite its name intel_init_clock_gating applies both display clock gating
workarounds; GT mmio workarounds and the occasional GT power context
workaround. Worse, sometimes it includes a context register workaround
which we need to apply before we record the default HW state for all
contexts.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171110142634.10551-4-chris@chris-wilson.co.uk
CVE-2020-8832

(cherry picked from commit cc6a818ad6bdb0d3008314cbd0fc9c9a2cd02695)
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Acked-by: Timo Aaltonen <timo.aaltonen@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/intel_display.c

index 2148ffbdb0126291fdba7cf21fe9e9eedefccc27..62752d3bf5be4a9b1e57191b002166ffada00e3d 100644 (file)
@@ -5023,6 +5023,21 @@ int i915_gem_init(struct drm_i915_private *dev_priv)
        intel_init_gt_powersave(dev_priv);
 
        ret = i915_gem_init_hw(dev_priv);
+       if (ret)
+               goto out_unlock;
+
+       /*
+        * Despite its name intel_init_clock_gating applies both display
+        * clock gating workarounds; GT mmio workarounds and the occasional
+        * GT power context workaround. Worse, sometimes it includes a context
+        * register workaround which we need to apply before we record the
+        * default HW state for all contexts.
+        *
+        * FIXME: break up the workarounds and apply them at the right time!
+        */
+       intel_init_clock_gating(dev_priv);
+
+out_unlock:
        if (ret == -EIO) {
                mutex_lock(&dev_priv->drm.struct_mutex);
 
@@ -5043,8 +5058,6 @@ int i915_gem_init(struct drm_i915_private *dev_priv)
 
                mutex_unlock(&dev_priv->drm.struct_mutex);
        }
-
-out_unlock:
        intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL);
        mutex_unlock(&dev_priv->drm.struct_mutex);
 
index 4ab77ac3cd7d70b2b316b542e2c3fc506391f5e1..158de3594e2ae05860c54d9d324d8649c541f413 100644 (file)
@@ -15287,8 +15287,6 @@ void intel_modeset_gem_init(struct drm_device *dev)
 {
        struct drm_i915_private *dev_priv = to_i915(dev);
 
-       intel_init_clock_gating(dev_priv);
-
        intel_setup_overlay(dev_priv);
 }