Skip to contentSkip to conversation

drm/i915: reboot notifier delay for eDP panels

PATCH In review [email protected] 3 participants 5 messages Jan 11, 2016 – Jan 13, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: reboot notifier delay for eDP panels

From: Clint Taylor <[email protected]>

Add reboot notifier for all platforms. This guarantees T12 delay compliance during reboot cycles when pre-os enables the panel within 500ms.

---
 drivers/gpu/drm/i915/intel_dp.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +8 -3
index 796e3d3..dbbd27a 100644
@@ -126,6 +126,7 @@ static struct intel_dp *intel_attached_dp(struct drm_connector *connector)
 static void intel_dp_link_down(struct intel_dp *intel_dp);
 static bool edp_panel_vdd_on(struct intel_dp *intel_dp);
 static void edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync);
+static void edp_panel_off(struct intel_dp *intel_dp);
 static void vlv_init_panel_power_sequencer(struct intel_dp *intel_dp);
 static void vlv_steal_power_sequencer(struct drm_device *dev,
 				      enum pipe pipe);
@@ -596,6 +597,10 @@ static int edp_notify_handler(struct notifier_block *this, unsigned long code,
 		I915_WRITE(pp_ctrl_reg, PANEL_UNLOCK_REGS | PANEL_POWER_OFF);
 		msleep(intel_dp->panel_power_cycle_delay);
 	}
+	else
+	{
+		edp_panel_off(intel_dp);
+	}
 
 	pps_unlock(intel_dp);
 
@@ -5796,10 +5801,10 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp,
 	}
 	mutex_unlock(&dev->mode_config.mutex);
 
