diff mbox

[v2,2/2] drm/i915: fix initial timestamps for PP sequencing logic

Message ID 1390994741-9137-2-git-send-email-imre.deak@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Imre Deak Jan. 29, 2014, 11:25 a.m. UTC
The initial jiffies value can be non-0, so set the inital panel power
sequencer timestamps accordingly. This didn't cause a problem on 64 bit
machines but on 32 bit jiffies is initially -300*HZ, so if the panel
power is initally off in the call from edp_panel_vdd_on()->
wait_panel_power_cycle() we'd wait up to ~300 sec more than needed.

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

Comments

Chris Wilson Jan. 29, 2014, 1:26 p.m. UTC | #1
On Wed, Jan 29, 2014 at 01:25:41PM +0200, Imre Deak wrote:
> The initial jiffies value can be non-0, so set the inital panel power
> sequencer timestamps accordingly. This didn't cause a problem on 64 bit
> machines but on 32 bit jiffies is initially -300*HZ, so if the panel
> power is initally off in the call from edp_panel_vdd_on()->
> wait_panel_power_cycle() we'd wait up to ~300 sec more than needed.
> 
> Signed-off-by: Imre Deak <imre.deak@intel.com>

I would have set them all to the same value personally, but
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
Daniel Vetter Jan. 29, 2014, 7:47 p.m. UTC | #2
On Wed, Jan 29, 2014 at 01:26:27PM +0000, Chris Wilson wrote:
> On Wed, Jan 29, 2014 at 01:25:41PM +0200, Imre Deak wrote:
> > The initial jiffies value can be non-0, so set the inital panel power
> > sequencer timestamps accordingly. This didn't cause a problem on 64 bit
> > machines but on 32 bit jiffies is initially -300*HZ, so if the panel
> > power is initally off in the call from edp_panel_vdd_on()->
> > wait_panel_power_cycle() we'd wait up to ~300 sec more than needed.
> > 
> > Signed-off-by: Imre Deak <imre.deak@intel.com>
> 
> I would have set them all to the same value personally, but
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

Both patches merged, thanks.
-Daniel
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 553b6a5..6fd1d0c 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -3494,6 +3494,13 @@  intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connect
 	}
 }
 
+static void intel_dp_init_panel_power_timestamps(struct intel_dp *intel_dp)
+{
+	intel_dp->last_power_cycle = jiffies;
+	intel_dp->last_power_on = jiffies;
+	intel_dp->last_backlight_off = jiffies;
+}
+
 static void
 intel_dp_init_panel_power_sequencer(struct drm_device *dev,
 				    struct intel_dp *intel_dp,
@@ -3838,8 +3845,10 @@  intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
 		BUG();
 	}
 
-	if (is_edp(intel_dp))
+	if (is_edp(intel_dp)) {
+		intel_dp_init_panel_power_timestamps(intel_dp);
 		intel_dp_init_panel_power_sequencer(dev, intel_dp, &power_seq);
+	}
 
 	error = intel_dp_i2c_init(intel_dp, intel_connector, name);
 	WARN(error, "intel_dp_i2c_init failed with error %d for port %c\n",