[PATCH 3/3] drm/i915/dp: Subtract from HW read out

Manasi Navare manasi.d.navare at intel.com
Wed Jun 21 03:42:28 UTC 2017


Signed-off-by: Manasi Navare <manasi.d.navare at intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index ed10dff..50420ac 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -5188,8 +5188,12 @@ intel_pps_readout_hw_state(struct drm_i915_private *dev_priv,
 		else
 			seq->t11_t12 = 0;
 	} else {
-		seq->t11_t12 = (((pp_div & PANEL_POWER_CYCLE_DELAY_MASK) >>
-				 PANEL_POWER_CYCLE_DELAY_SHIFT) - 1) * 1000;
+		u16 tmp = (pp_div & PANEL_POWER_CYCLE_DELAY_MASK) >>
+			PANEL_POWER_CYCLE_DELAY_SHIFT;
+		if (tmp > 0)
+			seq->t11_t12 = (tmp - 1) * 1000;
+		else
+			seq->t11_t12 = 0;
 	}
 }
 
-- 
2.1.4



More information about the Intel-gfx-trybot mailing list