summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/i915/intel_pm.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index cc3c2d9eb7f4..c198dbad3e82 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -755,12 +755,15 @@ static bool vlv_compute_drain_latency(struct drm_crtc *crtc,
return false;
entries = DIV_ROUND_UP(clock, 1000) * pixel_size;
- if (IS_CHERRYVIEW(dev))
- *prec_mult = (entries > 32) ? 16 : 8;
- else
- *prec_mult = (entries > 128) ? 64 : 32;
+
+ *prec_mult = IS_CHERRYVIEW(dev) ? 16 : 64;
*drain_latency = (64 * (*prec_mult) * 4) / entries;
+ if (*drain_latency > DRAIN_LATENCY_MASK) {
+ *prec_mult /= 2;
+ *drain_latency = (64 * (*prec_mult) * 4) / entries;
+ }
+
if (*drain_latency > DRAIN_LATENCY_MASK)
*drain_latency = DRAIN_LATENCY_MASK;