Skip to content

Commit 99ac961

Browse files
committed
drm/i915: Move overclocking detection to alongside RPS frequency detection
Move the overclocking max frequency detection alongside the regular frequency detection, before we expose the undefined value to userspace. Signed-off-by: Chris Wilson <[email protected]> Reviewed-by: Mika Kuoppala <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 773ea9a commit 99ac961

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

drivers/gpu/drm/i915/intel_pm.c

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5343,7 +5343,7 @@ static void gen8_enable_rps(struct drm_i915_private *dev_priv)
53435343
static void gen6_enable_rps(struct drm_i915_private *dev_priv)
53445344
{
53455345
struct intel_engine_cs *engine;
5346-
u32 rc6vids, pcu_mbox = 0, rc6_mask = 0;
5346+
u32 rc6vids, rc6_mask = 0;
53475347
u32 gtfifodbg;
53485348
int rc6_mode;
53495349
int ret;
@@ -5417,14 +5417,6 @@ static void gen6_enable_rps(struct drm_i915_private *dev_priv)
54175417
if (ret)
54185418
DRM_DEBUG_DRIVER("Failed to set the min frequency\n");
54195419

5420-
ret = sandybridge_pcode_read(dev_priv, GEN6_READ_OC_PARAMS, &pcu_mbox);
5421-
if (!ret && (pcu_mbox & (1<<31))) { /* OC supported */
5422-
DRM_DEBUG_DRIVER("Overclocking supported. Max: %dMHz, Overclock max: %dMHz\n",
5423-
(dev_priv->rps.max_freq_softlimit & 0xff) * 50,
5424-
(pcu_mbox & 0xff) * 50);
5425-
dev_priv->rps.max_freq = pcu_mbox & 0xff;
5426-
}
5427-
54285420
reset_rps(dev_priv, gen6_set_rps);
54295421

54305422
rc6vids = 0;
@@ -6526,6 +6518,20 @@ void intel_init_gt_powersave(struct drm_i915_private *dev_priv)
65266518
dev_priv->rps.efficient_freq,
65276519
intel_freq_opcode(dev_priv, 450));
65286520

6521+
/* After setting max-softlimit, find the overclock max freq */
6522+
if (IS_GEN6(dev_priv) ||
6523+
IS_IVYBRIDGE(dev_priv) || IS_HASWELL(dev_priv)) {
6524+
u32 params = 0;
6525+
6526+
sandybridge_pcode_read(dev_priv, GEN6_READ_OC_PARAMS, &params);
6527+
if (params & BIT(31)) { /* OC supported */
6528+
DRM_DEBUG_DRIVER("Overclocking supported, max: %dMHz, overclock: %dMHz\n",
6529+
(dev_priv->rps.max_freq & 0xff) * 50,
6530+
(params & 0xff) * 50);
6531+
dev_priv->rps.max_freq = params & 0xff;
6532+
}
6533+
}
6534+
65296535
mutex_unlock(&dev_priv->rps.hw_lock);
65306536
}
65316537

0 commit comments

Comments
 (0)