Skip to contentSkip to conversation

More PSR improvements

PATCH In review Rodrigo Vivi 6 participants 18 messages Nov 19, 2015 – Nov 24, 2015

Subsystems (2)
lore
Share & tools
lore

Rodrigo Vivi

author maintainer
#0 lore raw

cover More PSR improvements

During the review/test cycle from the previous versions I've captured few suggestions and tips and did more 3 patches to make it more clean and avoid any kind of confusion.

Thanks,
Rodrigo.

*** BLURB HERE ***

Rodrigo Vivi (3):
drm/i915: Also delay first activation for SKL+ drm/i915: Remove PSR Perf Counter for SKL+
drm/i915: Also disable PSR on Sink when disabling it on Source.

 drivers/gpu/drm/i915/i915_debugfs.c |  7 +++++--
 drivers/gpu/drm/i915/intel_psr.c    | 13 ++++++-------
 2 files changed, 11 insertions(+), 9 deletions(-)
Signature · 6 lines
2.4.3

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

PATCH 1/3 drm/i915: Also delay first activation for SKL+

In certain platforms we face strange and different issues when activating PSR right after a modeset so quickly. So we delayed the first activation for the platforms where we saw the issues with 'commit d0ac896a477d ("drm/i915: Delay first PSR activation.")'.

So, let's apply the same delay on first activation for SKL+ so we avoid any kind of confusion and handle similar implentations in the same way.

---
 drivers/gpu/drm/i915/intel_psr.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/intel_psr.c +3 -7
index 465d36b..38ea4d0 100644
@@ -420,9 +420,6 @@ void intel_psr_enable(struct intel_dp *intel_dp)
 
 		/* Enable PSR on the panel */
 		hsw_psr_enable_sink(intel_dp);
-
-		if (INTEL_INFO(dev)->gen >= 9)
-			intel_psr_activate(intel_dp);
 	} else {
 		vlv_psr_setup_vsc(intel_dp);
 
@@ -441,15 +438,14 @@ void intel_psr_enable(struct intel_dp *intel_dp)
 	/*
 	 * FIXME: Activation should happen immediately since this function
 	 * is just called after pipe is fully trained and enabled.
-	 * However on every platform we face issues when first activation
+	 * However on some platforms we face issues when first activation
 	 * follows a modeset so quickly.
 	 *     - On VLV/CHV we get bank screen on first activation
 	 *     - On HSW/BDW we get a recoverable frozen screen until next
 	 *       exit-activate sequence.
 	 */
-	if (INTEL_INFO(dev)->gen < 9)
-		schedule_delayed_work(&dev_priv->psr.work,
-				      msecs_to_jiffies(intel_dp->panel_power_cycle_delay * 5));
+	schedule_delayed_work(&dev_priv->psr.work,
+			      msecs_to_jiffies(intel_dp->panel_power_cycle_delay * 5));
 
 	dev_priv->psr.enabled = intel_dp;
 unlock:
Signature · 6 lines
2.4.3

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

Re: [PATCH 1/3] drm/i915: Also delay first activation for SKL+

Quoted 13 lines

-----Original Message-----
From: Vivi, Rodrigo
Sent: Thursday, November 19, 2015 6:10 AM
To: [email protected]
Cc: Vivi, Rodrigo; R, Durgadoss
Subject: [PATCH 1/3] drm/i915: Also delay first activation for SKL+

In certain platforms we face strange and different issues when activating PSR right after a modeset so quickly. So we delayed the first activation for the platforms where we saw the issues with 'commit d0ac896a477d ("drm/i915: Delay first PSR activation.")'.

Quoted 3 lines

So, let's apply the same delay on first activation for SKL+ so we avoid any kind of confusion and handle similar implentations in the same way.

Thanks for the quick change Rodrigo!!

Thanks,
Durga

Quoted 39 lines

---
drivers/gpu/drm/i915/intel_psr.c | 10 +++-------

1 file changed, 3 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/intel_psr.c +3 -7
index 465d36b..38ea4d0 100644
@@ -420,9 +420,6 @@ void intel_psr_enable(struct intel_dp *intel_dp)
 
 		/* Enable PSR on the panel */
 		hsw_psr_enable_sink(intel_dp);
-
-		if (INTEL_INFO(dev)->gen >= 9)
-			intel_psr_activate(intel_dp);
 	} else {
 		vlv_psr_setup_vsc(intel_dp);
 
@@ -441,15 +438,14 @@ void intel_psr_enable(struct intel_dp *intel_dp)
 	/*
 	 * FIXME: Activation should happen immediately since this function
 	 * is just called after pipe is fully trained and enabled.
-	 * However on every platform we face issues when first activation
+	 * However on some platforms we face issues when first activation
 	 * follows a modeset so quickly.
 	 *     - On VLV/CHV we get bank screen on first activation
 	 *     - On HSW/BDW we get a recoverable frozen screen until next
 	 *       exit-activate sequence.
 	 */
-	if (INTEL_INFO(dev)->gen < 9)
-		schedule_delayed_work(&dev_priv->psr.work,
-				      msecs_to_jiffies(intel_dp->panel_power_cycle_delay * 5));
+	schedule_delayed_work(&dev_priv->psr.work,
+			      msecs_to_jiffies(intel_dp->panel_power_cycle_delay * 5));
 
 	dev_priv->psr.enabled = intel_dp;
Quoted 3 lines

unlock:
--
2.4.3

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

#3 lore raw

Re: [PATCH 1/3] drm/i915: Also delay first activation for SKL+

In reply to Rodrigo Vivi

Hi Rodrigo,

Quoted 6 lines · Rodrigo Vivi
drivers/gpu/drm/i915/intel_psr.c +1 -1
@@ -441,15 +438,14 @@ void intel_psr_enable(struct intel_dp *intel_dp)
        /*
         * FIXME: Activation should happen immediately since this function
         * is just called after pipe is fully trained and enabled.
-        * However on every platform we face issues when first activation
+        * However on some platforms we face issues when first activation

drivers/gpu/drm/i915/intel_psr.c void intel_psr_enable(struct intel_dp *intel_dp) · line 448

Quoted 10 lines
drivers/gpu/drm/i915/intel_psr.c +2 -3
         * follows a modeset so quickly.
         *     - On VLV/CHV we get bank screen on first activation
         *     - On HSW/BDW we get a recoverable frozen screen until next
         *       exit-activate sequence.
         */
-       if (INTEL_INFO(dev)->gen < 9)
-               schedule_delayed_work(&dev_priv->psr.work,
-                                     msecs_to_jiffies(intel_dp->panel_power_cycle_delay * 5));
+       schedule_delayed_work(&dev_priv->psr.work,
+                             msecs_to_jiffies(intel_dp->panel_power_cycle_delay * 5));

The comment change here seems to be the exact opposite of the code
change: aren't we now seeing these issues on every platform? If not, it would be good to elaborate on the issues seen in SKL/BSW.

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

author maintainer
#4 lore raw

Re: [PATCH 1/3] drm/i915: Also delay first activation for SKL+

Quoted 22 lines · Daniel Stone

Hi Rodrigo,

Quoted 18 lines · Rodrigo Vivi
(quoted diff) +0 -0
@@ -441,15 +438,14 @@ void intel_psr_enable(struct intel_dp 
 *intel_dp)
        /*
         * FIXME: Activation should happen immediately since this 

function
* is just called after pipe is fully trained and enabled.
- * However on every platform we face issues when first
activation
+ * However on some platforms we face issues when first
activation
* follows a modeset so quickly.
* - On VLV/CHV we get bank screen on first activation
* - On HSW/BDW we get a recoverable frozen screen
until next
* exit-activate sequence.
*/

drivers/gpu/drm/i915/intel_psr.c +0 -2
-       if (INTEL_INFO(dev)->gen < 9)
-               schedule_delayed_work(&dev_priv->psr.work,
Quoted 8 lines

Review

Quoted 5 lines
(quoted diff) +2 -3
-                                     msecs_to_jiffies(intel_dp
->panel_power_cycle_delay * 5));
+       schedule_delayed_work(&dev_priv->psr.work,
+                             msecs_to_jiffies(intel_dp
->panel_power_cycle_delay * 5));

The comment change here seems to be the exact opposite of the code change:

Indeed, this is why I'll keep the fixme on the comment.

Quoted 2 lines

aren't we now seeing these issues on every platform? If not,
it would be good to elaborate on the issues seen in SKL/BSW.

So far no known issue on SKL/KBL. (BSW is CHV)
But since we have no idea why these issues are happening and separated handling was causing confusion I preferred to handle all with the protection.

Regarding the issue itself, the Hardware needs to communicate with the Sink using AUX channels. I believe there is just kind of strange conflict going on there because the failures are exactly when we are also using aux channels for our modeset/link-trainings.
This is also why I used panel_power_cycle_delay * 5 there because it is the same value we use to force VDD on while we are doing the aux transactions.

Please let me know if you have further questions, concerns or suggestions here.

Thanks

Quoted 3 lines

Cheers,
Daniel

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

author maintainer
#5 lore raw

PATCH 2/3 drm/i915: Remove PSR Perf Counter for SKL+

In reply to Rodrigo Vivi

Whenever DMC firmware put the HW into DC State a bunch of registers including this perf counter is reset to 0 and never restored.

So, even with PSR active and working we could still read "Performance_Counter: 0" what will misslead people to believe PSR is broken.

So, it is better to remove this counter information while we don't have a better way to track PSR residency.

---
 drivers/gpu/drm/i915/i915_debugfs.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +5 -2
index 038d5c6..71e1666 100644
@@ -2580,8 +2580,11 @@ static int i915_edp_psr_status(struct seq_file *m, void *data)
 		}
 	seq_puts(m, "\n");
 
-	/* CHV PSR has no kind of performance counter */
-	if (HAS_DDI(dev)) {
+	/*
+	 * VLV/CHV PSR has no kind of performance counter
+	 * SKL+ Perf counter is reset to 0 everytime DC state is entered
+	 */
+	if (IS_HASWELL(dev) || IS_BROADWELL(dev)) {
 		psrperf = I915_READ(EDP_PSR_PERF_CNT) &
 			EDP_PSR_PERF_CNT_MASK;
 
Signature · 6 lines
2.4.3

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 2/3
#6 lore raw

Re: [PATCH 2/3] drm/i915: Remove PSR Perf Counter for SKL+

Quoted 13 lines

-----Original Message-----
From: Intel-gfx [mailto:[email protected]] On Behalf Of Rodrigo Vivi
Sent: Thursday, November 19, 2015 6:10 AM
To: [email protected]
Cc: Vivi, Rodrigo
Subject: [Intel-gfx] [PATCH 2/3] drm/i915: Remove PSR Perf Counter for SKL+

Whenever DMC firmware put the HW into DC State a bunch of registers including this perf counter is reset to 0 and never restored.

Quoted 6 lines

So, even with PSR active and working we could still read "Performance_Counter: 0" what will misslead people to believe PSR is broken.

So, it is better to remove this counter information while we don't have a better way to track PSR residency.

Agreed..

Thanks,
Durga

Quoted 27 lines

---
drivers/gpu/drm/i915/i915_debugfs.c | 7 +++++--

1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +5 -3
index 038d5c6..71e1666 100644
@@ -2580,8 +2580,11 @@ static int i915_edp_psr_status(struct seq_file *m, void *data)
 		}
 	seq_puts(m, "\n");
 
-	/* CHV PSR has no kind of performance counter */
-	if (HAS_DDI(dev)) {
+	/*
+	 * VLV/CHV PSR has no kind of performance counter
+	 * SKL+ Perf counter is reset to 0 everytime DC state is entered
+	 */
+	if (IS_HASWELL(dev) || IS_BROADWELL(dev)) {
 		psrperf = I915_READ(EDP_PSR_PERF_CNT) &
 			EDP_PSR_PERF_CNT_MASK;
 
--

2.4.3

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

Reviewed-by Durgadoss R
#7 lore raw

Re: [PATCH 2/3] drm/i915: Remove PSR Perf Counter for SKL+

Hi Rodrigo,

Which platform have you observed this issue on?
This looks really strange.
Have you checked whether we are able to enter PSR at sink side or not in such cases? Are we sure we are not entering PSR? I mean the PSR_STATE register says it correctly?

Regards,
Sonika

-----Original Message-----
From: Intel-gfx [mailto:[email protected]] On Behalf Of R, Durgadoss
Sent: Thursday, November 19, 2015 11:39 AM
To: Vivi, Rodrigo; [email protected]
Cc: Vivi, Rodrigo
Subject: Re: [Intel-gfx] [PATCH 2/3] drm/i915: Remove PSR Perf Counter for SKL+

Quoted 12 lines

-----Original Message-----
From: Intel-gfx [mailto:[email protected]] On Behalf Of Rodrigo Vivi
Sent: Thursday, November 19, 2015 6:10 AM
To: [email protected]
Cc: Vivi, Rodrigo
Subject: [Intel-gfx] [PATCH 2/3] drm/i915: Remove PSR Perf Counter for SKL+

Whenever DMC firmware put the HW into DC State a bunch of registers including this perf counter is reset to 0 and never restored.

Quoted 6 lines

So, even with PSR active and working we could still read "Performance_Counter: 0" what will misslead people to believe PSR is broken.

So, it is better to remove this counter information while we don't have a better way to track PSR residency.

Agreed..

Thanks,
Durga

Quoted 28 lines

---
drivers/gpu/drm/i915/i915_debugfs.c | 7 +++++--

1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +5 -3
index 038d5c6..71e1666 100644
@@ -2580,8 +2580,11 @@ static int i915_edp_psr_status(struct seq_file *m, void *data)
 		}
 	seq_puts(m, "\n");
 
-	/* CHV PSR has no kind of performance counter */
-	if (HAS_DDI(dev)) {
+	/*
+	 * VLV/CHV PSR has no kind of performance counter
+	 * SKL+ Perf counter is reset to 0 everytime DC state is entered
+	 */
+	if (IS_HASWELL(dev) || IS_BROADWELL(dev)) {
 		psrperf = I915_READ(EDP_PSR_PERF_CNT) &
 			EDP_PSR_PERF_CNT_MASK;
 
--

2.4.3

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
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#8 lore raw

Re: [PATCH 2/3] drm/i915: Remove PSR Perf Counter for SKL+

Quoted 3 lines · Sonika

Hi Rodrigo,

Which platform have you observed this issue on?

Skylake and Kabylake

Quoted 1 line

This looks really strange.

It is expected actually.
On DC5/6 states all read-only registers are reset and cannot be restored. including this counter.

Quoted 2 lines

Have you checked whether we are able to enter PSR at sink side or not in such cases? Are we sure we are not entering PSR? I mean the PSR_STATE register says it correctly?

I'm sure PSR is working well in entry state with links off and Perf counter goes to zero when DC5/6 states enters.
So this patch just removes the counter to avoid confusion. People would think PSR isn't work, when it is.

Quoted 79 lines

Regards,
Sonika

-----Original Message-----
From: Intel-gfx [mailto:[email protected]] On Behalf Of R, Durgadoss
Sent: Thursday, November 19, 2015 11:39 AM
To: Vivi, Rodrigo; [email protected]
Cc: Vivi, Rodrigo
Subject: Re: [Intel-gfx] [PATCH 2/3] drm/i915: Remove PSR Perf Counter for SKL+

Quoted 12 lines

-----Original Message-----
From: Intel-gfx [mailto:[email protected]] On Behalf Of Rodrigo Vivi
Sent: Thursday, November 19, 2015 6:10 AM
To: [email protected]
Cc: Vivi, Rodrigo
Subject: [Intel-gfx] [PATCH 2/3] drm/i915: Remove PSR Perf Counter for SKL+

Whenever DMC firmware put the HW into DC State a bunch of registers including this perf counter is reset to 0 and never restored.

Quoted 6 lines

So, even with PSR active and working we could still read "Performance_Counter: 0" what will misslead people to believe PSR is broken.

So, it is better to remove this counter information while we don't have a better way to track PSR residency.

Agreed..

Thanks,
Durga

Quoted 28 lines

---
drivers/gpu/drm/i915/i915_debugfs.c | 7 +++++--

1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +5 -3
index 038d5c6..71e1666 100644
@@ -2580,8 +2580,11 @@ static int i915_edp_psr_status(struct seq_file *m, void *data)
              }
      seq_puts(m, "\n");
 
-      /* CHV PSR has no kind of performance counter */
-      if (HAS_DDI(dev)) {
+      /*
+       * VLV/CHV PSR has no kind of performance counter
+       * SKL+ Perf counter is reset to 0 everytime DC state is entered
+       */
+      if (IS_HASWELL(dev) || IS_BROADWELL(dev)) {
              psrperf = I915_READ(EDP_PSR_PERF_CNT) &
                      EDP_PSR_PERF_CNT_MASK;
 
--

2.4.3

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
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 6 lines
Rodrigo Vivi
Blog: http://blog.vivi.eng.br
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#9 lore raw

Re: [PATCH 2/3] drm/i915: Remove PSR Perf Counter for SKL+

Hmm, please help me understand more about it.
As per bspec this is a RW register.
Also, restoring the register values, isn't it part of the firmware's job? Do we have any communication from HW team on this?

Regards,
Sonika

-----Original Message-----
From: Rodrigo Vivi [mailto:[email protected]]
Sent: Friday, November 20, 2015 12:01 AM
To: Jindal, Sonika
Cc: R, Durgadoss; Vivi, Rodrigo; [email protected]
Subject: Re: [Intel-gfx] [PATCH 2/3] drm/i915: Remove PSR Perf Counter for SKL+

Quoted 3 lines · Sonika

Hi Rodrigo,

Which platform have you observed this issue on?

Skylake and Kabylake

Quoted 1 line

This looks really strange.

It is expected actually.
On DC5/6 states all read-only registers are reset and cannot be restored. including this counter.

Quoted 2 lines

Have you checked whether we are able to enter PSR at sink side or not in such cases? Are we sure we are not entering PSR? I mean the PSR_STATE register says it correctly?

I'm sure PSR is working well in entry state with links off and Perf counter goes to zero when DC5/6 states enters. So this patch just removes the counter to avoid confusion. People would think PSR isn't work, when it is.

Quoted 69 lines

Regards,
Sonika

-----Original Message-----
From: Intel-gfx [mailto:[email protected]] On Behalf Of R, Durgadoss
Sent: Thursday, November 19, 2015 11:39 AM
To: Vivi, Rodrigo; [email protected]
Cc: Vivi, Rodrigo
Subject: Re: [Intel-gfx] [PATCH 2/3] drm/i915: Remove PSR Perf Counter for SKL+

Quoted 12 lines

-----Original Message-----
From: Intel-gfx [mailto:[email protected]] On Behalf Of Rodrigo Vivi
Sent: Thursday, November 19, 2015 6:10 AM
To: [email protected]
Cc: Vivi, Rodrigo
Subject: [Intel-gfx] [PATCH 2/3] drm/i915: Remove PSR Perf Counter for SKL+

Whenever DMC firmware put the HW into DC State a bunch of registers including this perf counter is reset to 0 and never restored.

Quoted 6 lines

So, even with PSR active and working we could still read "Performance_Counter: 0" what will misslead people to believe PSR is broken.

So, it is better to remove this counter information while we don't have a better way to track PSR residency.

Agreed..

Thanks,
Durga

Quoted 28 lines

---
drivers/gpu/drm/i915/i915_debugfs.c | 7 +++++--

1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +5 -3
index 038d5c6..71e1666 100644
@@ -2580,8 +2580,11 @@ static int i915_edp_psr_status(struct seq_file *m, void *data)
              }
      seq_puts(m, "\n");
 
-      /* CHV PSR has no kind of performance counter */
-      if (HAS_DDI(dev)) {
+      /*
+       * VLV/CHV PSR has no kind of performance counter
+       * SKL+ Perf counter is reset to 0 everytime DC state is entered
+       */
+      if (IS_HASWELL(dev) || IS_BROADWELL(dev)) {
              psrperf = I915_READ(EDP_PSR_PERF_CNT) &
                      EDP_PSR_PERF_CNT_MASK;
 
--

2.4.3

Quoted 12 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
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

--
Rodrigo Vivi
Blog: http://blog.vivi.eng.br
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

author maintainer
#10 lore raw

Re: [PATCH 2/3] drm/i915: Remove PSR Perf Counter for SKL+

Quoted 1 line · Sonika

Hmm, please help me understand more about it.

Well, PSR is working because we are seeing PC10 with screen on. But the registers are zeroed. Regarding it is restored properly or not.

I can send a v2 with a much better commit message and explanation now I know it better after talking to HW guys.

Quoted 3 lines

As per bspec this is a RW register.
Also, restoring the register values, isn't it part of the firmware's job?

Oh indeed. I'm sorry for my confusion.

Quoted 1 line

Do we have any communication from HW team on this?

Today when I was explaining them what I was seeing I realized that this register is reset to 0 when entering DC5/6. Even if restored properly on exit, we would still see 0 on the full idle scenario and people would think PSR is not working. So I still want to remove that.

Quoted 128 lines

Regards,
Sonika

-----Original Message-----
From: Rodrigo Vivi [mailto:[email protected]]
Sent: Friday, November 20, 2015 12:01 AM
To: Jindal, Sonika
Cc: R, Durgadoss; Vivi, Rodrigo; [email protected]
Subject: Re: [Intel-gfx] [PATCH 2/3] drm/i915: Remove PSR Perf Counter for SKL+

Quoted 3 lines · Sonika

Hi Rodrigo,

Which platform have you observed this issue on?

Skylake and Kabylake

Quoted 1 line

This looks really strange.

It is expected actually.
On DC5/6 states all read-only registers are reset and cannot be restored. including this counter.

Quoted 4 lines

Have you checked whether we are able to enter PSR at sink side or not in such cases?
Are we sure we are not entering PSR? I mean the PSR_STATE register says it correctly?

I'm sure PSR is working well in entry state with links off and Perf counter goes to zero when DC5/6 states enters.
So this patch just removes the counter to avoid confusion. People would think PSR isn't work, when it is.

Quoted 77 lines

Regards,
Sonika

-----Original Message-----
From: Intel-gfx [mailto:[email protected]] On Behalf Of R, Durgadoss
Sent: Thursday, November 19, 2015 11:39 AM
To: Vivi, Rodrigo; [email protected]
Cc: Vivi, Rodrigo
Subject: Re: [Intel-gfx] [PATCH 2/3] drm/i915: Remove PSR Perf Counter
for SKL+

Quoted 15 lines

-----Original Message-----
From: Intel-gfx [mailto:[email protected]] On
Behalf Of Rodrigo Vivi
Sent: Thursday, November 19, 2015 6:10 AM
To: [email protected]
Cc: Vivi, Rodrigo
Subject: [Intel-gfx] [PATCH 2/3] drm/i915: Remove PSR Perf Counter for
SKL+

Whenever DMC firmware put the HW into DC State a bunch of registers
including this perf counter is reset to 0 and never restored.

Quoted 8 lines

So, even with PSR active and working we could still read "Performance_Counter: 0" what will misslead people to believe PSR is
broken.

So, it is better to remove this counter information while we don't
have a better way to track PSR residency.

Agreed..

Thanks,
Durga

Quoted 30 lines

---
drivers/gpu/drm/i915/i915_debugfs.c | 7 +++++--

1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +3 -2
index 038d5c6..71e1666 100644
@@ -2580,8 +2580,11 @@ static int i915_edp_psr_status(struct 
 seq_file *m, void *data)
              }
      seq_puts(m, "\n");
 
-      /* CHV PSR has no kind of performance counter */
-      if (HAS_DDI(dev)) {
+      /*
+       * VLV/CHV PSR has no kind of performance counter
+       * SKL+ Perf counter is reset to 0 everytime DC state is 

entered

drivers/gpu/drm/i915/i915_debugfs.c +2 -1
+       */
+      if (IS_HASWELL(dev) || IS_BROADWELL(dev)) {
              psrperf = I915_READ(EDP_PSR_PERF_CNT) &
                      EDP_PSR_PERF_CNT_MASK;
 
--

2.4.3

Quoted 12 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
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Quoted 3 lines

--
Rodrigo Vivi
Blog: http://blog.vivi.eng.br

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

author maintainer
#11 lore raw

PATCH 1/1 drm/i915: Remove PSR Perf Counter for SKL+

Whenever DMC firmware put the HW into DC State a bunch of registers including this perf counter is reset to 0.

Even with PSR active and working we could still read "Performance_Counter: 0" what will misslead people to believe PSR is broken. For instance on SKL we can only see PC10 residency with screen on if PSR is working properly. However Performance_Counter was showing 0.

Even if it restored properly on DC6 exit we don't want to give users the wrong impression that PSR is not working while we know for sure it is.

So, it is better to remove this counter information while we don't have a better way to track PSR residency.

---
 drivers/gpu/drm/i915/i915_debugfs.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +5 -2
index b28da6f..a728ff1 100644
@@ -2582,8 +2582,11 @@ static int i915_edp_psr_status(struct seq_file *m, void *data)
 		}
 	seq_puts(m, "\n");
 
-	/* CHV PSR has no kind of performance counter */
-	if (HAS_DDI(dev)) {
+	/*
+	 * VLV/CHV PSR has no kind of performance counter
+	 * SKL+ Perf counter is reset to 0 everytime DC state is entered
+	 */
+	if (IS_HASWELL(dev) || IS_BROADWELL(dev)) {
 		psrperf = I915_READ(EDP_PSR_PERF_CNT) &
 			EDP_PSR_PERF_CNT_MASK;
 
Signature · 6 lines
2.4.3

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

Re: [PATCH] drm/i915: Remove PSR Perf Counter for SKL+

Quoted 13 lines · Rodrigo Vivi

Whenever DMC firmware put the HW into DC State a bunch of registers including this perf counter is reset to 0.

Even with PSR active and working we could still read "Performance_Counter: 0" what will misslead people to believe PSR is broken. For instance on SKL we can only see PC10 residency with screen on if PSR is working properly. However Performance_Counter was showing 0.

Even if it restored properly on DC6 exit we don't want to give users the wrong impression that PSR is not working while we know for sure it is.

Quoted 5 lines

So, it is better to remove this counter information while we don't have a better way to track PSR residency.

Queued for -next, thanks for the patch.
-Daniel

Quoted 29 lines
---
 drivers/gpu/drm/i915/i915_debugfs.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +5 -2
index b28da6f..a728ff1 100644
@@ -2582,8 +2582,11 @@ static int i915_edp_psr_status(struct seq_file *m, void *data)
 		}
 	seq_puts(m, "\n");
 
-	/* CHV PSR has no kind of performance counter */
-	if (HAS_DDI(dev)) {
+	/*
+	 * VLV/CHV PSR has no kind of performance counter
+	 * SKL+ Perf counter is reset to 0 everytime DC state is entered
+	 */
+	if (IS_HASWELL(dev) || IS_BROADWELL(dev)) {
 		psrperf = I915_READ(EDP_PSR_PERF_CNT) &
 			EDP_PSR_PERF_CNT_MASK;
 
Signature · 6 lines
2.4.3

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
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
author maintainer
#13 lore raw

PATCH 3/3 drm/i915: Also disable PSR on Sink when disabling it on Source.

In reply to Rodrigo Vivi

It is not a bad idea to disable the PSR feature on Sink when we are disabling on the Source.

---
 drivers/gpu/drm/i915/intel_psr.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_psr.c +3 -0
index 38ea4d0..de31162 100644
@@ -527,6 +527,9 @@ void intel_psr_disable(struct intel_dp *intel_dp)
 	mutex_unlock(&dev_priv->psr.lock);
 
 	cancel_delayed_work_sync(&dev_priv->psr.work);
+
+	/* Disable PSR on Sink */
+	drm_dp_dpcd_writeb(&intel_dp->aux, DP_PSR_EN_CFG, 0);
 }
 
 static void intel_psr_work(struct work_struct *work)
Signature · 6 lines
2.4.3

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

Re: [PATCH 3/3] drm/i915: Also disable PSR on Sink when disabling it on Source.

Why not move it inside the mutex_lock/unlock on psr.lock ?

Regards,
Sonika

-----Original Message-----
From: Vivi, Rodrigo
Sent: Thursday, November 19, 2015 6:10 AM
To: [email protected]
Cc: Vivi, Rodrigo; Jindal, Sonika
Subject: [PATCH 3/3] drm/i915: Also disable PSR on Sink when disabling it on Source.

It is not a bad idea to disable the PSR feature on Sink when we are disabling on the Source.

---
 drivers/gpu/drm/i915/intel_psr.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_psr.c +3 -0
index 38ea4d0..de31162 100644
@@ -527,6 +527,9 @@ void intel_psr_disable(struct intel_dp *intel_dp)
 	mutex_unlock(&dev_priv->psr.lock);
 
 	cancel_delayed_work_sync(&dev_priv->psr.work);
+
+	/* Disable PSR on Sink */
+	drm_dp_dpcd_writeb(&intel_dp->aux, DP_PSR_EN_CFG, 0);
 }
 
 static void intel_psr_work(struct work_struct *work)

--
2.4.3

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

author maintainer
#15 lore raw

PATCH 1/1 drm/i915: Also disable PSR on Sink when disabling it on Source.

It is not a bad idea to disable the PSR feature on Sink when we are disabling on the Source.

v2: Move dpcd write inside mutex protected area as suggested by Sonika.

---
 drivers/gpu/drm/i915/intel_psr.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/i915/intel_psr.c +4 -0
index 2b2f84d..3bbb270 100644
@@ -518,11 +518,15 @@ void intel_psr_disable(struct intel_dp *intel_dp)
 		return;
 	}
 
+	/* Disable PSR on Source */
 	if (HAS_DDI(dev))
 		hsw_psr_disable(intel_dp);
 	else
 		vlv_psr_disable(intel_dp);
 
+	/* Disable PSR on Sink */
+	drm_dp_dpcd_writeb(&intel_dp->aux, DP_PSR_EN_CFG, 0);
+
 	dev_priv->psr.enabled = NULL;
 	mutex_unlock(&dev_priv->psr.lock);
 
Signature · 6 lines
2.4.3

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

Re: [PATCH] drm/i915: Also disable PSR on Sink when disabling it on Source.

-----Original Message-----
From: Vivi, Rodrigo
Sent: Tuesday, November 24, 2015 3:50 AM
To: [email protected]
Cc: Vivi, Rodrigo; Jindal, Sonika
Subject: [PATCH] drm/i915: Also disable PSR on Sink when disabling it on Source.

It is not a bad idea to disable the PSR feature on Sink when we are disabling on the Source.

v2: Move dpcd write inside mutex protected area as suggested by Sonika.

---
 drivers/gpu/drm/i915/intel_psr.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/i915/intel_psr.c +4 -0
index 2b2f84d..3bbb270 100644
@@ -518,11 +518,15 @@ void intel_psr_disable(struct intel_dp *intel_dp)
 		return;
 	}
 
+	/* Disable PSR on Source */
 	if (HAS_DDI(dev))
 		hsw_psr_disable(intel_dp);
 	else
 		vlv_psr_disable(intel_dp);
 
+	/* Disable PSR on Sink */
+	drm_dp_dpcd_writeb(&intel_dp->aux, DP_PSR_EN_CFG, 0);
+
 	dev_priv->psr.enabled = NULL;
 	mutex_unlock(&dev_priv->psr.lock);
 

--
2.4.3

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

#17 lore raw

Re: [PATCH] drm/i915: Also disable PSR on Sink when disabling it on Source.

Quoted 9 lines · Sonika

-----Original Message-----
From: Vivi, Rodrigo
Sent: Tuesday, November 24, 2015 3:50 AM
To: [email protected]
Cc: Vivi, Rodrigo; Jindal, Sonika
Subject: [PATCH] drm/i915: Also disable PSR on Sink when disabling it on Source.

Quoted 7 lines

It is not a bad idea to disable the PSR feature on Sink when we are disabling on the Source.

v2: Move dpcd write inside mutex protected area as suggested by Sonika.

Queued for -next, thanks for the patch.
-Daniel

Quoted 31 lines
---
 drivers/gpu/drm/i915/intel_psr.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/i915/intel_psr.c +4 -1
index 2b2f84d..3bbb270 100644
@@ -518,11 +518,15 @@ void intel_psr_disable(struct intel_dp *intel_dp)
 		return;
 	}
 
+	/* Disable PSR on Source */
 	if (HAS_DDI(dev))
 		hsw_psr_disable(intel_dp);
 	else
 		vlv_psr_disable(intel_dp);
 
+	/* Disable PSR on Sink */
+	drm_dp_dpcd_writeb(&intel_dp->aux, DP_PSR_EN_CFG, 0);
+
 	dev_priv->psr.enabled = NULL;
 	mutex_unlock(&dev_priv->psr.lock);
 
--

2.4.3

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

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