|
@@ -64,24 +64,16 @@ static u32 calc_residency(struct drm_device *dev, const u32 reg)
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
|
|
|
|
- units = 0;
|
|
|
|
- div = 1000000ULL;
|
|
|
|
-
|
|
|
|
- if (IS_CHERRYVIEW(dev)) {
|
|
|
|
|
|
+ if (IS_CHERRYVIEW(dev) && czcount_30ns == 1) {
|
|
/* Special case for 320Mhz */
|
|
/* Special case for 320Mhz */
|
|
- if (czcount_30ns == 1) {
|
|
|
|
- div = 10000000ULL;
|
|
|
|
- units = 3125ULL;
|
|
|
|
- } else {
|
|
|
|
- /* chv counts are one less */
|
|
|
|
- czcount_30ns += 1;
|
|
|
|
- }
|
|
|
|
|
|
+ div = 10000000ULL;
|
|
|
|
+ units = 3125ULL;
|
|
|
|
+ } else {
|
|
|
|
+ czcount_30ns += 1;
|
|
|
|
+ div = 1000000ULL;
|
|
|
|
+ units = DIV_ROUND_UP_ULL(30ULL * bias, czcount_30ns);
|
|
}
|
|
}
|
|
|
|
|
|
- if (units == 0)
|
|
|
|
- units = DIV_ROUND_UP_ULL(30ULL * bias,
|
|
|
|
- (u64)czcount_30ns);
|
|
|
|
-
|
|
|
|
if (I915_READ(VLV_COUNTER_CONTROL) & VLV_COUNT_RANGE_HIGH)
|
|
if (I915_READ(VLV_COUNTER_CONTROL) & VLV_COUNT_RANGE_HIGH)
|
|
units <<= 8;
|
|
units <<= 8;
|
|
|
|
|