Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 276735
b: refs/heads/master
c: 4ed0b57
h: refs/heads/master
i:
  276733: 679b061
  276731: b383925
  276727: ffcf82d
  276719: 9f1ccd7
  276703: 6eb2827
  276671: 3d04eb3
  276607: 53df5b3
  276479: fb4d3be
v: v3
  • Loading branch information
Eugeni Dodonov authored and Keith Packard committed Dec 16, 2011
1 parent 7ecc013 commit a2b7d2a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 03d00ac53f9bcde06ff7e33d6676083c18d569a4
refs/heads/master: 4ed0b577457eb6aeb7cdc7e7316576e63d15abb2
10 changes: 10 additions & 0 deletions trunk/drivers/gpu/drm/i915/i915_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1454,6 +1454,14 @@ unsigned long i915_chipset_val(struct drm_i915_private *dev_priv)

diff1 = now - dev_priv->last_time1;

/* Prevent division-by-zero if we are asking too fast.
* Also, we don't get interesting results if we are polling
* faster than once in 10ms, so just return the saved value
* in such cases.
*/
if (diff1 <= 10)
return dev_priv->chipset_power;

count1 = I915_READ(DMIEC);
count2 = I915_READ(DDREC);
count3 = I915_READ(CSIEC);
Expand Down Expand Up @@ -1484,6 +1492,8 @@ unsigned long i915_chipset_val(struct drm_i915_private *dev_priv)
dev_priv->last_count1 = total_count;
dev_priv->last_time1 = now;

dev_priv->chipset_power = ret;

return ret;
}

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/gpu/drm/i915/i915_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,7 @@ typedef struct drm_i915_private {

u64 last_count1;
unsigned long last_time1;
unsigned long chipset_power;
u64 last_count2;
struct timespec last_time2;
unsigned long gfx_power;
Expand Down

0 comments on commit a2b7d2a

Please sign in to comment.