summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Perelet <operelet@codeaurora.org>2016-06-28 15:22:30 -0700
committerKyle Yan <kyan@codeaurora.org>2016-06-30 16:49:30 -0700
commit54e3106b814db1f3cee469bf16519b1d34b4865c (patch)
tree59db60325be60d5d8a9af1339c17f24e8897f334
parent84721301365f482022ad090cad604890c40903db (diff)
msm: kgsl: Discard negative CRC throttling cycle readings
Ignore negative CRC throttle cycle readings in corner cases. Change-Id: Ic237bd0558a4769dc89bfb7e70a287165f842b92 CRs-Fixed: 973565 Signed-off-by: Oleg Perelet <operelet@codeaurora.org>
-rw-r--r--drivers/gpu/msm/adreno.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/msm/adreno.c b/drivers/gpu/msm/adreno.c
index b9a379bdc5a5..26e341a876e8 100644
--- a/drivers/gpu/msm/adreno.c
+++ b/drivers/gpu/msm/adreno.c
@@ -1264,6 +1264,9 @@ static uint64_t _read_throttling_counters(struct adreno_device *adreno_dev)
if (!ADRENO_FEATURE(adreno_dev, ADRENO_GPMU))
return 0;
+ if (!test_bit(ADRENO_THROTTLING_CTRL, &adreno_dev->pwrctrl_flag))
+ return 0;
+
for (i = 0; i < ADRENO_GPMU_THROTTLE_COUNTERS; i++) {
if (!adreno_dev->gpmu_throttle_counters[i])
return 0;
@@ -1272,9 +1275,8 @@ static uint64_t _read_throttling_counters(struct adreno_device *adreno_dev)
adreno_dev->gpmu_throttle_counters[i],
&busy->throttle_cycles[i]);
}
- return th[CRC_50PCT] + th[CRC_LESS50PCT] / 3 +
- (th[CRC_MORE50PCT] - th[IDLE_10PCT]) * 3;
-
+ i = th[CRC_MORE50PCT] - th[IDLE_10PCT];
+ return th[CRC_50PCT] + th[CRC_LESS50PCT] / 3 + (i < 0 ? 0 : i) * 3;
}
static void _update_threshold_count(struct adreno_device *adreno_dev,