Skip to contentSkip to conversation

drm/i915/bdw: Simple IPS pixel_rate x 0.95 cdclk restriction

PATCH In review Rodrigo Vivi 6 participants 9 messages May 20, 2015 – May 21, 2015

Subsystems (2)
lore
Share & tools
lore

Rodrigo Vivi

author maintainer
#0 lore raw

PATCH 1/1 drm/i915/bdw: Simple IPS pixel_rate x 0.95 cdclk restriction

Broadwell Workaround : Do not enable IPS when the pipe pixel rate is greater than
95% of the CDCLK frequency. The pipe pixel rate is the port pixel rate multiplied by the pipe scaler down scale amount.

---
 drivers/gpu/drm/i915/intel_display.c | 9 +++++++++
 drivers/gpu/drm/i915/intel_drv.h     | 2 ++
 drivers/gpu/drm/i915/intel_pm.c      | 4 ++--
 3 files changed, 13 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_display.c +9 -0
index 9d2d6fb..dd8ef51 100644
@@ -112,6 +112,7 @@ static int i9xx_get_refclk(const struct intel_crtc_state *crtc_state,
 			   int num_connectors);
 static void intel_crtc_enable_planes(struct drm_crtc *crtc);
 static void intel_crtc_disable_planes(struct drm_crtc *crtc);
+static int broadwell_get_display_clock_speed(struct drm_device *dev);
 
 static struct intel_encoder *intel_find_encoder(struct intel_connector *connector, int pipe)
 {
@@ -4948,6 +4949,14 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc)
 /* IPS only exists on ULT machines and is tied to pipe A. */
 static bool hsw_crtc_supports_ips(struct intel_crtc *crtc)
 {
+	struct drm_device *dev = crtc->base.dev;
+
+	if (IS_BROADWELL(dev) && ilk_pipe_pixel_rate(dev, &crtc->base) >
+	    broadwell_get_display_clock_speed(dev) * 95/100) {
+		DRM_DEBUG_KMS("IPS avoided because pixel rate is greater than 95 percent of CDCLK\n");
+		return false;
+	}
+
 	return HAS_IPS(crtc->base.dev) && crtc->pipe == PIPE_A;
 }
 
drivers/gpu/drm/i915/intel_drv.h +2 -0
index 47bc729..c59fa3f 100644
@@ -1341,6 +1341,8 @@ void intel_display_set_init_power(struct drm_i915_private *dev, bool enable);
 /* intel_pm.c */
 void intel_init_clock_gating(struct drm_device *dev);
 void intel_suspend_hw(struct drm_device *dev);
+uint32_t ilk_pipe_pixel_rate(struct drm_device *dev,
+			     struct drm_crtc *crtc);
 int ilk_wm_max_level(const struct drm_device *dev);
 void intel_update_watermarks(struct drm_crtc *crtc);
 void intel_update_sprite_watermarks(struct drm_plane *plane,
drivers/gpu/drm/i915/intel_pm.c +2 -2
index ce1d079..0afeae8 100644
@@ -1434,8 +1434,8 @@ static void i845_update_wm(struct drm_crtc *unused_crtc)
 	I915_WRITE(FW_BLC, fwater_lo);
 }
 
-static uint32_t ilk_pipe_pixel_rate(struct drm_device *dev,
-				    struct drm_crtc *crtc)
+uint32_t ilk_pipe_pixel_rate(struct drm_device *dev,
+			     struct drm_crtc *crtc)
 {
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 	uint32_t pixel_rate;
Signature · 6 lines
2.1.0

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

Broadwell Workaround : Do not enable IPS when the pipe pixel rate is greater than
95% of the CDCLK frequency. The pipe pixel rate is the port pixel rate multiplied by the pipe scaler down scale amount.

Or just merge my patch doing the same thing?

Quoted 70 lines
---
 drivers/gpu/drm/i915/intel_display.c | 9 +++++++++
 drivers/gpu/drm/i915/intel_drv.h     | 2 ++
 drivers/gpu/drm/i915/intel_pm.c      | 4 ++--
 3 files changed, 13 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_display.c +9 -0
index 9d2d6fb..dd8ef51 100644
@@ -112,6 +112,7 @@ static int i9xx_get_refclk(const struct intel_crtc_state *crtc_state,
 			   int num_connectors);
 static void intel_crtc_enable_planes(struct drm_crtc *crtc);
 static void intel_crtc_disable_planes(struct drm_crtc *crtc);
+static int broadwell_get_display_clock_speed(struct drm_device *dev);
 
 static struct intel_encoder *intel_find_encoder(struct intel_connector *connector, int pipe)
 {
@@ -4948,6 +4949,14 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc)
 /* IPS only exists on ULT machines and is tied to pipe A. */
 static bool hsw_crtc_supports_ips(struct intel_crtc *crtc)
 {
+	struct drm_device *dev = crtc->base.dev;
+
+	if (IS_BROADWELL(dev) && ilk_pipe_pixel_rate(dev, &crtc->base) >
+	    broadwell_get_display_clock_speed(dev) * 95/100) {
+		DRM_DEBUG_KMS("IPS avoided because pixel rate is greater than 95 percent of CDCLK\n");
+		return false;
+	}
+
 	return HAS_IPS(crtc->base.dev) && crtc->pipe == PIPE_A;
 }
 
drivers/gpu/drm/i915/intel_drv.h +2 -0
index 47bc729..c59fa3f 100644
@@ -1341,6 +1341,8 @@ void intel_display_set_init_power(struct drm_i915_private *dev, bool enable);
 /* intel_pm.c */
 void intel_init_clock_gating(struct drm_device *dev);
 void intel_suspend_hw(struct drm_device *dev);
+uint32_t ilk_pipe_pixel_rate(struct drm_device *dev,
+			     struct drm_crtc *crtc);
 int ilk_wm_max_level(const struct drm_device *dev);
 void intel_update_watermarks(struct drm_crtc *crtc);
 void intel_update_sprite_watermarks(struct drm_plane *plane,
drivers/gpu/drm/i915/intel_pm.c +2 -2
index ce1d079..0afeae8 100644
@@ -1434,8 +1434,8 @@ static void i845_update_wm(struct drm_crtc *unused_crtc)
 	I915_WRITE(FW_BLC, fwater_lo);
 }
 
-static uint32_t ilk_pipe_pixel_rate(struct drm_device *dev,
-				    struct drm_crtc *crtc)
+uint32_t ilk_pipe_pixel_rate(struct drm_device *dev,
+			     struct drm_crtc *crtc)
 {
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 	uint32_t pixel_rate;
Signature · 6 lines
2.1.0

_______________________________________________
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
author maintainer
#2 lore raw
Quoted 7 lines · Ville Syrjälä
Quoted 4 lines · Rodrigo Vivi

Broadwell Workaround : Do not enable IPS when the pipe pixel rate is greater than
95% of the CDCLK frequency. The pipe pixel rate is the port pixel rate multiplied by the pipe scaler down scale amount.

Or just merge my patch doing the same thing?

I was trying to make the simple possible since latest one that I was looking at was depending on a series of many patches. It was caching the max cdclk, etc...

But now I looked again your first one and saw the history there that got merged but it was removed due to unclaimed registers...

Now I see that my patch and your original one aren't so different... I'm sorry...

So I was telling Paulo that with my patch I can't get Unclaimed messages anymore and when double cheking I noticed that runing pm_rpm rte with no patch I get the "Unclaimed register detected before reading register 0x130040"

So I believe your first patch is good to get merged. I believe that "Unclaimed reg" that Paulo saw was something else.

So, back to yours...

Quoted 67 lines
Quoted 67 lines
---
 drivers/gpu/drm/i915/intel_display.c | 9 +++++++++
 drivers/gpu/drm/i915/intel_drv.h     | 2 ++
 drivers/gpu/drm/i915/intel_pm.c      | 4 ++--
 3 files changed, 13 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_display.c +9 -0
index 9d2d6fb..dd8ef51 100644
@@ -112,6 +112,7 @@ static int i9xx_get_refclk(const struct intel_crtc_state *crtc_state,
 			   int num_connectors);
 static void intel_crtc_enable_planes(struct drm_crtc *crtc);
 static void intel_crtc_disable_planes(struct drm_crtc *crtc);
+static int broadwell_get_display_clock_speed(struct drm_device *dev);
 
 static struct intel_encoder *intel_find_encoder(struct intel_connector *connector, int pipe)
 {
@@ -4948,6 +4949,14 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc)
 /* IPS only exists on ULT machines and is tied to pipe A. */
 static bool hsw_crtc_supports_ips(struct intel_crtc *crtc)
 {
+	struct drm_device *dev = crtc->base.dev;
+
+	if (IS_BROADWELL(dev) && ilk_pipe_pixel_rate(dev, &crtc->base) >
+	    broadwell_get_display_clock_speed(dev) * 95/100) {
+		DRM_DEBUG_KMS("IPS avoided because pixel rate is greater than 95 percent of CDCLK\n");
+		return false;
+	}
+
 	return HAS_IPS(crtc->base.dev) && crtc->pipe == PIPE_A;
 }
 
drivers/gpu/drm/i915/intel_drv.h +2 -0
index 47bc729..c59fa3f 100644
@@ -1341,6 +1341,8 @@ void intel_display_set_init_power(struct drm_i915_private *dev, bool enable);
 /* intel_pm.c */
 void intel_init_clock_gating(struct drm_device *dev);
 void intel_suspend_hw(struct drm_device *dev);
+uint32_t ilk_pipe_pixel_rate(struct drm_device *dev,
+			     struct drm_crtc *crtc);
 int ilk_wm_max_level(const struct drm_device *dev);
 void intel_update_watermarks(struct drm_crtc *crtc);
 void intel_update_sprite_watermarks(struct drm_plane *plane,
drivers/gpu/drm/i915/intel_pm.c +2 -2
index ce1d079..0afeae8 100644
@@ -1434,8 +1434,8 @@ static void i845_update_wm(struct drm_crtc *unused_crtc)
 	I915_WRITE(FW_BLC, fwater_lo);
 }
 
-static uint32_t ilk_pipe_pixel_rate(struct drm_device *dev,
-				    struct drm_crtc *crtc)
+uint32_t ilk_pipe_pixel_rate(struct drm_device *dev,
+			     struct drm_crtc *crtc)
 {
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 	uint32_t pixel_rate;
Signature · 1 line
2.1.0
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

#3 lore raw
Quoted 7 lines · Rodrigo
Quoted 6 lines · Ville Syrjälä
Quoted 4 lines · Rodrigo Vivi

Broadwell Workaround : Do not enable IPS when the pipe pixel rate is greater than
95% of the CDCLK frequency. The pipe pixel rate is the port pixel rate multiplied by the pipe scaler down scale amount.

Quoted 5 lines
Quoted 1 line

Or just merge my patch doing the same thing?

I was trying to make the simple possible since latest one that I was looking at was depending on a series of many patches. It was caching the max cdclk, etc...

Well the latter one is the one we want (well actually we want to go further than that, but have to start somewhere). The only thing blocking the patches is lack of review so the solution seems easy enough to me ;)

Quoted 90 lines

But now I looked again your first one and saw the history there that got merged but it was removed due to unclaimed registers...

Now I see that my patch and your original one aren't so different... I'm sorry...

So I was telling Paulo that with my patch I can't get Unclaimed messages anymore and when double cheking I noticed that runing pm_rpm rte with no patch I get the "Unclaimed register detected before reading register 0x130040"

So I believe your first patch is good to get merged. I believe that "Unclaimed reg" that Paulo saw was something else.

So, back to yours...

Quoted 72 lines
Quoted 71 lines
---
 drivers/gpu/drm/i915/intel_display.c | 9 +++++++++
 drivers/gpu/drm/i915/intel_drv.h     | 2 ++
 drivers/gpu/drm/i915/intel_pm.c      | 4 ++--
 3 files changed, 13 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_display.c +9 -0
index 9d2d6fb..dd8ef51 100644
@@ -112,6 +112,7 @@ static int i9xx_get_refclk(const struct intel_crtc_state *crtc_state,
 			   int num_connectors);
 static void intel_crtc_enable_planes(struct drm_crtc *crtc);
 static void intel_crtc_disable_planes(struct drm_crtc *crtc);
+static int broadwell_get_display_clock_speed(struct drm_device *dev);
 
 static struct intel_encoder *intel_find_encoder(struct intel_connector *connector, int pipe)
 {
@@ -4948,6 +4949,14 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc)
 /* IPS only exists on ULT machines and is tied to pipe A. */
 static bool hsw_crtc_supports_ips(struct intel_crtc *crtc)
 {
+	struct drm_device *dev = crtc->base.dev;
+
+	if (IS_BROADWELL(dev) && ilk_pipe_pixel_rate(dev, &crtc->base) >
+	    broadwell_get_display_clock_speed(dev) * 95/100) {
+		DRM_DEBUG_KMS("IPS avoided because pixel rate is greater than 95 percent of CDCLK\n");
+		return false;
+	}
+
 	return HAS_IPS(crtc->base.dev) && crtc->pipe == PIPE_A;
 }
 
drivers/gpu/drm/i915/intel_drv.h +2 -0
index 47bc729..c59fa3f 100644
@@ -1341,6 +1341,8 @@ void intel_display_set_init_power(struct drm_i915_private *dev, bool enable);
 /* intel_pm.c */
 void intel_init_clock_gating(struct drm_device *dev);
 void intel_suspend_hw(struct drm_device *dev);
+uint32_t ilk_pipe_pixel_rate(struct drm_device *dev,
+			     struct drm_crtc *crtc);
 int ilk_wm_max_level(const struct drm_device *dev);
 void intel_update_watermarks(struct drm_crtc *crtc);
 void intel_update_sprite_watermarks(struct drm_plane *plane,
drivers/gpu/drm/i915/intel_pm.c +2 -2
index ce1d079..0afeae8 100644
@@ -1434,8 +1434,8 @@ static void i845_update_wm(struct drm_crtc *unused_crtc)
 	I915_WRITE(FW_BLC, fwater_lo);
 }
 
-static uint32_t ilk_pipe_pixel_rate(struct drm_device *dev,
-				    struct drm_crtc *crtc)
+uint32_t ilk_pipe_pixel_rate(struct drm_device *dev,
+			     struct drm_crtc *crtc)
 {
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 	uint32_t pixel_rate;
Signature · 6 lines
2.1.0

_______________________________________________
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
#4 lore raw
Quoted 10 lines · Ville Syrjälä
Quoted 9 lines · Rodrigo
Quoted 7 lines · Ville Syrjälä
Quoted 4 lines · Rodrigo Vivi

Broadwell Workaround : Do not enable IPS when the pipe pixel rate is greater than
95% of the CDCLK frequency. The pipe pixel rate is the port pixel rate multiplied by the pipe scaler down scale amount.

Or just merge my patch doing the same thing?

Quoted 7 lines
Quoted 3 lines

I was trying to make the simple possible since latest one that I was looking at was depending on a series of many patches. It was caching the max cdclk, etc...

Well the latter one is the one we want (well actually we want to go further than that, but have to start somewhere). The only thing blocking the patches is lack of review so the solution seems easy enough to me ;)

We need a minimal patch for -fixes+cc: stable since this is blowing up on real-world bdws out there already. Jani?
-Daniel

Quoted 99 lines
Quoted 91 lines

But now I looked again your first one and saw the history there that got merged but it was removed due to unclaimed registers...

Now I see that my patch and your original one aren't so different... I'm sorry...

So I was telling Paulo that with my patch I can't get Unclaimed messages anymore and when double cheking I noticed that runing pm_rpm rte with no patch I get the "Unclaimed register detected before reading register 0x130040"

So I believe your first patch is good to get merged. I believe that "Unclaimed reg" that Paulo saw was something else.

So, back to yours...

Quoted 72 lines
Quoted 71 lines
---
 drivers/gpu/drm/i915/intel_display.c | 9 +++++++++
 drivers/gpu/drm/i915/intel_drv.h     | 2 ++
 drivers/gpu/drm/i915/intel_pm.c      | 4 ++--
 3 files changed, 13 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_display.c +9 -0
index 9d2d6fb..dd8ef51 100644
@@ -112,6 +112,7 @@ static int i9xx_get_refclk(const struct intel_crtc_state *crtc_state,
 			   int num_connectors);
 static void intel_crtc_enable_planes(struct drm_crtc *crtc);
 static void intel_crtc_disable_planes(struct drm_crtc *crtc);
+static int broadwell_get_display_clock_speed(struct drm_device *dev);
 
 static struct intel_encoder *intel_find_encoder(struct intel_connector *connector, int pipe)
 {
@@ -4948,6 +4949,14 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc)
 /* IPS only exists on ULT machines and is tied to pipe A. */
 static bool hsw_crtc_supports_ips(struct intel_crtc *crtc)
 {
+	struct drm_device *dev = crtc->base.dev;
+
+	if (IS_BROADWELL(dev) && ilk_pipe_pixel_rate(dev, &crtc->base) >
+	    broadwell_get_display_clock_speed(dev) * 95/100) {
+		DRM_DEBUG_KMS("IPS avoided because pixel rate is greater than 95 percent of CDCLK\n");
+		return false;
+	}
+
 	return HAS_IPS(crtc->base.dev) && crtc->pipe == PIPE_A;
 }
 
drivers/gpu/drm/i915/intel_drv.h +2 -0
index 47bc729..c59fa3f 100644
@@ -1341,6 +1341,8 @@ void intel_display_set_init_power(struct drm_i915_private *dev, bool enable);
 /* intel_pm.c */
 void intel_init_clock_gating(struct drm_device *dev);
 void intel_suspend_hw(struct drm_device *dev);
+uint32_t ilk_pipe_pixel_rate(struct drm_device *dev,
+			     struct drm_crtc *crtc);
 int ilk_wm_max_level(const struct drm_device *dev);
 void intel_update_watermarks(struct drm_crtc *crtc);
 void intel_update_sprite_watermarks(struct drm_plane *plane,
drivers/gpu/drm/i915/intel_pm.c +2 -2
index ce1d079..0afeae8 100644
@@ -1434,8 +1434,8 @@ static void i845_update_wm(struct drm_crtc *unused_crtc)
 	I915_WRITE(FW_BLC, fwater_lo);
 }
 
-static uint32_t ilk_pipe_pixel_rate(struct drm_device *dev,
-				    struct drm_crtc *crtc)
+uint32_t ilk_pipe_pixel_rate(struct drm_device *dev,
+			     struct drm_crtc *crtc)
 {
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 	uint32_t pixel_rate;
Signature · 6 lines
2.1.0

_______________________________________________
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
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
maintainer
#5 lore raw
Quoted 15 lines · Daniel Vetter
Quoted 14 lines · Ville Syrjälä
Quoted 12 lines · Rodrigo
Quoted 7 lines · Ville Syrjälä
Quoted 4 lines · Rodrigo Vivi

Broadwell Workaround : Do not enable IPS when the pipe pixel rate is greater than
95% of the CDCLK frequency. The pipe pixel rate is the port pixel rate multiplied by the pipe scaler down scale amount.

Or just merge my patch doing the same thing?

I was trying to make the simple possible since latest one that I was looking at was depending on a series of many patches. It was caching the max cdclk, etc...

Quoted 6 lines
Quoted 3 lines

Well the latter one is the one we want (well actually we want to go further than that, but have to start somewhere). The only thing blocking the patches is lack of review so the solution seems easy enough to me ;)

We need a minimal patch for -fixes+cc: stable since this is blowing up on real-world bdws out there already. Jani?

Already?! *gasp*! https://bugs.freedesktop.org/show_bug.cgi?id=83497

Point me at a patch with r-b, t-b and supposedly not regressing, and I'll merge.

BR,
Jani.

Quoted 106 lines

-Daniel

Quoted 99 lines
Quoted 91 lines

But now I looked again your first one and saw the history there that got merged but it was removed due to unclaimed registers...

Now I see that my patch and your original one aren't so different... I'm sorry...

So I was telling Paulo that with my patch I can't get Unclaimed messages anymore and when double cheking I noticed that runing pm_rpm rte with no patch I get the "Unclaimed register detected before reading register 0x130040"

So I believe your first patch is good to get merged. I believe that "Unclaimed reg" that Paulo saw was something else.

So, back to yours...

Quoted 72 lines
Quoted 71 lines
---
 drivers/gpu/drm/i915/intel_display.c | 9 +++++++++
 drivers/gpu/drm/i915/intel_drv.h     | 2 ++
 drivers/gpu/drm/i915/intel_pm.c      | 4 ++--
 3 files changed, 13 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_display.c +9 -0
index 9d2d6fb..dd8ef51 100644
@@ -112,6 +112,7 @@ static int i9xx_get_refclk(const struct intel_crtc_state *crtc_state,
 			   int num_connectors);
 static void intel_crtc_enable_planes(struct drm_crtc *crtc);
 static void intel_crtc_disable_planes(struct drm_crtc *crtc);
+static int broadwell_get_display_clock_speed(struct drm_device *dev);
 
 static struct intel_encoder *intel_find_encoder(struct intel_connector *connector, int pipe)
 {
@@ -4948,6 +4949,14 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc)
 /* IPS only exists on ULT machines and is tied to pipe A. */
 static bool hsw_crtc_supports_ips(struct intel_crtc *crtc)
 {
+	struct drm_device *dev = crtc->base.dev;
+
+	if (IS_BROADWELL(dev) && ilk_pipe_pixel_rate(dev, &crtc->base) >
+	    broadwell_get_display_clock_speed(dev) * 95/100) {
+		DRM_DEBUG_KMS("IPS avoided because pixel rate is greater than 95 percent of CDCLK\n");
+		return false;
+	}
+
 	return HAS_IPS(crtc->base.dev) && crtc->pipe == PIPE_A;
 }
 
drivers/gpu/drm/i915/intel_drv.h +2 -0
index 47bc729..c59fa3f 100644
@@ -1341,6 +1341,8 @@ void intel_display_set_init_power(struct drm_i915_private *dev, bool enable);
 /* intel_pm.c */
 void intel_init_clock_gating(struct drm_device *dev);
 void intel_suspend_hw(struct drm_device *dev);
+uint32_t ilk_pipe_pixel_rate(struct drm_device *dev,
+			     struct drm_crtc *crtc);
 int ilk_wm_max_level(const struct drm_device *dev);
 void intel_update_watermarks(struct drm_crtc *crtc);
 void intel_update_sprite_watermarks(struct drm_plane *plane,
drivers/gpu/drm/i915/intel_pm.c +2 -2
index ce1d079..0afeae8 100644
@@ -1434,8 +1434,8 @@ static void i845_update_wm(struct drm_crtc *unused_crtc)
 	I915_WRITE(FW_BLC, fwater_lo);
 }
 
-static uint32_t ilk_pipe_pixel_rate(struct drm_device *dev,
-				    struct drm_crtc *crtc)
+uint32_t ilk_pipe_pixel_rate(struct drm_device *dev,
+			     struct drm_crtc *crtc)
 {
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 	uint32_t pixel_rate;
Signature · 6 lines
2.1.0

_______________________________________________
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
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#6 lore raw
Quoted 20 lines · Jani Nikula
Quoted 19 lines · Daniel Vetter
Quoted 17 lines · Ville Syrjälä
Quoted 7 lines · Rodrigo
Quoted 6 lines · Ville Syrjälä
Quoted 4 lines · Rodrigo Vivi

Broadwell Workaround : Do not enable IPS when the pipe pixel rate is greater than
95% of the CDCLK frequency. The pipe pixel rate is the port pixel rate multiplied by the pipe scaler down scale amount.

Quoted 5 lines
Quoted 1 line

Or just merge my patch doing the same thing?

I was trying to make the simple possible since latest one that I was looking at was depending on a series of many patches. It was caching the max cdclk, etc...

Well the latter one is the one we want (well actually we want to go further than that, but have to start somewhere). The only thing blocking the patches is lack of review so the solution seems easy enough to me ;)

Quoted 7 lines
Quoted 2 lines

We need a minimal patch for -fixes+cc: stable since this is blowing up on real-world bdws out there already. Jani?

Already?! *gasp*! https://bugs.freedesktop.org/show_bug.cgi?id=83497

Point me at a patch with r-b, t-b and supposedly not regressing, and I'll merge.

The minimal fix is i915.enable_ips=0. But I won't send such a patch.

Quoted 115 lines

BR,
Jani.

Quoted 106 lines

-Daniel

Quoted 99 lines
Quoted 91 lines

But now I looked again your first one and saw the history there that got merged but it was removed due to unclaimed registers...

Now I see that my patch and your original one aren't so different... I'm sorry...

So I was telling Paulo that with my patch I can't get Unclaimed messages anymore and when double cheking I noticed that runing pm_rpm rte with no patch I get the "Unclaimed register detected before reading register 0x130040"

So I believe your first patch is good to get merged. I believe that "Unclaimed reg" that Paulo saw was something else.

So, back to yours...

Quoted 72 lines
Quoted 71 lines
---
 drivers/gpu/drm/i915/intel_display.c | 9 +++++++++
 drivers/gpu/drm/i915/intel_drv.h     | 2 ++
 drivers/gpu/drm/i915/intel_pm.c      | 4 ++--
 3 files changed, 13 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_display.c +9 -0
index 9d2d6fb..dd8ef51 100644
@@ -112,6 +112,7 @@ static int i9xx_get_refclk(const struct intel_crtc_state *crtc_state,
 			   int num_connectors);
 static void intel_crtc_enable_planes(struct drm_crtc *crtc);
 static void intel_crtc_disable_planes(struct drm_crtc *crtc);
+static int broadwell_get_display_clock_speed(struct drm_device *dev);
 
 static struct intel_encoder *intel_find_encoder(struct intel_connector *connector, int pipe)
 {
@@ -4948,6 +4949,14 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc)
 /* IPS only exists on ULT machines and is tied to pipe A. */
 static bool hsw_crtc_supports_ips(struct intel_crtc *crtc)
 {
+	struct drm_device *dev = crtc->base.dev;
+
+	if (IS_BROADWELL(dev) && ilk_pipe_pixel_rate(dev, &crtc->base) >
+	    broadwell_get_display_clock_speed(dev) * 95/100) {
+		DRM_DEBUG_KMS("IPS avoided because pixel rate is greater than 95 percent of CDCLK\n");
+		return false;
+	}
+
 	return HAS_IPS(crtc->base.dev) && crtc->pipe == PIPE_A;
 }
 
drivers/gpu/drm/i915/intel_drv.h +2 -0
index 47bc729..c59fa3f 100644
@@ -1341,6 +1341,8 @@ void intel_display_set_init_power(struct drm_i915_private *dev, bool enable);
 /* intel_pm.c */
 void intel_init_clock_gating(struct drm_device *dev);
 void intel_suspend_hw(struct drm_device *dev);
+uint32_t ilk_pipe_pixel_rate(struct drm_device *dev,
+			     struct drm_crtc *crtc);
 int ilk_wm_max_level(const struct drm_device *dev);
 void intel_update_watermarks(struct drm_crtc *crtc);
 void intel_update_sprite_watermarks(struct drm_plane *plane,
drivers/gpu/drm/i915/intel_pm.c +2 -2
index ce1d079..0afeae8 100644
@@ -1434,8 +1434,8 @@ static void i845_update_wm(struct drm_crtc *unused_crtc)
 	I915_WRITE(FW_BLC, fwater_lo);
 }
 
-static uint32_t ilk_pipe_pixel_rate(struct drm_device *dev,
-				    struct drm_crtc *crtc)
+uint32_t ilk_pipe_pixel_rate(struct drm_device *dev,
+			     struct drm_crtc *crtc)
 {
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 	uint32_t pixel_rate;
Signature · 6 lines
2.1.0

_______________________________________________
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
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#7 lore raw
Quoted 24 lines · Ville Syrjälä
Quoted 23 lines · Jani Nikula
Quoted 21 lines · Daniel Vetter
Quoted 10 lines · Ville Syrjälä
Quoted 9 lines · Rodrigo
Quoted 7 lines · Ville Syrjälä
Quoted 4 lines · Rodrigo Vivi

Broadwell Workaround : Do not enable IPS when the pipe pixel rate is greater than
95% of the CDCLK frequency. The pipe pixel rate is the port pixel rate multiplied by the pipe scaler down scale amount.

Or just merge my patch doing the same thing?

Quoted 7 lines
Quoted 3 lines

I was trying to make the simple possible since latest one that I was looking at was depending on a series of many patches. It was caching the max cdclk, etc...

Well the latter one is the one we want (well actually we want to go further than that, but have to start somewhere). The only thing blocking the patches is lack of review so the solution seems easy enough to me ;)

We need a minimal patch for -fixes+cc: stable since this is blowing up on real-world bdws out there already. Jani?

Quoted 6 lines
Quoted 4 lines

Already?! *gasp*! https://bugs.freedesktop.org/show_bug.cgi?id=83497

Point me at a patch with r-b, t-b and supposedly not regressing, and I'll merge.

The minimal fix is i915.enable_ips=0. But I won't send such a patch.

I'm almost considering this more seriously. The flickering on console isn't caused by this 95% of cdclk but by the other limitation where IPS needs at least one plane enabled while it is on.... There are some cases like on modeset that we shortcut !visible setting DSPCNTRL to 0. At this moment we might have no plane really enabled and ips enabled so it doesn't recover and the flicker starts.
One w/a would be double vblank_waits we have and call disable_ips when setting dspcntrl to 0. This minimized the flickers a lot here for me, but not 100% of the time.

And even worst on 3.14 custom kernel that I was looking at as well where I couldn''t find yet where we are disabling planes without disabling ips...

please let me know if you have any idea...

Quoted 124 lines
Quoted 109 lines

BR,
Jani.

Quoted 102 lines

-Daniel

Quoted 99 lines
Quoted 13 lines

But now I looked again your first one and saw the history there that got merged but it was removed due to unclaimed registers...

Now I see that my patch and your original one aren't so different... I'm sorry...

So I was telling Paulo that with my patch I can't get Unclaimed messages anymore and when double cheking I noticed that runing pm_rpm rte with no patch I get the "Unclaimed register detected before reading register 0x130040"

Quoted 78 lines

So I believe your first patch is good to get merged. I believe that "Unclaimed reg" that Paulo saw was something else.

So, back to yours...

Quoted 72 lines
Quoted 71 lines
---
 drivers/gpu/drm/i915/intel_display.c | 9 +++++++++
 drivers/gpu/drm/i915/intel_drv.h     | 2 ++
 drivers/gpu/drm/i915/intel_pm.c      | 4 ++--
 3 files changed, 13 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_display.c +9 -0
index 9d2d6fb..dd8ef51 100644
@@ -112,6 +112,7 @@ static int i9xx_get_refclk(const struct intel_crtc_state *crtc_state,
                        int num_connectors);
 static void intel_crtc_enable_planes(struct drm_crtc *crtc);
 static void intel_crtc_disable_planes(struct drm_crtc *crtc);
+static int broadwell_get_display_clock_speed(struct drm_device *dev);
 
 static struct intel_encoder *intel_find_encoder(struct intel_connector *connector, int pipe)
 {
@@ -4948,6 +4949,14 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc)
 /* IPS only exists on ULT machines and is tied to pipe A. */
 static bool hsw_crtc_supports_ips(struct intel_crtc *crtc)
 {
+    struct drm_device *dev = crtc->base.dev;
+
+    if (IS_BROADWELL(dev) && ilk_pipe_pixel_rate(dev, &crtc->base) >
+        broadwell_get_display_clock_speed(dev) * 95/100) {
+            DRM_DEBUG_KMS("IPS avoided because pixel rate is greater than 95 percent of CDCLK\n");
+            return false;
+    }
+
     return HAS_IPS(crtc->base.dev) && crtc->pipe == PIPE_A;
 }
 
drivers/gpu/drm/i915/intel_drv.h +2 -0
index 47bc729..c59fa3f 100644
@@ -1341,6 +1341,8 @@ void intel_display_set_init_power(struct drm_i915_private *dev, bool enable);
 /* intel_pm.c */
 void intel_init_clock_gating(struct drm_device *dev);
 void intel_suspend_hw(struct drm_device *dev);
+uint32_t ilk_pipe_pixel_rate(struct drm_device *dev,
+                         struct drm_crtc *crtc);
 int ilk_wm_max_level(const struct drm_device *dev);
 void intel_update_watermarks(struct drm_crtc *crtc);
 void intel_update_sprite_watermarks(struct drm_plane *plane,
drivers/gpu/drm/i915/intel_pm.c +2 -3
index ce1d079..0afeae8 100644
@@ -1434,8 +1434,8 @@ static void i845_update_wm(struct drm_crtc *unused_crtc)
     I915_WRITE(FW_BLC, fwater_lo);
 }
 
-static uint32_t ilk_pipe_pixel_rate(struct drm_device *dev,
-                                struct drm_crtc *crtc)
+uint32_t ilk_pipe_pixel_rate(struct drm_device *dev,
+                         struct drm_crtc *crtc)
 {
     struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
     uint32_t pixel_rate;
--

2.1.0

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

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

Quoted 7 lines
Quoted 4 lines

--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

--
Jani Nikula, Intel Open Source Technology Center

--
Ville Syrjälä
Intel OTC
_______________________________________________
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
Tested-by on v1 1/1
#8 lore raw
In reply to Rodrigo Vivi

Task id: 6445 -------------------------------------Summary-------------------------------------
Platform Delta drm-intel-nightly Series Applied

PNV                                  234/234              234/234
ILK                                  262/262              262/262
SNB                 -1              282/282              281/282
IVB                                  300/300              300/300
BYT                                  254/254              254/254
BDW                                  275/275              275/275

-------------------------------------Detailed-------------------------------------
Platform Test drm-intel-nightly Series Applied
SNB igt@pm_rpm@dpms-mode-unset-non-lpsp DMESG_WARN(18)PASS(1) DMESG_WARN(1)
(dmesg patch applied)WARNING:at_drivers/gpu/drm/i915/intel_uncore.c:#assert_device_not_suspended[i915]()@WARNING:.* at .* assert_device_not_suspended+0x
Note: You need to pay more attention to line start with '*'
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx