On IVB C0+ with newer BIOSes, the forcewake handshake has changed. There's
now a bitfield for different driver components to keep the GT powered
on. On Linux, we centralize forcewake handling in one place, so we
still just need a single bit, but we need to use the new registers if MT
forcewake is enabled.
This needs testing on affected machines. Please reply with your
tested-by if you had problems after a BIOS upgrade and this patch fixes
them.
v2: force MT mode. shift by 16
v3: set MT force wake bits then check ECOBUS
This patch was submitted to intel-gfx by upstream and has not yet made it
to the linus tree, the patch was backported to Oneiric, and tested on
ivybridge system.
BugLink: http://bugs.launchpad.net/bugs/891270
Tested-by: Keith Packard <keithp at keithp.com>
Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>
Signed-off-by: Keith Packard <keithp at keithp.com>
+void __gen6_gt_force_wake_mt_get(struct drm_i915_private *dev_priv)
+{
+ int count;
+
+ count = 0;
+ while (count++ < 50 && (I915_READ_NOTRACE(FORCEWAKE_MT_ACK) & 1))
+ udelay(10);
+
+ I915_WRITE_NOTRACE(FORCEWAKE_MT, (1<<16) | 1);
+ POSTING_READ(FORCEWAKE_MT);
+
+ count = 0;
+ while (count++ < 50 && (I915_READ_NOTRACE(FORCEWAKE_MT_ACK) & 1) == 0)
+ udelay(10);
+}
+
/*
* Generally this is called implicitly by the register read function. However,
* if some sequence requires the GT to not power down then this function should
@@ -323,15 +339,21 @@ void gen6_gt_force_wake_get(struct drm_i915_private *dev_priv)
/* Forcewake is atomic in case we get in here without the lock */
if (atomic_add_return(1, &dev_priv->forcewake_count) == 1)
- __gen6_gt_force_wake_get(dev_priv);
+ dev_priv->display.force_wake_get(dev_priv);
}
/* For FIFO watermark updates */
if (HAS_PCH_SPLIT(dev)) {
+ dev_priv->display.force_wake_get = __gen6_gt_force_wake_get;
+ dev_priv->display.force_wake_put = __gen6_gt_force_wake_put;
+
+ /* IVB configs may use multi-threaded forcewake */
+ if (IS_IVYBRIDGE(dev)) {
+ u32 ecobus;
+
+ mutex_lock(&dev->struct_mutex);
+ __gen6_gt_force_wake_mt_get(dev_priv);
+ ecobus = I915_READ(ECOBUS);
+ __gen6_gt_force_wake_mt_put(dev_priv);
+ mutex_unlock(&dev->struct_mutex);
+
+ if (ecobus & FORCEWAKE_MT_ENABLE) {
+ DRM_DEBUG_KMS("Using MT version of forcewake
");
+ dev_priv->display.force_wake_get =
+ __gen6_gt_force_wake_mt_get;
+ dev_priv->display.force_wake_put =
+ __gen6_gt_force_wake_mt_put;
+ }
+ }
+
if (HAS_PCH_IBX(dev))
dev_priv->display.init_pch_clock_gating = ibx_init_clock_gating;
else if (HAS_PCH_CPT(dev))
--
1.7.5.4
--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
11-22-2011, 11:02 AM
Herton Ronaldo Krzesinski
drm/i915: add multi-threaded forcewake support
On Mon, Nov 21, 2011 at 01:39:16PM -0600, Manoj Iyer wrote:
> From: Keith Packard <keithp at keithp.com>
>
> On IVB C0+ with newer BIOSes, the forcewake handshake has changed. There's
> now a bitfield for different driver components to keep the GT powered
> on. On Linux, we centralize forcewake handling in one place, so we
> still just need a single bit, but we need to use the new registers if MT
> forcewake is enabled.
>
> This needs testing on affected machines. Please reply with your
> tested-by if you had problems after a BIOS upgrade and this patch fixes
> them.
>
> v2: force MT mode. shift by 16
> v3: set MT force wake bits then check ECOBUS
>
> This patch was submitted to intel-gfx by upstream and has not yet made it
> to the linus tree, the patch was backported to Oneiric, and tested on
> ivybridge system.
>
> BugLink: http://bugs.launchpad.net/bugs/891270
>
> Tested-by: Keith Packard <keithp at keithp.com>
> Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>
> Signed-off-by: Keith Packard <keithp at keithp.com>
>
> Backported to 3.0
> Signed-off-by: Robert Hooker <robert.hooker@canonical.com>
> Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
It seems the following is missing from this backport, looking at the
posted patch on
http://permalink.gmane.org/gmane.comp.freedesktop.xorg.drivers.intel/7192
--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
11-22-2011, 03:27 PM
Robert Hooker
drm/i915: add multi-threaded forcewake support
On Tue, Nov 22, 2011 at 7:02 AM, Herton Ronaldo Krzesinski
<herton.krzesinski@canonical.com> wrote:
> It seems the following is missing from this backport, looking at the
> posted patch on
> http://permalink.gmane.org/gmane.comp.freedesktop.xorg.drivers.intel/7192
>
> #define NEEDS_FORCE_WAKE(dev_priv, reg)
> * * * *(((dev_priv)->info->gen >= 6) &&
> - * * * ((reg) < 0x40000) &&
> - * * * ((reg) != FORCEWAKE))
> + * * * *((reg) < 0x40000) && * * * * * *
> + * * * *((reg) != FORCEWAKE) && * * * *
> + * * * *((reg) != ECOBUS))
>
> Any reason to not update the NEEDS_FORCE_WAKE macro?
>
>
> --
> []'s
> Herton
>
> --
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
>
My mistake, thanks for catching that! I only meant to drop the
identical hunk from i915_drv.c which isn't there in 3.0 due to
f700088333c5c7e5a7f4ab71b642362290259e26 but ended up dropping it from
i915_drv.h too.
--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team