diff options
author | Eugeni Dodonov <eugeni.dodonov@intel.com> | 2012-07-02 10:51:05 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-07-05 03:55:16 -0400 |
commit | 5a7dc92a0b55ccaa6e342ec212657d6fc806e790 (patch) | |
tree | 68c51f54e558868d9d60ce9e80207193752d69bf /drivers/gpu/drm/i915/intel_pm.c | |
parent | e7911c48a05bc0002616a51e99761dec36110b04 (diff) |
drm/i915: add RPS configuration for Haswell
Most of the RPS and RC6 enabling functionality is similar to what we had
on Gen6/Gen7, so we preserve most of the registers.
Note that Haswell only has RC6, so account for that as well. As suggested
by Daniel Vetter, to reduce the amount of changes in the patch, we still
write the RC6p/RC6pp thresholds, but those are ignored on Haswell.
Note: Some discussion about the nature of the new tuning constants
popped up in review - the answer is that we don't know why they've
changed, but the guide from VPG with the magic numbers simply has
different values now.
v2: Squash fix for ?: vs | operation precende bug into this patch.
Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
[danvet: Added note to commit message. Squashed fix.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_pm.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_pm.c | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index ed9912ca1f82..4c6c26c5ad32 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c | |||
@@ -2404,20 +2404,24 @@ static void gen6_enable_rps(struct drm_device *dev) | |||
2404 | I915_WRITE(GEN6_RC6p_THRESHOLD, 100000); | 2404 | I915_WRITE(GEN6_RC6p_THRESHOLD, 100000); |
2405 | I915_WRITE(GEN6_RC6pp_THRESHOLD, 64000); /* unused */ | 2405 | I915_WRITE(GEN6_RC6pp_THRESHOLD, 64000); /* unused */ |
2406 | 2406 | ||
2407 | /* Check if we are enabling RC6 */ | ||
2407 | rc6_mode = intel_enable_rc6(dev_priv->dev); | 2408 | rc6_mode = intel_enable_rc6(dev_priv->dev); |
2408 | if (rc6_mode & INTEL_RC6_ENABLE) | 2409 | if (rc6_mode & INTEL_RC6_ENABLE) |
2409 | rc6_mask |= GEN6_RC_CTL_RC6_ENABLE; | 2410 | rc6_mask |= GEN6_RC_CTL_RC6_ENABLE; |
2410 | 2411 | ||
2411 | if (rc6_mode & INTEL_RC6p_ENABLE) | 2412 | /* We don't use those on Haswell */ |
2412 | rc6_mask |= GEN6_RC_CTL_RC6p_ENABLE; | 2413 | if (!IS_HASWELL(dev)) { |
2414 | if (rc6_mode & INTEL_RC6p_ENABLE) | ||
2415 | rc6_mask |= GEN6_RC_CTL_RC6p_ENABLE; | ||
2413 | 2416 | ||
2414 | if (rc6_mode & INTEL_RC6pp_ENABLE) | 2417 | if (rc6_mode & INTEL_RC6pp_ENABLE) |
2415 | rc6_mask |= GEN6_RC_CTL_RC6pp_ENABLE; | 2418 | rc6_mask |= GEN6_RC_CTL_RC6pp_ENABLE; |
2419 | } | ||
2416 | 2420 | ||
2417 | DRM_INFO("Enabling RC6 states: RC6 %s, RC6p %s, RC6pp %s\n", | 2421 | DRM_INFO("Enabling RC6 states: RC6 %s, RC6p %s, RC6pp %s\n", |
2418 | (rc6_mode & INTEL_RC6_ENABLE) ? "on" : "off", | 2422 | (rc6_mask & GEN6_RC_CTL_RC6_ENABLE) ? "on" : "off", |
2419 | (rc6_mode & INTEL_RC6p_ENABLE) ? "on" : "off", | 2423 | (rc6_mask & GEN6_RC_CTL_RC6p_ENABLE) ? "on" : "off", |
2420 | (rc6_mode & INTEL_RC6pp_ENABLE) ? "on" : "off"); | 2424 | (rc6_mask & GEN6_RC_CTL_RC6pp_ENABLE) ? "on" : "off"); |
2421 | 2425 | ||
2422 | I915_WRITE(GEN6_RC_CONTROL, | 2426 | I915_WRITE(GEN6_RC_CONTROL, |
2423 | rc6_mask | | 2427 | rc6_mask | |
@@ -2435,10 +2439,19 @@ static void gen6_enable_rps(struct drm_device *dev) | |||
2435 | I915_WRITE(GEN6_RP_INTERRUPT_LIMITS, | 2439 | I915_WRITE(GEN6_RP_INTERRUPT_LIMITS, |
2436 | dev_priv->max_delay << 24 | | 2440 | dev_priv->max_delay << 24 | |
2437 | dev_priv->min_delay << 16); | 2441 | dev_priv->min_delay << 16); |
2438 | I915_WRITE(GEN6_RP_UP_THRESHOLD, 10000); | 2442 | |
2439 | I915_WRITE(GEN6_RP_DOWN_THRESHOLD, 1000000); | 2443 | if (IS_HASWELL(dev)) { |
2440 | I915_WRITE(GEN6_RP_UP_EI, 100000); | 2444 | I915_WRITE(GEN6_RP_UP_THRESHOLD, 59400); |
2441 | I915_WRITE(GEN6_RP_DOWN_EI, 5000000); | 2445 | I915_WRITE(GEN6_RP_DOWN_THRESHOLD, 245000); |
2446 | I915_WRITE(GEN6_RP_UP_EI, 66000); | ||
2447 | I915_WRITE(GEN6_RP_DOWN_EI, 350000); | ||
2448 | } else { | ||
2449 | I915_WRITE(GEN6_RP_UP_THRESHOLD, 10000); | ||
2450 | I915_WRITE(GEN6_RP_DOWN_THRESHOLD, 1000000); | ||
2451 | I915_WRITE(GEN6_RP_UP_EI, 100000); | ||
2452 | I915_WRITE(GEN6_RP_DOWN_EI, 5000000); | ||
2453 | } | ||
2454 | |||
2442 | I915_WRITE(GEN6_RP_IDLE_HYSTERSIS, 10); | 2455 | I915_WRITE(GEN6_RP_IDLE_HYSTERSIS, 10); |
2443 | I915_WRITE(GEN6_RP_CONTROL, | 2456 | I915_WRITE(GEN6_RP_CONTROL, |
2444 | GEN6_RP_MEDIA_TURBO | | 2457 | GEN6_RP_MEDIA_TURBO | |
@@ -2446,7 +2459,7 @@ static void gen6_enable_rps(struct drm_device *dev) | |||
2446 | GEN6_RP_MEDIA_IS_GFX | | 2459 | GEN6_RP_MEDIA_IS_GFX | |
2447 | GEN6_RP_ENABLE | | 2460 | GEN6_RP_ENABLE | |
2448 | GEN6_RP_UP_BUSY_AVG | | 2461 | GEN6_RP_UP_BUSY_AVG | |
2449 | GEN6_RP_DOWN_IDLE_CONT); | 2462 | (IS_HASWELL(dev) ? GEN7_RP_DOWN_IDLE_AVG : GEN6_RP_DOWN_IDLE_CONT)); |
2450 | 2463 | ||
2451 | if (wait_for((I915_READ(GEN6_PCODE_MAILBOX) & GEN6_PCODE_READY) == 0, | 2464 | if (wait_for((I915_READ(GEN6_PCODE_MAILBOX) & GEN6_PCODE_READY) == 0, |
2452 | 500)) | 2465 | 500)) |