diff options
author | Ben Widawsky <ben@bwidawsk.net> | 2013-01-29 15:00:15 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-01-31 05:50:08 -0500 |
commit | f82855d342b6c8483c56e6d2e200a71731509a39 (patch) | |
tree | f0040d135595d10297d108ce76eb3a1a445ab65a /drivers/gpu | |
parent | e78891ca7648a14dda5760be7b03eba7c628a804 (diff) |
drm/i915: Fix CAGF for HSW
The shift changed, hurray.
Reported-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Paulo Zanoni <przanoni@gmail.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Tested-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/i915_debugfs.c | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_reg.h | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 384f19368a1d..749114881c23 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c | |||
@@ -957,7 +957,7 @@ static int i915_cur_delayinfo(struct seq_file *m, void *unused) | |||
957 | u32 gt_perf_status = I915_READ(GEN6_GT_PERF_STATUS); | 957 | u32 gt_perf_status = I915_READ(GEN6_GT_PERF_STATUS); |
958 | u32 rp_state_limits = I915_READ(GEN6_RP_STATE_LIMITS); | 958 | u32 rp_state_limits = I915_READ(GEN6_RP_STATE_LIMITS); |
959 | u32 rp_state_cap = I915_READ(GEN6_RP_STATE_CAP); | 959 | u32 rp_state_cap = I915_READ(GEN6_RP_STATE_CAP); |
960 | u32 rpstat; | 960 | u32 rpstat, cagf; |
961 | u32 rpupei, rpcurup, rpprevup; | 961 | u32 rpupei, rpcurup, rpprevup; |
962 | u32 rpdownei, rpcurdown, rpprevdown; | 962 | u32 rpdownei, rpcurdown, rpprevdown; |
963 | int max_freq; | 963 | int max_freq; |
@@ -976,6 +976,11 @@ static int i915_cur_delayinfo(struct seq_file *m, void *unused) | |||
976 | rpdownei = I915_READ(GEN6_RP_CUR_DOWN_EI); | 976 | rpdownei = I915_READ(GEN6_RP_CUR_DOWN_EI); |
977 | rpcurdown = I915_READ(GEN6_RP_CUR_DOWN); | 977 | rpcurdown = I915_READ(GEN6_RP_CUR_DOWN); |
978 | rpprevdown = I915_READ(GEN6_RP_PREV_DOWN); | 978 | rpprevdown = I915_READ(GEN6_RP_PREV_DOWN); |
979 | if (IS_HASWELL(dev)) | ||
980 | cagf = (rpstat & HSW_CAGF_MASK) >> HSW_CAGF_SHIFT; | ||
981 | else | ||
982 | cagf = (rpstat & GEN6_CAGF_MASK) >> GEN6_CAGF_SHIFT; | ||
983 | cagf *= GT_FREQUENCY_MULTIPLIER; | ||
979 | 984 | ||
980 | gen6_gt_force_wake_put(dev_priv); | 985 | gen6_gt_force_wake_put(dev_priv); |
981 | mutex_unlock(&dev->struct_mutex); | 986 | mutex_unlock(&dev->struct_mutex); |
@@ -988,8 +993,7 @@ static int i915_cur_delayinfo(struct seq_file *m, void *unused) | |||
988 | gt_perf_status & 0xff); | 993 | gt_perf_status & 0xff); |
989 | seq_printf(m, "Render p-state limit: %d\n", | 994 | seq_printf(m, "Render p-state limit: %d\n", |
990 | rp_state_limits & 0xff); | 995 | rp_state_limits & 0xff); |
991 | seq_printf(m, "CAGF: %dMHz\n", ((rpstat & GEN6_CAGF_MASK) >> | 996 | seq_printf(m, "CAGF: %dMHz\n", cagf); |
992 | GEN6_CAGF_SHIFT) * GT_FREQUENCY_MULTIPLIER); | ||
993 | seq_printf(m, "RP CUR UP EI: %dus\n", rpupei & | 997 | seq_printf(m, "RP CUR UP EI: %dus\n", rpupei & |
994 | GEN6_CURICONT_MASK); | 998 | GEN6_CURICONT_MASK); |
995 | seq_printf(m, "RP CUR UP: %dus\n", rpcurup & | 999 | seq_printf(m, "RP CUR UP: %dus\n", rpcurup & |
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 0c89cf5377ea..9a3cd047ad9b 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
@@ -4196,7 +4196,9 @@ | |||
4196 | #define GEN6_RP_INTERRUPT_LIMITS 0xA014 | 4196 | #define GEN6_RP_INTERRUPT_LIMITS 0xA014 |
4197 | #define GEN6_RPSTAT1 0xA01C | 4197 | #define GEN6_RPSTAT1 0xA01C |
4198 | #define GEN6_CAGF_SHIFT 8 | 4198 | #define GEN6_CAGF_SHIFT 8 |
4199 | #define HSW_CAGF_SHIFT 7 | ||
4199 | #define GEN6_CAGF_MASK (0x7f << GEN6_CAGF_SHIFT) | 4200 | #define GEN6_CAGF_MASK (0x7f << GEN6_CAGF_SHIFT) |
4201 | #define HSW_CAGF_MASK (0x7f << HSW_CAGF_SHIFT) | ||
4200 | #define GEN6_RP_CONTROL 0xA024 | 4202 | #define GEN6_RP_CONTROL 0xA024 |
4201 | #define GEN6_RP_MEDIA_TURBO (1<<11) | 4203 | #define GEN6_RP_MEDIA_TURBO (1<<11) |
4202 | #define GEN6_RP_MEDIA_MODE_MASK (3<<9) | 4204 | #define GEN6_RP_MEDIA_MODE_MASK (3<<9) |