-	if (IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) {
-		intel_dp->edp_notifier.notifier_call = edp_notify_handler;
-		register_reboot_notifier(&intel_dp->edp_notifier);
+	intel_dp->edp_notifier.notifier_call = edp_notify_handler;
+	register_reboot_notifier(&intel_dp->edp_notifier);
 
+	if (IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) {
 		/*
 		 * Figure out the current pipe for the initial backlight setup.
 		 * If the current pipe isn't valid, try the PPS pipe, and if that
Signature · 6 lines
1.7.9.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

✗ warning: Fi.CI.BAT

== Summary ==

== Summary ==

Built on a90796840c30dac6d9907439bf98d1d08046c49d drm-intel-nightly: 2016y-01m-11d-17h-22m-54s UTC integration manifest

Test gem_storedw_loop:

        Subgroup basic-render:
                pass       -> DMESG-WARN (skl-i7k-2) UNSTABLE
Test kms_pipe_crc_basic:
        Subgroup read-crc-pipe-c:
                pass       -> DMESG-WARN (bdw-ultra)
bdw-nuci7        total:138  pass:129  dwarn:0   dfail:0   fail:0   skip:9  
bdw-ultra        total:138  pass:131  dwarn:1   dfail:0   fail:0   skip:6  
bsw-nuc-2        total:141  pass:115  dwarn:2   dfail:0   fail:0   skip:24 
byt-nuc          total:141  pass:123  dwarn:3   dfail:0   fail:0   skip:15 
hsw-brixbox      total:141  pass:134  dwarn:0   dfail:0   fail:0   skip:7  
hsw-gt2          total:141  pass:137  dwarn:0   dfail:0   fail:0   skip:4  
ilk-hp8440p      total:141  pass:101  dwarn:3   dfail:0   fail:0   skip:37 
ivb-t430s        total:135  pass:122  dwarn:3   dfail:4   fail:0   skip:6  
skl-i5k-2        total:141  pass:132  dwarn:1   dfail:0   fail:0   skip:8  
skl-i7k-2        total:141  pass:131  dwarn:2   dfail:0   fail:0   skip:8  
snb-dellxps      total:141  pass:122  dwarn:5   dfail:0   fail:0   skip:14 
snb-x220t        total:141  pass:122  dwarn:5   dfail:0   fail:1   skip:13 

Results at /archive/results/CI_IGT_test/Patchwork_1140/

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw
In reply to [email protected]
Quoted 24 lines · On Mon, Jan 11, 2016 at 01:52:17PM -0800, [email protected] wrote:

From: Clint Taylor <[email protected]>

Add reboot notifier for all platforms. This guarantees T12 delay compliance during reboot cycles when pre-os enables the panel within 500ms.

---
 drivers/gpu/drm/i915/intel_dp.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +1 -0
index 796e3d3..dbbd27a 100644
@@ -126,6 +126,7 @@ static struct intel_dp *intel_attached_dp(struct drm_connector *connector)
 static void intel_dp_link_down(struct intel_dp *intel_dp);
 static bool edp_panel_vdd_on(struct intel_dp *intel_dp);
 static void edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync);
+static void edp_panel_off(struct intel_dp *intel_dp);
 static void vlv_init_panel_power_sequencer(struct intel_dp *intel_dp);
 static void vlv_steal_power_sequencer(struct drm_device *dev,
 				      enum pipe pipe);

drivers/gpu/drm/i915/intel_dp.c static int edp_notify_handler(struct notifier_block *this, unsigned long code, · line 603

Quoted 7 lines
drivers/gpu/drm/i915/intel_dp.c +4 -0
@@ -596,6 +597,10 @@ static int edp_notify_handler(struct notifier_block *this, unsigned long code,
 		I915_WRITE(pp_ctrl_reg, PANEL_UNLOCK_REGS | PANEL_POWER_OFF);
 		msleep(intel_dp->panel_power_cycle_delay);
 	}
+	else
+	{
+		edp_panel_off(intel_dp);
+	}

I don't think that actually waits for the power cycle delay. Also you can't call it without having vdd already enabled unless you specifically want to see a WARN.

I suppose you could just do something along these lines:

if (have_panel_power || have_panel_vdd) {
edp_panel_vdd_on
edp_panel_off
}
wait_panel_power_cycle

Also should change VLV/CHV to do it the same way.

Quoted 24 lines
drivers/gpu/drm/i915/intel_dp.c +3 -3
 	pps_unlock(intel_dp);
 
@@ -5796,10 +5801,10 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp,
 	}
 	mutex_unlock(&dev->mode_config.mutex);
 
-	if (IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) {
-		intel_dp->edp_notifier.notifier_call = edp_notify_handler;
-		register_reboot_notifier(&intel_dp->edp_notifier);
+	intel_dp->edp_notifier.notifier_call = edp_notify_handler;
+	register_reboot_notifier(&intel_dp->edp_notifier);
 
+	if (IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) {
 		/*
 		 * Figure out the current pipe for the initial backlight setup.
 		 * If the current pipe isn't valid, try the PPS pipe, and if that
Signature · 6 lines
1.7.9.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw
Quoted 28 lines · Ville Syrjälä
Quoted 27 lines · On Mon, Jan 11, 2016 at 01:52:17PM -0800, [email protected] wrote:

From: Clint Taylor <[email protected]>

Add reboot notifier for all platforms. This guarantees T12 delay compliance during reboot cycles when pre-os enables the panel within 500ms.

---
  drivers/gpu/drm/i915/intel_dp.c |   11 ++++++++---
  1 file changed, 8 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +1 -0
index 796e3d3..dbbd27a 100644
@@ -126,6 +126,7 @@ static struct intel_dp *intel_attached_dp(struct drm_connector *connector)
  static void intel_dp_link_down(struct intel_dp *intel_dp);
  static bool edp_panel_vdd_on(struct intel_dp *intel_dp);
  static void edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync);
+static void edp_panel_off(struct intel_dp *intel_dp);
  static void vlv_init_panel_power_sequencer(struct intel_dp *intel_dp);
  static void vlv_steal_power_sequencer(struct drm_device *dev,
  				      enum pipe pipe);
@@ -596,6 +597,10 @@ static int edp_notify_handler(struct notifier_block *this, unsigned long code,
  		I915_WRITE(pp_ctrl_reg, PANEL_UNLOCK_REGS | PANEL_POWER_OFF);
  		msleep(intel_dp->panel_power_cycle_delay);
  	}
Quoted 9 lines

drivers/gpu/drm/i915/intel_dp.c static int edp_notify_handler(struct notifier_block *this, unsigned long code, · line 603

Quoted 4 lines
drivers/gpu/drm/i915/intel_dp.c +4 -0
+	else
+	{
+		edp_panel_off(intel_dp);
+	}

I don't think that actually waits for the power cycle delay. Also you can't call it without having vdd already enabled unless you specifically want to see a WARN.

edp_panel_off() does wait for panel off time. This has also been confirmed with a scope watching vdd.

Quoted 3 lines

I suppose you could just do something along these lines:

if (have_panel_power || have_panel_vdd) {

Good catch. I will add the check to make sure panel power is on before calling edp_panel_off(). If the panel power was off I will still need to check to make sure it has been off for the required time.

Quoted 6 lines

edp_panel_vdd_on
edp_panel_off
}
wait_panel_power_cycle

Also should change VLV/CHV to do it the same way.

VLV/CHV PPS handles things a little different and the existing code was required to prevent VDD from asserting during the reboot cycle. We increased the delay to MAX the VLV handler to prevent the VDD from asserting once the PPS cycle completed. I will test on my CHV to confirm the old handler is still required.

Quoted 21 lines
Quoted 21 lines
drivers/gpu/drm/i915/intel_dp.c +3 -4
  	pps_unlock(intel_dp);
 
@@ -5796,10 +5801,10 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp,
  	}
  	mutex_unlock(&dev->mode_config.mutex);
 
-	if (IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) {
-		intel_dp->edp_notifier.notifier_call = edp_notify_handler;
-		register_reboot_notifier(&intel_dp->edp_notifier);
+	intel_dp->edp_notifier.notifier_call = edp_notify_handler;
+	register_reboot_notifier(&intel_dp->edp_notifier);
 
+	if (IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) {
  		/*
  		 * Figure out the current pipe for the initial backlight setup.
  		 * If the current pipe isn't valid, try the PPS pipe, and if that
--

1.7.9.5

Quoted 5 lines
Quoted 4 lines

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw
Quoted 38 lines · Clint Taylor
Quoted 28 lines · Ville Syrjälä
Quoted 27 lines · On Mon, Jan 11, 2016 at 01:52:17PM -0800, [email protected] wrote:

From: Clint Taylor <[email protected]>

Add reboot notifier for all platforms. This guarantees T12 delay compliance during reboot cycles when pre-os enables the panel within 500ms.

---
  drivers/gpu/drm/i915/intel_dp.c |   11 ++++++++---
  1 file changed, 8 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +1 -0
index 796e3d3..dbbd27a 100644
@@ -126,6 +126,7 @@ static struct intel_dp *intel_attached_dp(struct drm_connector *connector)
  static void intel_dp_link_down(struct intel_dp *intel_dp);
  static bool edp_panel_vdd_on(struct intel_dp *intel_dp);
  static void edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync);
+static void edp_panel_off(struct intel_dp *intel_dp);
  static void vlv_init_panel_power_sequencer(struct intel_dp *intel_dp);
  static void vlv_steal_power_sequencer(struct drm_device *dev,
  				      enum pipe pipe);
@@ -596,6 +597,10 @@ static int edp_notify_handler(struct notifier_block *this, unsigned long code,
  		I915_WRITE(pp_ctrl_reg, PANEL_UNLOCK_REGS | PANEL_POWER_OFF);
  		msleep(intel_dp->panel_power_cycle_delay);
  	}
Quoted 9 lines

drivers/gpu/drm/i915/intel_dp.c static int edp_notify_handler(struct notifier_block *this, unsigned long code, · line 603

Quoted 4 lines
drivers/gpu/drm/i915/intel_dp.c +4 -0
+	else
+	{
+		edp_panel_off(intel_dp);
+	}

I don't think that actually waits for the power cycle delay. Also you can't call it without having vdd already enabled unless you specifically want to see a WARN.

Quoted 2 lines

edp_panel_off() does wait for panel off time. This has also been confirmed with a scope watching vdd.

Panel off delay yes, but not power cycle delay. Unless you wait for that as well, then the firmware/whoever could re-enable vdd too soon AFAICS.

Quoted 7 lines
Quoted 4 lines

I suppose you could just do something along these lines:

if (have_panel_power || have_panel_vdd) {

Good catch. I will add the check to make sure panel power is on before calling edp_panel_off(). If the panel power was off I will still need to check to make sure it has been off for the required time.

Which is why my sample code had the wait_panel_power_cycle() call uncnditionally.

Quoted 6 lines
Quoted 6 lines

edp_panel_vdd_on
edp_panel_off
}
wait_panel_power_cycle

Quoted 6 lines
Quoted 1 line

Also should change VLV/CHV to do it the same way.

VLV/CHV PPS handles things a little different and the existing code was required to prevent VDD from asserting during the reboot cycle. We increased the delay to MAX the VLV handler to prevent the VDD from asserting once the PPS cycle completed.

That doesn't sound sane at all. Are you saying the hardware re-enabled vdd on its own somehow unless you frobbed with the delay?

Quoted 29 lines

I will test on my CHV to confirm
the old handler is still required.

Quoted 26 lines
Quoted 25 lines
drivers/gpu/drm/i915/intel_dp.c +3 -4
  	pps_unlock(intel_dp);
 
@@ -5796,10 +5801,10 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp,
  	}
  	mutex_unlock(&dev->mode_config.mutex);
 
-	if (IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) {
-		intel_dp->edp_notifier.notifier_call = edp_notify_handler;
-		register_reboot_notifier(&intel_dp->edp_notifier);
+	intel_dp->edp_notifier.notifier_call = edp_notify_handler;
+	register_reboot_notifier(&intel_dp->edp_notifier);
 
+	if (IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) {
  		/*
  		 * Figure out the current pipe for the initial backlight setup.
  		 * If the current pipe isn't valid, try the PPS pipe, and if that
--

1.7.9.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx