drm/i915/bxt: Fix eDP panel power save/restore
Subsystems (2)
PATCH 1/1 drm/i915/bxt: Fix eDP panel power save/restore
Broxton-specific panel power sequencing was added in commit
commit b0a08bec96318be54db97c3f0b9e37b52561f9ea
Author: Vandana Kannan <[email protected]>
Date: Thu Jun 18 11:00:55 2015 +0530
drm/i915/bxt: eDP Panel Power sequencing
As noted in that commit, Broxton has two sets of registers (and we're supposed to read which to use from the VBT, although we're punting on that part at the moment) and also doesn't have a divisor register. Although we take the BXT-specific details into account at initial system init, we fail to save/restore the appropriate registers around system suspend/resume, which leads to unclaimed register warnings at the moment, and may also fail to save the proper registers once we start actually paying attention to the VBT.
--- drivers/gpu/drm/i915/i915_suspend.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_suspend.c +22 -2
@@ -44,7 +44,18 @@ static void i915_save_display(struct drm_device *dev) dev_priv->regfile.saveLVDS =I915_READ (LVDS );/* Panel power sequencer */ -if (HAS_PCH_SPLIT (dev)) { +if (IS_BROXTON (dev)) { +/* +* TODO: BXT has 2 sets of PPS registers. +* Correct Register for Broxton need to be identified +* using VBT. hardcoding for now. +* +* There's also no divisor register on Broxton. +*/ + dev_priv->regfile.savePP_CONTROL =I915_READ (BXT_PP_CONTROL (0 )); + dev_priv->regfile.savePP_ON_DELAYS =I915_READ (BXT_PP_ON_DELAYS (0 )); + dev_priv->regfile.savePP_OFF_DELAYS =I915_READ (BXT_PP_OFF_DELAYS (0 )); + }else if (HAS_PCH_SPLIT (dev)) { dev_priv->regfile.savePP_CONTROL =I915_READ (PCH_PP_CONTROL ); dev_priv->regfile.savePP_ON_DELAYS =I915_READ (PCH_PP_ON_DELAYS ); dev_priv->regfile.savePP_OFF_DELAYS =I915_READ (PCH_PP_OFF_DELAYS );
@@ -83,7 +94,16 @@ static void i915_restore_display(struct drm_device *dev)I915_WRITE (LVDS , dev_priv->regfile.saveLVDS & mask);/* Panel power sequencer */ -if (HAS_PCH_SPLIT (dev)) { +if (IS_BROXTON (dev)) { +/* +* TODO: BXT has 2 sets of PPS registers. +* Correct Register for Broxton need to be identified +* using VBT. hardcoding for now +*/ +I915_WRITE (BXT_PP_ON_DELAYS (0 ), dev_priv->regfile.savePP_ON_DELAYS); +I915_WRITE (BXT_PP_OFF_DELAYS (0 ), dev_priv->regfile.savePP_OFF_DELAYS); +I915_WRITE (BXT_PP_CONTROL (0 ), dev_priv->regfile.savePP_CONTROL); + }else if (HAS_PCH_SPLIT (dev)) {I915_WRITE (PCH_PP_ON_DELAYS , dev_priv->regfile.savePP_ON_DELAYS);I915_WRITE (PCH_PP_OFF_DELAYS , dev_priv->regfile.savePP_OFF_DELAYS);I915_WRITE (PCH_PP_DIVISOR , dev_priv->regfile.savePP_DIVISOR);
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
When I submitted the PPS patch in April, I got an input from Jani to not make changes in i915_suspend.c as it was to become obsolete. Below mail for your reference.
Jani,
Does your initial comment still hold good?
Quoted 25 lines · Vandana Kannan
Changes based on future platform readiness patches related to
HAS_PCH_SPLIT(). UseHAS_GMCH_DISPLAY()instead ofHAS_PCH_SPLITSigned-off-by Vandana Kannan <[email protected]>Signed-off-by A.Sunil Kamath <[email protected]>--- drivers/gpu/drm/i915/i915_suspend.c | 4 ++-- drivers/gpu/drm/i915/intel_dp.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-)drivers/gpu/drm/i915/i915_suspend.c +1
-1@@ -44,7 +44,7 @@ static void i915_save_display(struct drm_device *dev) dev_priv->regfile.saveLVDS =I915_READ (LVDS );/* Panel power sequencer */ -if (HAS_PCH_SPLIT (dev)) { +if (!HAS_GMCH_DISPLAY (dev)) { dev_priv->regfile.savePP_CONTROL =I915_READ (PCH_PP_CONTROL ); dev_priv->regfile.savePP_ON_DELAYS =I915_READ (PCH_PP_ON_DELAYS ); dev_priv->regfile.savePP_OFF_DELAYS =I915_READ (PCH_PP_OFF_DELAYS );
drivers/gpu/drm/i915/i915_suspend.c static void i915_restore_display(struct drm_device *dev) · line 85
Quoted 8 lines
drivers/gpu/drm/i915/i915_suspend.c +1
-1@@ -79,7 +79,7 @@ static void i915_restore_display(struct drm_device *dev)I915_WRITE (LVDS , dev_priv->regfile.saveLVDS & mask);/* Panel power sequencer */ -if (HAS_PCH_SPLIT (dev)) { +if (!HAS_GMCH_DISPLAY (dev)) {I915_WRITE (PCH_PP_ON_DELAYS , dev_priv->regfile.savePP_ON_DELAYS);I915_WRITE (PCH_PP_OFF_DELAYS , dev_priv->regfile.savePP_OFF_DELAYS);I915_WRITE (PCH_PP_DIVISOR , dev_priv->regfile.savePP_DIVISOR);
I don't think you should touch i915_suspend.c at all. We're trying to get rid of this blind register save/restore, and make everything work in the encoder/connector code. Do note that we already skip this for vlv/chv power sequencer registers.
Quoted 40 lines
(quoted diff) +0
-0
b/drivers/gpu/drm/i915/intel_dp.cindex 937ba31..68e10c1 100644drivers/gpu/drm/i915/intel_dp.c +4
-4@@ -559,7 +559,7 @@ static u32 _pp_ctrl_reg(struct intel_dp *intel_dp) {struct drm_device *dev =intel_dp_to_dev (intel_dp); -if (HAS_PCH_SPLIT (dev)) +if (!HAS_GMCH_DISPLAY (dev))return PCH_PP_CONTROL ;else return VLV_PIPE_PP_CONTROL (vlv_power_sequencer_pipe (intel_dp));@@ -569,7 +569,7 @@ static u32 _pp_stat_reg(struct intel_dp *intel_dp) {struct drm_device *dev =intel_dp_to_dev (intel_dp); -if (HAS_PCH_SPLIT (dev)) +if (!HAS_GMCH_DISPLAY (dev))return PCH_PP_STATUS ;else return VLV_PIPE_PP_STATUS (vlv_power_sequencer_pipe (intel_dp));@@ -4963,7 +4963,7 @@ intel_dp_init_panel_power_sequencer(struct drm_device *dev,if (final->t11_t12 !=0 )return ; -if (HAS_PCH_SPLIT (dev)) { +if (!HAS_GMCH_DISPLAY (dev)) { pp_ctrl_reg =PCH_PP_CONTROL ; pp_on_reg =PCH_PP_ON_DELAYS ; pp_off_reg =PCH_PP_OFF_DELAYS ;@@ -5063,7 +5063,7 @@ intel_dp_init_panel_power_sequencer_registers(struct drm_device *dev, lockdep_assert_held(&dev_priv->pps_mutex); -if (HAS_PCH_SPLIT (dev)) { +if (!HAS_GMCH_DISPLAY (dev)) { pp_on_reg =PCH_PP_ON_DELAYS ; pp_off_reg =PCH_PP_OFF_DELAYS ;
Quoted 1 line
pp_div_reg=PCH_PP_DIVISOR;
For the rest, I'd like you to do what I suggested in my reply to patch 3, i.e. add a new if (IS_BROXTON(dev)) at the top of each of these, with BXT_PP_WHATEVER(0) as the register. Later on, we can add code to choose the power sequencer, a bit similar to what vlv/chv do now (except there it's based on pipe).
BR,
Jani.
Quoted 7 lines
--
2.0.1_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Jani Nikula, Intel Open Source Technology Center
- Vandana
Quoted 57 lines · Matt Roper
Broxton-specific panel power sequencing was added in commit
commit
b0a08bec96318be54db97c3f0b9e37b52561f9ea
Author: Vandana Kannan <[email protected]>
Date: Thu Jun 18 11:00:55 2015 +0530drm/i915/bxt: eDP Panel Power sequencing
As noted in that commit, Broxton has two sets of registers (and we're supposed to read which to use from the VBT, although we're punting on that part at the moment) and also doesn't have a divisor register. Although we take the BXT-specific details into account at initial system init, we fail to save/restore the appropriate registers around system suspend/resume, which leads to unclaimed register warnings at the moment, and may also fail to save the proper registers once we start actually paying attention to the VBT.
Cc Vandana Kannan <[email protected]>Signed-off-by Matt Roper <[email protected]>--- drivers/gpu/drm/i915/i915_suspend.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/i915_suspend.c +15
-2@@ -44,7 +44,18 @@ static void i915_save_display(struct drm_device *dev) dev_priv->regfile.saveLVDS =I915_READ (LVDS );/* Panel power sequencer */ -if (HAS_PCH_SPLIT (dev)) { +if (IS_BROXTON (dev)) { +/* +* TODO: BXT has 2 sets of PPS registers. +* Correct Register for Broxton need to be identified +* using VBT. hardcoding for now. +* +* There's also no divisor register on Broxton. +*/ + dev_priv->regfile.savePP_CONTROL =I915_READ (BXT_PP_CONTROL (0 )); + dev_priv->regfile.savePP_ON_DELAYS =I915_READ (BXT_PP_ON_DELAYS (0 )); + dev_priv->regfile.savePP_OFF_DELAYS =I915_READ (BXT_PP_OFF_DELAYS (0 )); + }else if (HAS_PCH_SPLIT (dev)) { dev_priv->regfile.savePP_CONTROL =I915_READ (PCH_PP_CONTROL ); dev_priv->regfile.savePP_ON_DELAYS =I915_READ (PCH_PP_ON_DELAYS ); dev_priv->regfile.savePP_OFF_DELAYS =I915_READ (PCH_PP_OFF_DELAYS );@@ -83,7 +94,16 @@ static void i915_restore_display(struct drm_device *dev)I915_WRITE (LVDS , dev_priv->regfile.saveLVDS & mask);/* Panel power sequencer */ -if (HAS_PCH_SPLIT (dev)) { +if (IS_BROXTON (dev)) { +/* +* TODO: BXT has 2 sets of PPS registers.
drivers/gpu/drm/i915/i915_suspend.c static void i915_restore_display(struct drm_device *dev) · line 109
Quoted 10 lines
drivers/gpu/drm/i915/i915_suspend.c +7
-0+* Correct Register for Broxton need to be identified +* using VBT. hardcoding for now +*/ +I915_WRITE (BXT_PP_ON_DELAYS (0 ), dev_priv->regfile.savePP_ON_DELAYS); +I915_WRITE (BXT_PP_OFF_DELAYS (0 ), dev_priv->regfile.savePP_OFF_DELAYS); +I915_WRITE (BXT_PP_CONTROL (0 ), dev_priv->regfile.savePP_CONTROL); + }else if (HAS_PCH_SPLIT (dev)) {I915_WRITE (PCH_PP_ON_DELAYS , dev_priv->regfile.savePP_ON_DELAYS);I915_WRITE (PCH_PP_OFF_DELAYS , dev_priv->regfile.savePP_OFF_DELAYS);I915_WRITE (PCH_PP_DIVISOR , dev_priv->regfile.savePP_DIVISOR);
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 6 lines · Vandana
When I submitted the PPS patch in April, I got an input from Jani to not make changes in
i915_suspend.cas it was to become obsolete. Below mail for your reference.Jani,
Does your initial comment still hold good?
I don't think not touching i915_suspend.c at all is an option since that means that the current code will try to read/write registers that simply don't exist on the platform. Based on Jani's comment, maybe we should just be adding BXT to the list of platforms we don't do any PP save/restore on?
diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
index 61bec8e..69d5965 100644
--- a/drivers/gpu/drm/i915/i915_suspend.c
+++ b/drivers/gpu/drm/i915/i915_suspend.c
@@ -60,7 +60,7 @@ static void i915_save_display(struct drm_device *dev)
dev_priv->regfile.savePP_ON_DELAYS = I915_READ(PCH_PP_ON_DELAYS);
dev_priv->regfile.savePP_OFF_DELAYS = I915_READ(PCH_PP_OFF_DELAYS);
dev_priv->regfile.savePP_DIVISOR = I915_READ(PCH_PP_DIVISOR);
- } else if (!IS_VALLEYVIEW(dev)) {
+ } else if (!IS_VALLEYVIEW(dev) && !IS_BROXTON(dev)) {
dev_priv->regfile.savePP_CONTROL = I915_READ(PP_CONTROL);
dev_priv->regfile.savePP_ON_DELAYS = I915_READ(PP_ON_DELAYS);
dev_priv->regfile.savePP_OFF_DELAYS = I915_READ(PP_OFF_DELAYS);I'm not really familiar with the panel power sequencing stuff, so I'll let you and Jani make the call there. I'm just looking at S3 on Broxton (which has all kinds of problems right now), and figured I'd try to clear up a couple of the unclaimed register warnings to make it more clear where the real S3 problems lie.
Thanks.
Matt
Quoted 177 lines · Vandana Kannan
drivers/gpu/drm/i915/i915_suspend.c static void i915_restore_display(struct
Quoted 25 lines
Changes based on future platform readiness patches related to
HAS_PCH_SPLIT(). UseHAS_GMCH_DISPLAY()instead ofHAS_PCH_SPLITSigned-off-by Vandana Kannan <[email protected]>Signed-off-by A.Sunil Kamath <[email protected]>--- drivers/gpu/drm/i915/i915_suspend.c | 4 ++-- drivers/gpu/drm/i915/intel_dp.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-)drivers/gpu/drm/i915/i915_suspend.c +1
-1@@ -44,7 +44,7 @@ static void i915_save_display(struct drm_device *dev) dev_priv->regfile.saveLVDS =I915_READ (LVDS );/* Panel power sequencer */ -if (HAS_PCH_SPLIT (dev)) { +if (!HAS_GMCH_DISPLAY (dev)) { dev_priv->regfile.savePP_CONTROL =I915_READ (PCH_PP_CONTROL ); dev_priv->regfile.savePP_ON_DELAYS =I915_READ (PCH_PP_ON_DELAYS ); dev_priv->regfile.savePP_OFF_DELAYS =I915_READ (PCH_PP_OFF_DELAYS );@@ -79,7 +79,7 @@ static void i915_restore_display(struct
drm_device*dev)drivers/gpu/drm/i915/i915_suspend.c static void i915_restore_display(struct drm_device *dev) · line 109
Quoted 8 lines
drivers/gpu/drm/i915/i915_suspend.c +1
-1I915_WRITE (LVDS , dev_priv->regfile.saveLVDS & mask);/* Panel power sequencer */ -if (HAS_PCH_SPLIT (dev)) { +if (!HAS_GMCH_DISPLAY (dev)) {I915_WRITE (PCH_PP_ON_DELAYS , dev_priv->regfile.savePP_ON_DELAYS);I915_WRITE (PCH_PP_OFF_DELAYS , dev_priv->regfile.savePP_OFF_DELAYS);I915_WRITE (PCH_PP_DIVISOR , dev_priv->regfile.savePP_DIVISOR);I don't think you should touch
i915_suspend.cat all. We're trying to get rid of this blind register save/restore, and make everything work in the encoder/connector code. Do note that we already skip this for vlv/chv power sequencer registers.drivers/gpu/drm/i915/intel_dp.c intel_dp_init_panel_power_sequencer(struct
Quoted 23 lines
(quoted diff) +0
-0
b/drivers/gpu/drm/i915/intel_dp.cindex 937ba31..68e10c1 100644drivers/gpu/drm/i915/intel_dp.c +2
-2@@ -559,7 +559,7 @@ static u32 _pp_ctrl_reg(struct intel_dp *intel_dp) {struct drm_device *dev =intel_dp_to_dev (intel_dp); -if (HAS_PCH_SPLIT (dev)) +if (!HAS_GMCH_DISPLAY (dev))return PCH_PP_CONTROL ;else return VLV_PIPE_PP_CONTROL (vlv_power_sequencer_pipe (intel_dp));@@ -569,7 +569,7 @@ static u32 _pp_stat_reg(struct intel_dp *intel_dp) {struct drm_device *dev =intel_dp_to_dev (intel_dp); -if (HAS_PCH_SPLIT (dev)) +if (!HAS_GMCH_DISPLAY (dev))return PCH_PP_STATUS ;else return VLV_PIPE_PP_STATUS (vlv_power_sequencer_pipe (intel_dp));@@ -4963,7 +4963,7 @@ intel_dp_init_panel_power_sequencer(struct
drm_device*dev,Quoted 17 lines
drivers/gpu/drm/i915/intel_dp.c +2
-2if (final->t11_t12 !=0 )return ; -if (HAS_PCH_SPLIT (dev)) { +if (!HAS_GMCH_DISPLAY (dev)) { pp_ctrl_reg =PCH_PP_CONTROL ; pp_on_reg =PCH_PP_ON_DELAYS ; pp_off_reg =PCH_PP_OFF_DELAYS ;@@ -5063,7 +5063,7 @@ intel_dp_init_panel_power_sequencer_registers(struct drm_device *dev, lockdep_assert_held(&dev_priv->pps_mutex); -if (HAS_PCH_SPLIT (dev)) { +if (!HAS_GMCH_DISPLAY (dev)) { pp_on_reg =PCH_PP_ON_DELAYS ; pp_off_reg =PCH_PP_OFF_DELAYS ;Quoted 1 line
pp_div_reg=PCH_PP_DIVISOR;For the rest, I'd like you to do what I suggested in my reply to patch 3, i.e. add a new if (
IS_BROXTON(dev)) at the top of each of these, withBXT_PP_WHATEVER(0)as the register. Later on, we can add code to choose the power sequencer, a bit similar to what vlv/chv do now (except there it's based on pipe).BR,
Jani.Quoted 7 lines
--
2.0.1_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx--
Jani Nikula, Intel Open Source Technology Center- Vandana
Quoted 67 lines · Matt Roper
Broxton-specific panel power sequencing was added in commit
commit
b0a08bec96318be54db97c3f0b9e37b52561f9ea
Author: Vandana Kannan <[email protected]>
Date: Thu Jun 18 11:00:55 2015 +0530drm/i915/bxt: eDP Panel Power sequencing
As noted in that commit, Broxton has two sets of registers (and we're supposed to read which to use from the VBT, although we're punting on that part at the moment) and also doesn't have a divisor register. Although we take the BXT-specific details into account at initial system init, we fail to save/restore the appropriate registers around system suspend/resume, which leads to unclaimed register warnings at the moment, and may also fail to save the proper registers once we start actually paying attention to the VBT.
Cc Vandana Kannan <[email protected]>Signed-off-by Matt Roper <[email protected]>--- drivers/gpu/drm/i915/i915_suspend.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/i915_suspend.c +22
-2@@ -44,7 +44,18 @@ static void i915_save_display(struct drm_device *dev) dev_priv->regfile.saveLVDS =I915_READ (LVDS );/* Panel power sequencer */ -if (HAS_PCH_SPLIT (dev)) { +if (IS_BROXTON (dev)) { +/* +* TODO: BXT has 2 sets of PPS registers. +* Correct Register for Broxton need to be identified +* using VBT. hardcoding for now. +* +* There's also no divisor register on Broxton. +*/ + dev_priv->regfile.savePP_CONTROL =I915_READ (BXT_PP_CONTROL (0 )); + dev_priv->regfile.savePP_ON_DELAYS =I915_READ (BXT_PP_ON_DELAYS (0 )); + dev_priv->regfile.savePP_OFF_DELAYS =I915_READ (BXT_PP_OFF_DELAYS (0 )); + }else if (HAS_PCH_SPLIT (dev)) { dev_priv->regfile.savePP_CONTROL =I915_READ (PCH_PP_CONTROL ); dev_priv->regfile.savePP_ON_DELAYS =I915_READ (PCH_PP_ON_DELAYS ); dev_priv->regfile.savePP_OFF_DELAYS =I915_READ (PCH_PP_OFF_DELAYS );@@ -83,7 +94,16 @@ static void i915_restore_display(struct drm_device *dev)I915_WRITE (LVDS , dev_priv->regfile.saveLVDS & mask);/* Panel power sequencer */ -if (HAS_PCH_SPLIT (dev)) { +if (IS_BROXTON (dev)) { +/* +* TODO: BXT has 2 sets of PPS registers. +* Correct Register for Broxton need to be identified +* using VBT. hardcoding for now +*/ +I915_WRITE (BXT_PP_ON_DELAYS (0 ), dev_priv->regfile.savePP_ON_DELAYS); +I915_WRITE (BXT_PP_OFF_DELAYS (0 ), dev_priv->regfile.savePP_OFF_DELAYS); +I915_WRITE (BXT_PP_CONTROL (0 ), dev_priv->regfile.savePP_CONTROL); + }else if (HAS_PCH_SPLIT (dev)) {I915_WRITE (PCH_PP_ON_DELAYS , dev_priv->regfile.savePP_ON_DELAYS);I915_WRITE (PCH_PP_OFF_DELAYS , dev_priv->regfile.savePP_OFF_DELAYS);I915_WRITE (PCH_PP_DIVISOR , dev_priv->regfile.savePP_DIVISOR);
Signature · 9 lines
Matt Roper Graphics Software Engineer IoTG Platform Enabling & Development Intel Corporation (916) 356-2795 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Jani Nikula
maintainerQuoted 5 lines · Matt Roper
Quoted 4 lines · Vandana
When I submitted the PPS patch in April, I got an input from Jani to not make changes in
i915_suspend.cas it was to become obsolete. Below mail for your reference.
Quoted 8 lines
Quoted 2 lines
Jani,
Does your initial comment still hold good?I don't think not touching
i915_suspend.cat all is an option since that means that the current code will try to read/write registers that simply don't exist on the platform. Based on Jani's comment, maybe we should just be adding BXT to the list of platforms we don't do any PP save/restore on?
Not touching the registers in i915_suspend.c for BXT was what I meant, but probably failed at expressing it. The encoder/connector hooks should cover this, and if not, should be updated to cover this. The big hammer suspend/resume in i915_suspend.c is oblivious to most modeset state and is unable to do anything clever.
BR,
Jani.
Quoted 203 lines
diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c index 61bec8e..69d5965 100644 --- a/drivers/gpu/drm/i915/i915_suspend.c +++ b/drivers/gpu/drm/i915/i915_suspend.c @@ -60,7 +60,7 @@ static void i915_save_display(struct drm_device *dev) dev_priv->regfile.savePP_ON_DELAYS = I915_READ(PCH_PP_ON_DELAYS); dev_priv->regfile.savePP_OFF_DELAYS = I915_READ(PCH_PP_OFF_DELAYS); dev_priv->regfile.savePP_DIVISOR = I915_READ(PCH_PP_DIVISOR); - } else if (!IS_VALLEYVIEW(dev)) { + } else if (!IS_VALLEYVIEW(dev) && !IS_BROXTON(dev)) { dev_priv->regfile.savePP_CONTROL = I915_READ(PP_CONTROL); dev_priv->regfile.savePP_ON_DELAYS = I915_READ(PP_ON_DELAYS); dev_priv->regfile.savePP_OFF_DELAYS = I915_READ(PP_OFF_DELAYS);I'm not really familiar with the panel power sequencing stuff, so I'll let you and Jani make the call there. I'm just looking at S3 on Broxton (which has all kinds of problems right now), and figured I'd try to clear up a couple of the unclaimed register warnings to make it more clear where the real S3 problems lie.
Thanks.
Matt
Quoted 177 lines · Vandana Kannan
drivers/gpu/drm/i915/i915_suspend.c static void i915_restore_display(struct
Quoted 25 lines
Changes based on future platform readiness patches related to
HAS_PCH_SPLIT(). UseHAS_GMCH_DISPLAY()instead ofHAS_PCH_SPLITSigned-off-by Vandana Kannan <[email protected]>Signed-off-by A.Sunil Kamath <[email protected]>--- drivers/gpu/drm/i915/i915_suspend.c | 4 ++-- drivers/gpu/drm/i915/intel_dp.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-)drivers/gpu/drm/i915/i915_suspend.c +1
-1@@ -44,7 +44,7 @@ static void i915_save_display(struct drm_device *dev) dev_priv->regfile.saveLVDS =I915_READ (LVDS );/* Panel power sequencer */ -if (HAS_PCH_SPLIT (dev)) { +if (!HAS_GMCH_DISPLAY (dev)) { dev_priv->regfile.savePP_CONTROL =I915_READ (PCH_PP_CONTROL ); dev_priv->regfile.savePP_ON_DELAYS =I915_READ (PCH_PP_ON_DELAYS ); dev_priv->regfile.savePP_OFF_DELAYS =I915_READ (PCH_PP_OFF_DELAYS );@@ -79,7 +79,7 @@ static void i915_restore_display(struct
drm_device*dev)drivers/gpu/drm/i915/i915_suspend.c static void i915_restore_display(struct drm_device *dev) · line 109
Quoted 8 lines
drivers/gpu/drm/i915/i915_suspend.c +1
-1I915_WRITE (LVDS , dev_priv->regfile.saveLVDS & mask);/* Panel power sequencer */ -if (HAS_PCH_SPLIT (dev)) { +if (!HAS_GMCH_DISPLAY (dev)) {I915_WRITE (PCH_PP_ON_DELAYS , dev_priv->regfile.savePP_ON_DELAYS);I915_WRITE (PCH_PP_OFF_DELAYS , dev_priv->regfile.savePP_OFF_DELAYS);I915_WRITE (PCH_PP_DIVISOR , dev_priv->regfile.savePP_DIVISOR);I don't think you should touch
i915_suspend.cat all. We're trying to get rid of this blind register save/restore, and make everything work in the encoder/connector code. Do note that we already skip this for vlv/chv power sequencer registers.drivers/gpu/drm/i915/intel_dp.c intel_dp_init_panel_power_sequencer(struct
Quoted 23 lines
(quoted diff) +0
-0
b/drivers/gpu/drm/i915/intel_dp.cindex 937ba31..68e10c1 100644drivers/gpu/drm/i915/intel_dp.c +2
-2@@ -559,7 +559,7 @@ static u32 _pp_ctrl_reg(struct intel_dp *intel_dp) {struct drm_device *dev =intel_dp_to_dev (intel_dp); -if (HAS_PCH_SPLIT (dev)) +if (!HAS_GMCH_DISPLAY (dev))return PCH_PP_CONTROL ;else return VLV_PIPE_PP_CONTROL (vlv_power_sequencer_pipe (intel_dp));@@ -569,7 +569,7 @@ static u32 _pp_stat_reg(struct intel_dp *intel_dp) {struct drm_device *dev =intel_dp_to_dev (intel_dp); -if (HAS_PCH_SPLIT (dev)) +if (!HAS_GMCH_DISPLAY (dev))return PCH_PP_STATUS ;else return VLV_PIPE_PP_STATUS (vlv_power_sequencer_pipe (intel_dp));@@ -4963,7 +4963,7 @@ intel_dp_init_panel_power_sequencer(struct
drm_device*dev,Quoted 17 lines
drivers/gpu/drm/i915/intel_dp.c +2
-2if (final->t11_t12 !=0 )return ; -if (HAS_PCH_SPLIT (dev)) { +if (!HAS_GMCH_DISPLAY (dev)) { pp_ctrl_reg =PCH_PP_CONTROL ; pp_on_reg =PCH_PP_ON_DELAYS ; pp_off_reg =PCH_PP_OFF_DELAYS ;@@ -5063,7 +5063,7 @@ intel_dp_init_panel_power_sequencer_registers(struct drm_device *dev, lockdep_assert_held(&dev_priv->pps_mutex); -if (HAS_PCH_SPLIT (dev)) { +if (!HAS_GMCH_DISPLAY (dev)) { pp_on_reg =PCH_PP_ON_DELAYS ; pp_off_reg =PCH_PP_OFF_DELAYS ;Quoted 1 line
pp_div_reg=PCH_PP_DIVISOR;For the rest, I'd like you to do what I suggested in my reply to patch 3, i.e. add a new if (
IS_BROXTON(dev)) at the top of each of these, withBXT_PP_WHATEVER(0)as the register. Later on, we can add code to choose the power sequencer, a bit similar to what vlv/chv do now (except there it's based on pipe).BR,
Jani.Quoted 7 lines
--
2.0.1_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx--
Jani Nikula, Intel Open Source Technology Center- Vandana
Quoted 67 lines · Matt Roper
Broxton-specific panel power sequencing was added in commit
commit
b0a08bec96318be54db97c3f0b9e37b52561f9ea
Author: Vandana Kannan <[email protected]>
Date: Thu Jun 18 11:00:55 2015 +0530drm/i915/bxt: eDP Panel Power sequencing
As noted in that commit, Broxton has two sets of registers (and we're supposed to read which to use from the VBT, although we're punting on that part at the moment) and also doesn't have a divisor register. Although we take the BXT-specific details into account at initial system init, we fail to save/restore the appropriate registers around system suspend/resume, which leads to unclaimed register warnings at the moment, and may also fail to save the proper registers once we start actually paying attention to the VBT.
Cc Vandana Kannan <[email protected]>Signed-off-by Matt Roper <[email protected]>--- drivers/gpu/drm/i915/i915_suspend.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/i915_suspend.c +22
-2@@ -44,7 +44,18 @@ static void i915_save_display(struct drm_device *dev) dev_priv->regfile.saveLVDS =I915_READ (LVDS );/* Panel power sequencer */ -if (HAS_PCH_SPLIT (dev)) { +if (IS_BROXTON (dev)) { +/* +* TODO: BXT has 2 sets of PPS registers. +* Correct Register for Broxton need to be identified +* using VBT. hardcoding for now. +* +* There's also no divisor register on Broxton. +*/ + dev_priv->regfile.savePP_CONTROL =I915_READ (BXT_PP_CONTROL (0 )); + dev_priv->regfile.savePP_ON_DELAYS =I915_READ (BXT_PP_ON_DELAYS (0 )); + dev_priv->regfile.savePP_OFF_DELAYS =I915_READ (BXT_PP_OFF_DELAYS (0 )); + }else if (HAS_PCH_SPLIT (dev)) { dev_priv->regfile.savePP_CONTROL =I915_READ (PCH_PP_CONTROL ); dev_priv->regfile.savePP_ON_DELAYS =I915_READ (PCH_PP_ON_DELAYS ); dev_priv->regfile.savePP_OFF_DELAYS =I915_READ (PCH_PP_OFF_DELAYS );@@ -83,7 +94,16 @@ static void i915_restore_display(struct drm_device *dev)I915_WRITE (LVDS , dev_priv->regfile.saveLVDS & mask);/* Panel power sequencer */ -if (HAS_PCH_SPLIT (dev)) { +if (IS_BROXTON (dev)) { +/* +* TODO: BXT has 2 sets of PPS registers. +* Correct Register for Broxton need to be identified +* using VBT. hardcoding for now +*/ +I915_WRITE (BXT_PP_ON_DELAYS (0 ), dev_priv->regfile.savePP_ON_DELAYS); +I915_WRITE (BXT_PP_OFF_DELAYS (0 ), dev_priv->regfile.savePP_OFF_DELAYS); +I915_WRITE (BXT_PP_CONTROL (0 ), dev_priv->regfile.savePP_CONTROL); + }else if (HAS_PCH_SPLIT (dev)) {I915_WRITE (PCH_PP_ON_DELAYS , dev_priv->regfile.savePP_ON_DELAYS);I915_WRITE (PCH_PP_OFF_DELAYS , dev_priv->regfile.savePP_OFF_DELAYS);I915_WRITE (PCH_PP_DIVISOR , dev_priv->regfile.savePP_DIVISOR);
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 15 lines · Jani Nikula
Quoted 5 lines · Matt Roper
Quoted 4 lines · Vandana
When I submitted the PPS patch in April, I got an input from Jani to not make changes in
i915_suspend.cas it was to become obsolete. Below mail for your reference.Quoted 8 lines
Quoted 2 lines
Jani,
Does your initial comment still hold good?I don't think not touching
i915_suspend.cat all is an option since that means that the current code will try to read/write registers that simply don't exist on the platform. Based on Jani's comment, maybe we should just be adding BXT to the list of platforms we don't do any PP save/restore on?
Quoted 5 lines
Not touching the registers in
i915_suspend.cfor BXT was what I meant, but probably failed at expressing it. The encoder/connector hooks should cover this, and if not, should be updated to cover this. The big hammer suspend/resume ini915_suspend.cis oblivious to most modeset state and is unable to do anything clever.
Hm, I thought it died already? What's keeping the pp code in i915_suspend.c on life-support?
-Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Jani Nikula
maintainerQuoted 16 lines · Daniel Vetter
Quoted 15 lines · Jani Nikula
Quoted 13 lines · Matt Roper
Quoted 6 lines · Vandana
When I submitted the PPS patch in April, I got an input from Jani to not make changes in
i915_suspend.cas it was to become obsolete. Below mail for your reference.Jani,
Does your initial comment still hold good?I don't think not touching
i915_suspend.cat all is an option since that means that the current code will try to read/write registers that simply don't exist on the platform. Based on Jani's comment, maybe we should just be adding BXT to the list of platforms we don't do any PP save/restore on?
Quoted 8 lines
Quoted 5 lines
Not touching the registers in
i915_suspend.cfor BXT was what I meant, but probably failed at expressing it. The encoder/connector hooks should cover this, and if not, should be updated to cover this. The big hammer suspend/resume ini915_suspend.cis oblivious to most modeset state and is unable to do anything clever.Hm, I thought it died already? What's keeping the pp code in
i915_suspend.con life-support?
We just haven't added stuff for new platforms, but the old cruft is still there for old platforms. Haven't been bold enought to nuke it.
BR,
Jani.
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ failure: Fi.CI.BAT
In reply to Matt Roper== Summary ==
== Summary ==
Built on 79686f613b3955a4ed09cee936e7f70ec4e61b67 drm-intel-nightly: 2015y-12m-30d-11h-59m-54s UTC integration manifest
Test gem_ctx_param_basic:
Subgroup basic:
pass -> DMESG-WARN (skl-i7k-2)
Subgroup invalid-param-set:
pass -> DMESG-WARN (skl-i7k-2)
Test gem_mmap_gtt:
Subgroup basic-write:
pass -> DMESG-WARN (skl-i7k-2)
Test gem_storedw_loop:
Subgroup basic-render:
dmesg-warn -> PASS (skl-i5k-2)
Test kms_addfb_basic:
Subgroup too-wide:
pass -> DMESG-WARN (skl-i7k-2)
Test kms_flip:
Subgroup basic-flip-vs-dpms:
dmesg-warn -> PASS (ilk-hp8440p)
Subgroup basic-flip-vs-modeset:
dmesg-warn -> PASS (bsw-nuc-2)
dmesg-warn -> PASS (hsw-xps12)
dmesg-warn -> PASS (hsw-brixbox)
dmesg-warn -> PASS (bdw-nuci7)
dmesg-warn -> PASS (ilk-hp8440p)
Test kms_pipe_crc_basic:
Subgroup read-crc-pipe-a:
dmesg-warn -> PASS (snb-x220t)
dmesg-warn -> PASS (byt-nuc)
Subgroup read-crc-pipe-b:
pass -> DMESG-WARN (snb-dellxps)
Subgroup read-crc-pipe-b-frame-sequence:
pass -> DMESG-FAIL (skl-i7k-2)
Test kms_setmode:
Subgroup basic-clone-single-crtc:
dmesg-warn -> PASS (snb-dellxps)
Test pm_rpm:
Subgroup basic-rte:
dmesg-warn -> PASS (byt-nuc)bdw-nuci7 total:132 pass:122 dwarn:1 dfail:0 fail:0 skip:9 bdw-ultra total:132 pass:124 dwarn:2 dfail:0 fail:0 skip:6 bsw-nuc-2 total:135 pass:114 dwarn:1 dfail:0 fail:0 skip:20 byt-nuc total:135 pass:121 dwarn:1 dfail:0 fail:0 skip:13 hsw-brixbox total:135 pass:127 dwarn:1 dfail:0 fail:0 skip:7 hsw-gt2 total:135 pass:130 dwarn:1 dfail:0 fail:0 skip:4 hsw-xps12 total:132 pass:126 dwarn:2 dfail:0 fail:0 skip:4 ilk-hp8440p total:135 pass:100 dwarn:0 dfail:0 fail:0 skip:35 ivb-t430s total:135 pass:127 dwarn:2 dfail:0 fail:0 skip:6 skl-i5k-2 total:135 pass:124 dwarn:3 dfail:0 fail:0 skip:8 skl-i7k-2 total:135 pass:119 dwarn:7 dfail:1 fail:0 skip:8 snb-dellxps total:135 pass:121 dwarn:2 dfail:0 fail:0 skip:12 snb-x220t total:135 pass:122 dwarn:1 dfail:0 fail:1 skip:11
Results at /archive/results/CI_IGT_test/Patchwork_970/
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx