diff options
author | Ben Widawsky <ben@bwidawsk.net> | 2011-04-25 14:23:07 -0400 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-05-10 16:56:46 -0400 |
commit | fcca7926299944841569515da321bef9655b7703 (patch) | |
tree | 3d3961db5e3d1821bd68c3c09365f9e557e61d55 /drivers/gpu/drm/i915/i915_debugfs.c | |
parent | b7287d8054d219b3009f7ca82edf24f89fd363e5 (diff) |
drm/i915: reference counted forcewake
Provide a reference count to track the forcewake state of the GPU and
give a safe mechanism for userspace to wake the GT. This also potentially
saves a UC read if the GT is known to be awake already.
The reference count is atomic, but the register access and hardware wake
sequence is protected by struct_mutex.
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_debugfs.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_debugfs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 52d2306249cb..3b1147d9023a 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c | |||
@@ -874,7 +874,7 @@ static int i915_cur_delayinfo(struct seq_file *m, void *unused) | |||
874 | int max_freq; | 874 | int max_freq; |
875 | 875 | ||
876 | /* RPSTAT1 is in the GT power well */ | 876 | /* RPSTAT1 is in the GT power well */ |
877 | __gen6_gt_force_wake_get(dev_priv); | 877 | gen6_gt_force_wake_get(dev_priv); |
878 | 878 | ||
879 | rpstat = I915_READ(GEN6_RPSTAT1); | 879 | rpstat = I915_READ(GEN6_RPSTAT1); |
880 | rpupei = I915_READ(GEN6_RP_CUR_UP_EI); | 880 | rpupei = I915_READ(GEN6_RP_CUR_UP_EI); |
@@ -919,7 +919,7 @@ static int i915_cur_delayinfo(struct seq_file *m, void *unused) | |||
919 | seq_printf(m, "Max non-overclocked (RP0) frequency: %dMHz\n", | 919 | seq_printf(m, "Max non-overclocked (RP0) frequency: %dMHz\n", |
920 | max_freq * 50); | 920 | max_freq * 50); |
921 | 921 | ||
922 | __gen6_gt_force_wake_put(dev_priv); | 922 | gen6_gt_force_wake_put(dev_priv); |
923 | } else { | 923 | } else { |
924 | seq_printf(m, "no P-state info available\n"); | 924 | seq_printf(m, "no P-state info available\n"); |
925 | } | 925 | } |