Skip to contentSkip to conversation

drm/i915: Fix IPS related flicker

PATCH In review Rodrigo Vivi 9 participants 23 messages May 21, 2015 – Jun 26, 2015 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Rodrigo Vivi

author maintainer
#0 lore raw

PATCH 1/1 drm/i915: Fix IPS related flicker

We cannot let IPS enabled with no plane on the pipe:

BSpec: "IPS cannot be enabled until after at least one plane has been enabled for at least one vertical blank." and "IPS must be disabled while there is still at least one plane enabled on the same pipe as IPS.

However this shortcut path to make primary plane invisible when updating primary plane was leting IPS enabled while there was no other plane enabled on the pipe causing flickerings that we were believing that it was caused by that other restriction where ips cannot be used when pixel rate is greater than 95% of cdclok.

Reference: https://bugs.freedesktop.org/show_bug.cgi?id=85583

Cc Joe Konno <[email protected]>
Cc Paulo Zanoni <[email protected]>
---
 drivers/gpu/drm/i915/intel_display.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
drivers/gpu/drm/i915/intel_display.c +13 -0
index 9d2d6fb..5519d56 100644
@@ -2789,6 +2789,19 @@ static void ironlake_update_primary_plane(struct drm_crtc *crtc,
 	int pixel_size;
 
 	if (!visible || !fb) {
+		/*
+		 * This shortcut path disables the primary plane making
+		 * IPS really sad and lost when it is enabled alone with no
+		 * plane around on the pipe. So, for now it is safe to disable
+		 * IPS here.
+		 /
+		 /*
+		 * FIXME: Any other plane enabled should be enough so it would
+		 * be better to check if there is really no sprite or
+		 * cursor around.
+		 */
+		hsw_disable_ips(intel_crtc);
+
 		I915_WRITE(reg, 0);
 		I915_WRITE(DSPSURF(plane), 0);
 		POSTING_READ(reg);
Signature · 6 lines
2.1.0

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

We cannot let IPS enabled with no plane on the pipe:

BSpec: "IPS cannot be enabled until after at least one plane has been enabled for at least one vertical blank." and "IPS must be disabled while there is still at least one plane enabled on the same pipe as IPS.

However this shortcut path to make primary plane invisible when updating primary plane was leting IPS enabled while there was no other plane enabled on the pipe causing flickerings that we were believing that it was caused by that other restriction where ips cannot be used when pixel rate is greater than 95% of cdclok.

Quoted 4 lines

Reference: https://bugs.freedesktop.org/show_bug.cgi?id=85583

Cc Joe Konno <[email protected]>
Cc Paulo Zanoni <[email protected]>

Broken since forever or regression? cc: stable? Issue on bdw only or also hsw? Please help out your poor clueless maintainers ;-)

Thanks, Daniel

Quoted 35 lines
---
 drivers/gpu/drm/i915/intel_display.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
drivers/gpu/drm/i915/intel_display.c +13 -0
index 9d2d6fb..5519d56 100644
@@ -2789,6 +2789,19 @@ static void ironlake_update_primary_plane(struct drm_crtc *crtc,
 	int pixel_size;
 
 	if (!visible || !fb) {
+		/*
+		 * This shortcut path disables the primary plane making
+		 * IPS really sad and lost when it is enabled alone with no
+		 * plane around on the pipe. So, for now it is safe to disable
+		 * IPS here.
+		 /
+		 /*
+		 * FIXME: Any other plane enabled should be enough so it would
+		 * be better to check if there is really no sprite or
+		 * cursor around.
+		 */
+		hsw_disable_ips(intel_crtc);
+
 		I915_WRITE(reg, 0);
 		I915_WRITE(DSPSURF(plane), 0);
 		POSTING_READ(reg);
Signature · 6 lines
2.1.0

_______________________________________________
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
#2 lore raw
Quoted 14 lines · Daniel Vetter
Quoted 13 lines · Rodrigo Vivi

We cannot let IPS enabled with no plane on the pipe:

BSpec: "IPS cannot be enabled until after at least one plane has been enabled for at least one vertical blank." and "IPS must be disabled while there is still at least one plane enabled on the same pipe as IPS.

However this shortcut path to make primary plane invisible when updating primary plane was leting IPS enabled while there was no other plane enabled on the pipe causing flickerings that we were believing that it was caused by that other restriction where ips cannot be used when pixel rate is greater than 95% of cdclok.

Quoted 6 lines
Quoted 4 lines

Reference: https://bugs.freedesktop.org/show_bug.cgi?id=85583

Cc Joe Konno <[email protected]>
Cc Paulo Zanoni <[email protected]>

Broken since forever or regression?

Not sure, but probably a regression since I was looking to a 3.14 based kernel here and didn't find this shortcut setting DSPCNTRL to 0 on update_primary_plane.

Quoted 1 line
cc stable?

Yes, I should've added, sorry!

Quoted 2 lines

Issue on bdw only or also
hsw?

Also on HSW since this limitation is also documented on HSW.

Quoted 1 line

Please help out your poor clueless maintainers ;-)

Sorry for my poor comments...

Quoted 14 lines

Thanks, Daniel

Quoted 11 lines
---
 drivers/gpu/drm/i915/intel_display.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 9d2d6fb..5519d56 100644
@@ -2789,6 +2789,19 @@ static void ironlake_update_primary_plane(struct drm_crtc *crtc,
 	int pixel_size;
 
Quoted 7 lines

drivers/gpu/drm/i915/intel_display.c static void ironlake_update_primary_plane(struct drm_crtc *crtc, · line 2797

Quoted 7 lines
drivers/gpu/drm/i915/intel_display.c +6 -0
 	if (!visible || !fb) {
+		/*
+		 * This shortcut path disables the primary plane making
+		 * IPS really sad and lost when it is enabled alone with no
+		 * plane around on the pipe. So, for now it is safe to disable
+		 * IPS here.
+		 /

Bikesheding my on patch: I forgot a "*" here above

Quoted 4 lines

drivers/gpu/drm/i915/intel_display.c static void ironlake_update_primary_plane(struct drm_crtc *crtc, · line 2801

Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +4 -0
+		 /*
+		 * FIXME: Any other plane enabled should be enough so it would
+		 * be better to check if there is really no sprite or
+		 * cursor around.

Bikesheding my on patch: I'm not sure if we should add this FIXME here...

Quoted 9 lines
Quoted 9 lines
drivers/gpu/drm/i915/intel_display.c +3 -0
+		 */
+		hsw_disable_ips(intel_crtc);
+
 		I915_WRITE(reg, 0);
 		I915_WRITE(DSPSURF(plane), 0);
 		POSTING_READ(reg);
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
In reply to Rodrigo Vivi
Quoted 32 lines · Rodrigo Vivi

We cannot let IPS enabled with no plane on the pipe:

BSpec: "IPS cannot be enabled until after at least one plane has been enabled for at least one vertical blank." and "IPS must be disabled while there is still at least one plane enabled on the same pipe as IPS.

However this shortcut path to make primary plane invisible when updating primary plane was leting IPS enabled while there was no other plane enabled on the pipe causing flickerings that we were believing that it was caused by that other restriction where ips cannot be used when pixel rate is greater than 95% of cdclok.

Reference: https://bugs.freedesktop.org/show_bug.cgi?id=85583

Cc Joe Konno <[email protected]>
Cc Paulo Zanoni <[email protected]>
---
 drivers/gpu/drm/i915/intel_display.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
drivers/gpu/drm/i915/intel_display.c +3 -0
index 9d2d6fb..5519d56 100644
@@ -2789,6 +2789,19 @@ static void ironlake_update_primary_plane(struct drm_crtc *crtc,
 	int pixel_size;
 
 	if (!visible || !fb) {
+		/*
+		 * This shortcut path disables the primary plane making
+		 * IPS really sad and lost when it is enabled alone with no

drivers/gpu/drm/i915/intel_display.c static void ironlake_update_primary_plane(struct drm_crtc *crtc, · line 2804

Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +10 -0
+		 * plane around on the pipe. So, for now it is safe to disable
+		 * IPS here.
+		 /
+		 /*
+		 * FIXME: Any other plane enabled should be enough so it would
+		 * be better to check if there is really no sprite or
+		 * cursor around.
+		 */
+		hsw_disable_ips(intel_crtc);
+

This isn't really the right place for it. It should be called by higher level functions outside of the atomic critical section. I suppose we're missing it from some legacy path.

Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
 		I915_WRITE(reg, 0);
 		I915_WRITE(DSPSURF(plane), 0);
 		POSTING_READ(reg);
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
#4 lore raw

PATCH 1/1 drm/i915: Fix IPS related flicker

We cannot let IPS enabled with no plane on the pipe:

BSpec: "IPS cannot be enabled until after at least one plane has been enabled for at least one vertical blank." and "IPS must be disabled while there is still at least one plane enabled on the same pipe as IPS." This restriction apply to HSW and BDW.

However a shortcut path on update primary plane function to make primary plane invisible by setting DSPCTRL to 0 was leting IPS enabled while there was no
other plane enabled on the pipe causing flickerings that we were believing that it was caused by that other restriction where ips cannot be used when pixel rate is greater than 95% of cdclok.

v2: Don't mess with Atomic path as pointed out by Ville.

Reference: https://bugs.freedesktop.org/show_bug.cgi?id=85583

Cc Ville Syrjälä <[email protected]>
Cc Paulo Zanoni <[email protected]>
---
 drivers/gpu/drm/i915/intel_display.c | 13 +++++++++++++
 drivers/gpu/drm/i915/intel_drv.h     |  1 +
 2 files changed, 14 insertions(+)
drivers/gpu/drm/i915/intel_display.c +13 -0
index 4e3f302..5a6b17b 100644
@@ -13309,6 +13309,16 @@ intel_check_primary_plane(struct drm_plane *plane,
 				intel_crtc->atomic.wait_vblank = true;
 		}
 
+		/*
+		 * FIXME: Actually if we will still have any other plane enabled
+		 * on the pipe we could let IPS enabled still, but for
+		 * now lets consider that when we make primary invisible
+		 * by setting DSPCNTR to 0 on update_primary_plane function
+		 * IPS needs to be disable.
+		 */
+		if (!state->visible || !fb)
+			intel_crtc->atomic.disable_ips = true;
+
 		intel_crtc->atomic.fb_bits |=
 			INTEL_FRONTBUFFER_PRIMARY(intel_crtc->pipe);
 
@@ -13406,6 +13416,9 @@ static void intel_begin_crtc_commit(struct drm_crtc *crtc)
 	if (intel_crtc->atomic.disable_fbc)
 		intel_fbc_disable(dev);
 
+	if (intel_crtc->atomic.disable_ips)
+		hsw_disable_ips(intel_crtc);
+
 	if (intel_crtc->atomic.pre_disable_primary)
 		intel_pre_disable_primary(crtc);
 
drivers/gpu/drm/i915/intel_drv.h +1 -0
index 2afb31a..1059283 100644
@@ -485,6 +485,7 @@ struct intel_crtc_atomic_commit {
 	/* Sleepable operations to perform before commit */
 	bool wait_for_flips;
 	bool disable_fbc;
+	bool disable_ips;
 	bool pre_disable_primary;
 	bool update_wm;
 	unsigned disabled_planes;
Signature · 6 lines
2.1.0

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

We cannot let IPS enabled with no plane on the pipe:

BSpec: "IPS cannot be enabled until after at least one plane has been enabled for at least one vertical blank." and "IPS must be disabled while there is still at least one plane enabled on the same pipe as IPS." This restriction apply to HSW and BDW.

However a shortcut path on update primary plane function to make primary plane invisible by setting DSPCTRL to 0 was leting IPS enabled while there was no
other plane enabled on the pipe causing flickerings that we were believing that it was caused by that other restriction where ips cannot be used when pixel rate is greater than 95% of cdclok.

v2: Don't mess with Atomic path as pointed out by Ville.

Reference: https://bugs.freedesktop.org/show_bug.cgi?id=85583

Cc Ville Syrjälä <[email protected]>
Cc Paulo Zanoni <[email protected]>
---
 drivers/gpu/drm/i915/intel_display.c | 13 +++++++++++++
 drivers/gpu/drm/i915/intel_drv.h     |  1 +
 2 files changed, 14 insertions(+)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 4e3f302..5a6b17b 100644
@@ -13309,6 +13309,16 @@ intel_check_primary_plane(struct drm_plane *plane,
 				intel_crtc->atomic.wait_vblank = true;
 		}
 

drivers/gpu/drm/i915/intel_display.c intel_check_primary_plane(struct drm_plane *plane, · line 13321

Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +10 -0
+		/*
+		 * FIXME: Actually if we will still have any other plane enabled
+		 * on the pipe we could let IPS enabled still, but for
+		 * now lets consider that when we make primary invisible
+		 * by setting DSPCNTR to 0 on update_primary_plane function
+		 * IPS needs to be disable.
+		 */
+		if (!state->visible || !fb)
+			intel_crtc->atomic.disable_ips = true;
+

How could it be visible without an fb?

drivers/gpu/drm/i915/intel_display.c static void intel_begin_crtc_commit(struct drm_crtc *crtc) · line 13423

Quoted 12 lines
drivers/gpu/drm/i915/intel_display.c +3 -0
 		intel_crtc->atomic.fb_bits |=
 			INTEL_FRONTBUFFER_PRIMARY(intel_crtc->pipe);
 
@@ -13406,6 +13416,9 @@ static void intel_begin_crtc_commit(struct drm_crtc *crtc)
 	if (intel_crtc->atomic.disable_fbc)
 		intel_fbc_disable(dev);
 
+	if (intel_crtc->atomic.disable_ips)
+		hsw_disable_ips(intel_crtc);
+
 	if (intel_crtc->atomic.pre_disable_primary)
 		intel_pre_disable_primary(crtc);

intel_pre_disable_primary() would already disable IPS. Except no one sets .pre_disable_primary=true. OTOH that thing mostly seems to do stuff that has nothing to do with the primary plane (cxsr disable, fifo underrun reporting disable on gen2), so I don't think we want to use that.

In any case we should really have the IPS state as part of the crtc state. These global disable_foo things should just be killed IMO. Hmm, except to do this properly we'd then need to track the hw IPS state separately somewhere.

I guess we can just go with this for now. At least it's not really making things worse, so (maybe with the !fb check dropped):

Quoted 15 lines
drivers/gpu/drm/i915/intel_drv.h +1 -0
index 2afb31a..1059283 100644
@@ -485,6 +485,7 @@ struct intel_crtc_atomic_commit {
 	/* Sleepable operations to perform before commit */
 	bool wait_for_flips;
 	bool disable_fbc;
+	bool disable_ips;
 	bool pre_disable_primary;
 	bool update_wm;
 	unsigned disabled_planes;
Signature · 1 line
2.1.0
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

A message that is not in the archive (sent off-list or not yet received): CABVU7+vRFgtc8GYZ+vMPZT3YcYBUKdF5wd_N2MYy4koyLdVoUg@mail.gmail.com

#7 lore raw

PATCH 1/1 drm/i915: Fix IPS related flicker

I just noticed that I had forgotten to reply-all...

Jani, would you consider merge this fix with the explanation above related to Ville's question?

or do you want/need any action here?

Thanks,
Rodrigo.

---------- Forwarded message ----------
From: Rodrigo Vivi <[email protected]>
Date: Fri, May 29, 2015 at 9:45 AM
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Fix IPS related flicker
To: Ville Syrjälä <[email protected]>

Quoted 34 lines · Ville Syrjälä
Quoted 33 lines · Rodrigo Vivi

We cannot let IPS enabled with no plane on the pipe:

BSpec: "IPS cannot be enabled until after at least one plane has been enabled for at least one vertical blank." and "IPS must be disabled while there is still at least one plane enabled on the same pipe as IPS." This restriction apply to HSW and BDW.

However a shortcut path on update primary plane function to make primary plane invisible by setting DSPCTRL to 0 was leting IPS enabled while there was no
other plane enabled on the pipe causing flickerings that we were believing that it was caused by that other restriction where ips cannot be used when pixel rate is greater than 95% of cdclok.

v2: Don't mess with Atomic path as pointed out by Ville.

Reference: https://bugs.freedesktop.org/show_bug.cgi?id=85583

Cc Ville Syrjälä <[email protected]>
Cc Paulo Zanoni <[email protected]>
---
 drivers/gpu/drm/i915/intel_display.c | 13 +++++++++++++
 drivers/gpu/drm/i915/intel_drv.h     |  1 +
 2 files changed, 14 insertions(+)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 4e3f302..5a6b17b 100644
@@ -13309,6 +13309,16 @@ intel_check_primary_plane(struct drm_plane *plane,
                              intel_crtc->atomic.wait_vblank = true;
              }
 
Quoted 12 lines

drivers/gpu/drm/i915/intel_display.c intel_check_primary_plane(struct drm_plane *plane, · line 13321

Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +10 -0
+             /*
+              * FIXME: Actually if we will still have any other plane enabled
+              * on the pipe we could let IPS enabled still, but for
+              * now lets consider that when we make primary invisible
+              * by setting DSPCNTR to 0 on update_primary_plane function
+              * IPS needs to be disable.
+              */
+             if (!state->visible || !fb)
+                     intel_crtc->atomic.disable_ips = true;
+

How could it be visible without an fb?

I don't like this !fb here as well, but I just tried to keep exactly same if statement that makes I915_WRITE(DSPCNTRL, 0) on update primary plane func...

Quoted 20 lines

drivers/gpu/drm/i915/intel_display.c static void intel_begin_crtc_commit(struct drm_crtc *crtc) · line 13423

Quoted 13 lines
drivers/gpu/drm/i915/intel_display.c +3 -0
              intel_crtc->atomic.fb_bits |=
                      INTEL_FRONTBUFFER_PRIMARY(intel_crtc->pipe);
 
@@ -13406,6 +13416,9 @@ static void intel_begin_crtc_commit(struct drm_crtc *crtc)
      if (intel_crtc->atomic.disable_fbc)
              intel_fbc_disable(dev);
 
+     if (intel_crtc->atomic.disable_ips)
+             hsw_disable_ips(intel_crtc);
+
      if (intel_crtc->atomic.pre_disable_primary)
              intel_pre_disable_primary(crtc);

intel_pre_disable_primary() would already disable IPS. Except no one sets .pre_disable_primary=true. OTOH that thing mostly seems to do stuff that has nothing to do with the primary plane (cxsr disable, fifo underrun reporting disable on gen2), so I don't think we want to use that.

Quoted 4 lines

In any case we should really have the IPS state as part of the crtc state. These global disable_foo things should just be killed IMO. Hmm, except to do this properly we'd then need to track the hw IPS state separately somewhere.

agree.

Quoted 4 lines

I guess we can just go with this for now. At least it's not really making things worse, so (maybe with the !fb check dropped):

Thanks

Quoted 17 lines
Quoted 15 lines
drivers/gpu/drm/i915/intel_drv.h +1 -1
index 2afb31a..1059283 100644
@@ -485,6 +485,7 @@ struct intel_crtc_atomic_commit {
      /* Sleepable operations to perform before commit */
      bool wait_for_flips;
      bool disable_fbc;
+     bool disable_ips;
      bool pre_disable_primary;
      bool update_wm;
      unsigned disabled_planes;
--
Quoted 1 line

2.1.0

Quoted 7 lines

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

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

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
maintainer
#8 lore raw
Quoted 6 lines · Rodrigo Vivi

I just noticed that I had forgotten to reply-all...

Jani, would you consider merge this fix with the explanation above related to Ville's question?

or do you want/need any action here?

Ville's question, I'd like Ville's ack on it.

BR,
Jani.

Quoted 134 lines

Thanks,
Rodrigo.

---------- Forwarded message ----------
From: Rodrigo Vivi <[email protected]>
Date: Fri, May 29, 2015 at 9:45 AM
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Fix IPS related flicker
To: Ville Syrjälä <[email protected]>

Quoted 34 lines · Ville Syrjälä
Quoted 33 lines · Rodrigo Vivi

We cannot let IPS enabled with no plane on the pipe:

BSpec: "IPS cannot be enabled until after at least one plane has been enabled for at least one vertical blank." and "IPS must be disabled while there is still at least one plane enabled on the same pipe as IPS." This restriction apply to HSW and BDW.

However a shortcut path on update primary plane function to make primary plane invisible by setting DSPCTRL to 0 was leting IPS enabled while there was no
other plane enabled on the pipe causing flickerings that we were believing that it was caused by that other restriction where ips cannot be used when pixel rate is greater than 95% of cdclok.

v2: Don't mess with Atomic path as pointed out by Ville.

Reference: https://bugs.freedesktop.org/show_bug.cgi?id=85583

Cc Ville Syrjälä <[email protected]>
Cc Paulo Zanoni <[email protected]>
---
 drivers/gpu/drm/i915/intel_display.c | 13 +++++++++++++
 drivers/gpu/drm/i915/intel_drv.h     |  1 +
 2 files changed, 14 insertions(+)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 4e3f302..5a6b17b 100644
@@ -13309,6 +13309,16 @@ intel_check_primary_plane(struct drm_plane *plane,
                              intel_crtc->atomic.wait_vblank = true;
              }
 
Quoted 12 lines

drivers/gpu/drm/i915/intel_display.c intel_check_primary_plane(struct drm_plane *plane, · line 13321

Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +10 -0
+             /*
+              * FIXME: Actually if we will still have any other plane enabled
+              * on the pipe we could let IPS enabled still, but for
+              * now lets consider that when we make primary invisible
+              * by setting DSPCNTR to 0 on update_primary_plane function
+              * IPS needs to be disable.
+              */
+             if (!state->visible || !fb)
+                     intel_crtc->atomic.disable_ips = true;
+

How could it be visible without an fb?

I don't like this !fb here as well, but I just tried to keep exactly same if statement that makes I915_WRITE(DSPCNTRL, 0) on update primary plane func...

Quoted 20 lines

drivers/gpu/drm/i915/intel_display.c static void intel_begin_crtc_commit(struct drm_crtc *crtc) · line 13423

Quoted 13 lines
drivers/gpu/drm/i915/intel_display.c +3 -0
              intel_crtc->atomic.fb_bits |=
                      INTEL_FRONTBUFFER_PRIMARY(intel_crtc->pipe);
 
@@ -13406,6 +13416,9 @@ static void intel_begin_crtc_commit(struct drm_crtc *crtc)
      if (intel_crtc->atomic.disable_fbc)
              intel_fbc_disable(dev);
 
+     if (intel_crtc->atomic.disable_ips)
+             hsw_disable_ips(intel_crtc);
+
      if (intel_crtc->atomic.pre_disable_primary)
              intel_pre_disable_primary(crtc);

intel_pre_disable_primary() would already disable IPS. Except no one sets .pre_disable_primary=true. OTOH that thing mostly seems to do stuff that has nothing to do with the primary plane (cxsr disable, fifo underrun reporting disable on gen2), so I don't think we want to use that.

Quoted 4 lines

In any case we should really have the IPS state as part of the crtc state. These global disable_foo things should just be killed IMO. Hmm, except to do this properly we'd then need to track the hw IPS state separately somewhere.

agree.

Quoted 4 lines

I guess we can just go with this for now. At least it's not really making things worse, so (maybe with the !fb check dropped):

Thanks

Quoted 17 lines
Quoted 15 lines
drivers/gpu/drm/i915/intel_drv.h +1 -1
index 2afb31a..1059283 100644
@@ -485,6 +485,7 @@ struct intel_crtc_atomic_commit {
      /* Sleepable operations to perform before commit */
      bool wait_for_flips;
      bool disable_fbc;
+     bool disable_ips;
      bool pre_disable_primary;
      bool update_wm;
      unsigned disabled_planes;
--
Quoted 1 line

2.1.0

Quoted 7 lines

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

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

Signature · 2 lines
Rodrigo Vivi
Blog: http://blog.vivi.eng.br
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#9 lore raw
Quoted 9 lines · Jani Nikula
Quoted 6 lines · Rodrigo Vivi

I just noticed that I had forgotten to reply-all...

Jani, would you consider merge this fix with the explanation above related to Ville's question?

or do you want/need any action here?

Ville's question, I'd like Ville's ack on it.

It's good enough for me. This part of the driver is a quite a mess anyway currently, so doesn't matter too much what we stick in there.

Quoted 146 lines

BR,
Jani.

Quoted 134 lines

Thanks,
Rodrigo.

---------- Forwarded message ----------
From: Rodrigo Vivi <[email protected]>
Date: Fri, May 29, 2015 at 9:45 AM
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Fix IPS related flicker
To: Ville Syrjälä <[email protected]>

Quoted 34 lines · Ville Syrjälä
Quoted 33 lines · Rodrigo Vivi

We cannot let IPS enabled with no plane on the pipe:

BSpec: "IPS cannot be enabled until after at least one plane has been enabled for at least one vertical blank." and "IPS must be disabled while there is still at least one plane enabled on the same pipe as IPS." This restriction apply to HSW and BDW.

However a shortcut path on update primary plane function to make primary plane invisible by setting DSPCTRL to 0 was leting IPS enabled while there was no
other plane enabled on the pipe causing flickerings that we were believing that it was caused by that other restriction where ips cannot be used when pixel rate is greater than 95% of cdclok.

v2: Don't mess with Atomic path as pointed out by Ville.

Reference: https://bugs.freedesktop.org/show_bug.cgi?id=85583

Cc Ville Syrjälä <[email protected]>
Cc Paulo Zanoni <[email protected]>
---
 drivers/gpu/drm/i915/intel_display.c | 13 +++++++++++++
 drivers/gpu/drm/i915/intel_drv.h     |  1 +
 2 files changed, 14 insertions(+)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 4e3f302..5a6b17b 100644
@@ -13309,6 +13309,16 @@ intel_check_primary_plane(struct drm_plane *plane,
                              intel_crtc->atomic.wait_vblank = true;
              }
 
Quoted 12 lines

drivers/gpu/drm/i915/intel_display.c intel_check_primary_plane(struct drm_plane *plane, · line 13321

Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +10 -0
+             /*
+              * FIXME: Actually if we will still have any other plane enabled
+              * on the pipe we could let IPS enabled still, but for
+              * now lets consider that when we make primary invisible
+              * by setting DSPCNTR to 0 on update_primary_plane function
+              * IPS needs to be disable.
+              */
+             if (!state->visible || !fb)
+                     intel_crtc->atomic.disable_ips = true;
+

How could it be visible without an fb?

I don't like this !fb here as well, but I just tried to keep exactly same if statement that makes I915_WRITE(DSPCNTRL, 0) on update primary plane func...

Quoted 20 lines

drivers/gpu/drm/i915/intel_display.c static void intel_begin_crtc_commit(struct drm_crtc *crtc) · line 13423

Quoted 13 lines
drivers/gpu/drm/i915/intel_display.c +3 -0
              intel_crtc->atomic.fb_bits |=
                      INTEL_FRONTBUFFER_PRIMARY(intel_crtc->pipe);
 
@@ -13406,6 +13416,9 @@ static void intel_begin_crtc_commit(struct drm_crtc *crtc)
      if (intel_crtc->atomic.disable_fbc)
              intel_fbc_disable(dev);
 
+     if (intel_crtc->atomic.disable_ips)
+             hsw_disable_ips(intel_crtc);
+
      if (intel_crtc->atomic.pre_disable_primary)
              intel_pre_disable_primary(crtc);

intel_pre_disable_primary() would already disable IPS. Except no one sets .pre_disable_primary=true. OTOH that thing mostly seems to do stuff that has nothing to do with the primary plane (cxsr disable, fifo underrun reporting disable on gen2), so I don't think we want to use that.

Quoted 4 lines

In any case we should really have the IPS state as part of the crtc state. These global disable_foo things should just be killed IMO. Hmm, except to do this properly we'd then need to track the hw IPS state separately somewhere.

agree.

Quoted 4 lines

I guess we can just go with this for now. At least it's not really making things worse, so (maybe with the !fb check dropped):

Thanks

Quoted 17 lines
Quoted 15 lines
drivers/gpu/drm/i915/intel_drv.h +1 -1
index 2afb31a..1059283 100644
@@ -485,6 +485,7 @@ struct intel_crtc_atomic_commit {
      /* Sleepable operations to perform before commit */
      bool wait_for_flips;
      bool disable_fbc;
+     bool disable_ips;
      bool pre_disable_primary;
      bool update_wm;
      unsigned disabled_planes;
--
Quoted 1 line

2.1.0

Quoted 7 lines

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

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

Signature · 2 lines
Rodrigo Vivi
Blog: http://blog.vivi.eng.br
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
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
#10 lore raw
Quoted 7 lines · Ville Syrjälä
Quoted 6 lines · Jani Nikula
Quoted 5 lines · Rodrigo Vivi

I just noticed that I had forgotten to reply-all...

Jani, would you consider merge this fix with the explanation above related to Ville's question?

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

or do you want/need any action here?

Ville's question, I'd like Ville's ack on it.

It's good enough for me. This part of the driver is a quite a mess anyway currently, so doesn't matter too much what we stick in there.

Ping. Seems like this still isn't merged. Does it need more work or did it just fall through the cracks?

Thanks,
Ander

Quoted 141 lines
Quoted 141 lines

BR,
Jani.

Quoted 134 lines

Thanks,
Rodrigo.

---------- Forwarded message ----------
From: Rodrigo Vivi <[email protected]>
Date: Fri, May 29, 2015 at 9:45 AM
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Fix IPS related flicker
To: Ville Syrjälä <[email protected]>

Quoted 34 lines · Ville Syrjälä
Quoted 33 lines · Rodrigo Vivi

We cannot let IPS enabled with no plane on the pipe:

BSpec: "IPS cannot be enabled until after at least one plane has been enabled for at least one vertical blank." and "IPS must be disabled while there is still at least one plane enabled on the same pipe as IPS." This restriction apply to HSW and BDW.

However a shortcut path on update primary plane function to make primary plane invisible by setting DSPCTRL to 0 was leting IPS enabled while there was no
other plane enabled on the pipe causing flickerings that we were believing that it was caused by that other restriction where ips cannot be used when pixel rate is greater than 95% of cdclok.

v2: Don't mess with Atomic path as pointed out by Ville.

Reference: https://bugs.freedesktop.org/show_bug.cgi?id=85583

Cc Ville Syrjälä <[email protected]>
Cc Paulo Zanoni <[email protected]>
---
 drivers/gpu/drm/i915/intel_display.c | 13 +++++++++++++
 drivers/gpu/drm/i915/intel_drv.h     |  1 +
 2 files changed, 14 insertions(+)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 4e3f302..5a6b17b 100644
@@ -13309,6 +13309,16 @@ intel_check_primary_plane(struct drm_plane *plane,
                              intel_crtc->atomic.wait_vblank = true;
              }
 
Quoted 12 lines

drivers/gpu/drm/i915/intel_display.c intel_check_primary_plane(struct drm_plane *plane, · line 13321

Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +10 -0
+             /*
+              * FIXME: Actually if we will still have any other plane enabled
+              * on the pipe we could let IPS enabled still, but for
+              * now lets consider that when we make primary invisible
+              * by setting DSPCNTR to 0 on update_primary_plane function
+              * IPS needs to be disable.
+              */
+             if (!state->visible || !fb)
+                     intel_crtc->atomic.disable_ips = true;
+

How could it be visible without an fb?

I don't like this !fb here as well, but I just tried to keep exactly same if statement that makes I915_WRITE(DSPCNTRL, 0) on update primary plane func...

Quoted 20 lines

drivers/gpu/drm/i915/intel_display.c static void intel_begin_crtc_commit(struct drm_crtc *crtc) · line 13423

Quoted 13 lines
drivers/gpu/drm/i915/intel_display.c +3 -0
              intel_crtc->atomic.fb_bits |=
                      INTEL_FRONTBUFFER_PRIMARY(intel_crtc->pipe);
 
@@ -13406,6 +13416,9 @@ static void intel_begin_crtc_commit(struct drm_crtc *crtc)
      if (intel_crtc->atomic.disable_fbc)
              intel_fbc_disable(dev);
 
+     if (intel_crtc->atomic.disable_ips)
+             hsw_disable_ips(intel_crtc);
+
      if (intel_crtc->atomic.pre_disable_primary)
              intel_pre_disable_primary(crtc);

intel_pre_disable_primary() would already disable IPS. Except no one sets .pre_disable_primary=true. OTOH that thing mostly seems to do stuff that has nothing to do with the primary plane (cxsr disable, fifo underrun reporting disable on gen2), so I don't think we want to use that.

Quoted 4 lines

In any case we should really have the IPS state as part of the crtc state. These global disable_foo things should just be killed IMO. Hmm, except to do this properly we'd then need to track the hw IPS state separately somewhere.

agree.

Quoted 4 lines

I guess we can just go with this for now. At least it's not really making things worse, so (maybe with the !fb check dropped):

Thanks

Quoted 17 lines
Quoted 15 lines
drivers/gpu/drm/i915/intel_drv.h +1 -1
index 2afb31a..1059283 100644
@@ -485,6 +485,7 @@ struct intel_crtc_atomic_commit {
      /* Sleepable operations to perform before commit */
      bool wait_for_flips;
      bool disable_fbc;
+     bool disable_ips;
      bool pre_disable_primary;
      bool update_wm;
      unsigned disabled_planes;
--
Quoted 1 line

2.1.0

Quoted 7 lines

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

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

Signature · 2 lines
Rodrigo Vivi
Blog: http://blog.vivi.eng.br
Quoted 7 lines
Quoted 6 lines
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
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

maintainer
#11 lore raw
Quoted 10 lines · Ander Conselvan De Oliveira
Quoted 9 lines · Ville Syrjälä
Quoted 8 lines · Jani Nikula
Quoted 6 lines · Rodrigo Vivi

I just noticed that I had forgotten to reply-all...

Jani, would you consider merge this fix with the explanation above related to Ville's question?

or do you want/need any action here?

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Ville's question, I'd like Ville's ack on it.

It's good enough for me. This part of the driver is a quite a mess anyway currently, so doesn't matter too much what we stick in there.

Ping. Seems like this still isn't merged. Does it need more work or did it just fall through the cracks?

It fell between the cracks. I know the world isn't black and white, but it doesn't help the maintainers when review is some shade of grey.

I've pushed this to drm-intel-next-fixes for now, but it has missed the train for both the v4.1 release and the main drm-next feature pull request for the v4.2 merge window. I expect this to land upstream in v4.2-rc2, unless there's an additional drm-next pull request during the merge window. I've added cc: stable.

Thanks for the patch, and I guess the review was, uh, "good enough for me" now... :p

BR,
Jani.

Quoted 154 lines

Thanks,
Ander

Quoted 148 lines
Quoted 147 lines

BR,
Jani.

Quoted 134 lines

Thanks,
Rodrigo.

---------- Forwarded message ----------
From: Rodrigo Vivi <[email protected]>
Date: Fri, May 29, 2015 at 9:45 AM
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Fix IPS related flicker
To: Ville Syrjälä <[email protected]>

Quoted 34 lines · Ville Syrjälä
Quoted 33 lines · Rodrigo Vivi

We cannot let IPS enabled with no plane on the pipe:

BSpec: "IPS cannot be enabled until after at least one plane has been enabled for at least one vertical blank." and "IPS must be disabled while there is still at least one plane enabled on the same pipe as IPS." This restriction apply to HSW and BDW.

However a shortcut path on update primary plane function to make primary plane invisible by setting DSPCTRL to 0 was leting IPS enabled while there was no
other plane enabled on the pipe causing flickerings that we were believing that it was caused by that other restriction where ips cannot be used when pixel rate is greater than 95% of cdclok.

v2: Don't mess with Atomic path as pointed out by Ville.

Reference: https://bugs.freedesktop.org/show_bug.cgi?id=85583

Cc Ville Syrjälä <[email protected]>
Cc Paulo Zanoni <[email protected]>
---
 drivers/gpu/drm/i915/intel_display.c | 13 +++++++++++++
 drivers/gpu/drm/i915/intel_drv.h     |  1 +
 2 files changed, 14 insertions(+)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 4e3f302..5a6b17b 100644
@@ -13309,6 +13309,16 @@ intel_check_primary_plane(struct drm_plane *plane,
                              intel_crtc->atomic.wait_vblank = true;
              }
 
Quoted 12 lines

drivers/gpu/drm/i915/intel_display.c intel_check_primary_plane(struct drm_plane *plane, · line 13321

Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +10 -0
+             /*
+              * FIXME: Actually if we will still have any other plane enabled
+              * on the pipe we could let IPS enabled still, but for
+              * now lets consider that when we make primary invisible
+              * by setting DSPCNTR to 0 on update_primary_plane function
+              * IPS needs to be disable.
+              */
+             if (!state->visible || !fb)
+                     intel_crtc->atomic.disable_ips = true;
+

How could it be visible without an fb?

I don't like this !fb here as well, but I just tried to keep exactly same if statement that makes I915_WRITE(DSPCNTRL, 0) on update primary plane func...

Quoted 20 lines

drivers/gpu/drm/i915/intel_display.c static void intel_begin_crtc_commit(struct drm_crtc *crtc) · line 13423

Quoted 13 lines
drivers/gpu/drm/i915/intel_display.c +3 -0
              intel_crtc->atomic.fb_bits |=
                      INTEL_FRONTBUFFER_PRIMARY(intel_crtc->pipe);
 
@@ -13406,6 +13416,9 @@ static void intel_begin_crtc_commit(struct drm_crtc *crtc)
      if (intel_crtc->atomic.disable_fbc)
              intel_fbc_disable(dev);
 
+     if (intel_crtc->atomic.disable_ips)
+             hsw_disable_ips(intel_crtc);
+
      if (intel_crtc->atomic.pre_disable_primary)
              intel_pre_disable_primary(crtc);

intel_pre_disable_primary() would already disable IPS. Except no one sets .pre_disable_primary=true. OTOH that thing mostly seems to do stuff that has nothing to do with the primary plane (cxsr disable, fifo underrun reporting disable on gen2), so I don't think we want to use that.

Quoted 4 lines

In any case we should really have the IPS state as part of the crtc state. These global disable_foo things should just be killed IMO. Hmm, except to do this properly we'd then need to track the hw IPS state separately somewhere.

agree.

Quoted 4 lines

I guess we can just go with this for now. At least it's not really making things worse, so (maybe with the !fb check dropped):

Thanks

Quoted 17 lines
Quoted 15 lines
drivers/gpu/drm/i915/intel_drv.h +1 -1
index 2afb31a..1059283 100644
@@ -485,6 +485,7 @@ struct intel_crtc_atomic_commit {
      /* Sleepable operations to perform before commit */
      bool wait_for_flips;
      bool disable_fbc;
+     bool disable_ips;
      bool pre_disable_primary;
      bool update_wm;
      unsigned disabled_planes;
--
Quoted 1 line

2.1.0

Quoted 7 lines

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

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

Signature · 2 lines
Rodrigo Vivi
Blog: http://blog.vivi.eng.br
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
maintainer
#12 lore raw
Quoted 22 lines · Jani Nikula
Quoted 10 lines · Ander Conselvan De Oliveira
Quoted 9 lines · Ville Syrjälä
Quoted 8 lines · Jani Nikula
Quoted 6 lines · Rodrigo Vivi

I just noticed that I had forgotten to reply-all...

Jani, would you consider merge this fix with the explanation above related to Ville's question?

or do you want/need any action here?

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Ville's question, I'd like Ville's ack on it.

It's good enough for me. This part of the driver is a quite a mess anyway currently, so doesn't matter too much what we stick in there.

Ping. Seems like this still isn't merged. Does it need more work or did it just fall through the cracks?

It fell between the cracks. I know the world isn't black and white, but it doesn't help the maintainers when review is some shade of grey.

Quoted 8 lines

I've pushed this to drm-intel-next-fixes for now, but it has missed the train for both the v4.1 release and the main drm-next feature pull request for the v4.2 merge window. I expect this to land upstream in v4.2-rc2, unless there's an additional drm-next pull request during the merge window. I've added cc: stable.

Thanks for the patch, and I guess the review was, uh, "good enough for me" now... :p

Argh, I'll take that back. This conflicts with dinq, and while doing so also confuses git rerere enough to uncover a previous much bigger conflict that I have no intention of resolving again before the weekend. I'll return to it next week. Sorry.

BR,
Jani.

Quoted 162 lines

BR,
Jani.

Quoted 154 lines

Thanks,
Ander

Quoted 148 lines
Quoted 147 lines

BR,
Jani.

Quoted 134 lines

Thanks,
Rodrigo.

---------- Forwarded message ----------
From: Rodrigo Vivi <[email protected]>
Date: Fri, May 29, 2015 at 9:45 AM
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Fix IPS related flicker
To: Ville Syrjälä <[email protected]>

Quoted 34 lines · Ville Syrjälä
Quoted 33 lines · Rodrigo Vivi

We cannot let IPS enabled with no plane on the pipe:

BSpec: "IPS cannot be enabled until after at least one plane has been enabled for at least one vertical blank." and "IPS must be disabled while there is still at least one plane enabled on the same pipe as IPS." This restriction apply to HSW and BDW.

However a shortcut path on update primary plane function to make primary plane invisible by setting DSPCTRL to 0 was leting IPS enabled while there was no
other plane enabled on the pipe causing flickerings that we were believing that it was caused by that other restriction where ips cannot be used when pixel rate is greater than 95% of cdclok.

v2: Don't mess with Atomic path as pointed out by Ville.

Reference: https://bugs.freedesktop.org/show_bug.cgi?id=85583

Cc Ville Syrjälä <[email protected]>
Cc Paulo Zanoni <[email protected]>
---
 drivers/gpu/drm/i915/intel_display.c | 13 +++++++++++++
 drivers/gpu/drm/i915/intel_drv.h     |  1 +
 2 files changed, 14 insertions(+)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 4e3f302..5a6b17b 100644
@@ -13309,6 +13309,16 @@ intel_check_primary_plane(struct drm_plane *plane,
                              intel_crtc->atomic.wait_vblank = true;
              }
 
Quoted 12 lines

drivers/gpu/drm/i915/intel_display.c intel_check_primary_plane(struct drm_plane *plane, · line 13321

Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +10 -0
+             /*
+              * FIXME: Actually if we will still have any other plane enabled
+              * on the pipe we could let IPS enabled still, but for
+              * now lets consider that when we make primary invisible
+              * by setting DSPCNTR to 0 on update_primary_plane function
+              * IPS needs to be disable.
+              */
+             if (!state->visible || !fb)
+                     intel_crtc->atomic.disable_ips = true;
+

How could it be visible without an fb?

I don't like this !fb here as well, but I just tried to keep exactly same if statement that makes I915_WRITE(DSPCNTRL, 0) on update primary plane func...

Quoted 20 lines

drivers/gpu/drm/i915/intel_display.c static void intel_begin_crtc_commit(struct drm_crtc *crtc) · line 13423

Quoted 13 lines
drivers/gpu/drm/i915/intel_display.c +3 -0
              intel_crtc->atomic.fb_bits |=
                      INTEL_FRONTBUFFER_PRIMARY(intel_crtc->pipe);
 
@@ -13406,6 +13416,9 @@ static void intel_begin_crtc_commit(struct drm_crtc *crtc)
      if (intel_crtc->atomic.disable_fbc)
              intel_fbc_disable(dev);
 
+     if (intel_crtc->atomic.disable_ips)
+             hsw_disable_ips(intel_crtc);
+
      if (intel_crtc->atomic.pre_disable_primary)
              intel_pre_disable_primary(crtc);

intel_pre_disable_primary() would already disable IPS. Except no one sets .pre_disable_primary=true. OTOH that thing mostly seems to do stuff that has nothing to do with the primary plane (cxsr disable, fifo underrun reporting disable on gen2), so I don't think we want to use that.

Quoted 4 lines

In any case we should really have the IPS state as part of the crtc state. These global disable_foo things should just be killed IMO. Hmm, except to do this properly we'd then need to track the hw IPS state separately somewhere.

agree.

Quoted 4 lines

I guess we can just go with this for now. At least it's not really making things worse, so (maybe with the !fb check dropped):

Thanks

Quoted 17 lines
Quoted 15 lines
drivers/gpu/drm/i915/intel_drv.h +1 -1
index 2afb31a..1059283 100644
@@ -485,6 +485,7 @@ struct intel_crtc_atomic_commit {
      /* Sleepable operations to perform before commit */
      bool wait_for_flips;
      bool disable_fbc;
+     bool disable_ips;
      bool pre_disable_primary;
      bool update_wm;
      unsigned disabled_planes;
--
Quoted 1 line

2.1.0

Quoted 7 lines

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

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

Signature · 2 lines
Rodrigo Vivi
Blog: http://blog.vivi.eng.br
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
maintainer
#13 lore raw
Quoted 29 lines · Jani Nikula
Quoted 28 lines · Jani Nikula
Quoted 10 lines · Ander Conselvan De Oliveira
Quoted 9 lines · Ville Syrjälä
Quoted 8 lines · Jani Nikula
Quoted 6 lines · Rodrigo Vivi

I just noticed that I had forgotten to reply-all...

Jani, would you consider merge this fix with the explanation above related to Ville's question?

or do you want/need any action here?

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Ville's question, I'd like Ville's ack on it.

It's good enough for me. This part of the driver is a quite a mess anyway currently, so doesn't matter too much what we stick in there.

Ping. Seems like this still isn't merged. Does it need more work or did it just fall through the cracks?

It fell between the cracks. I know the world isn't black and white, but it doesn't help the maintainers when review is some shade of grey.

I've pushed this to drm-intel-next-fixes for now, but it has missed the train for both the v4.1 release and the main drm-next feature pull request for the v4.2 merge window. I expect this to land upstream in v4.2-rc2, unless there's an additional drm-next pull request during the merge window. I've added cc: stable.

Quoted 7 lines
Quoted 2 lines

Thanks for the patch, and I guess the review was, uh, "good enough for me" now... :p

Argh, I'll take that back. This conflicts with dinq, and while doing so also confuses git rerere enough to uncover a previous much bigger conflict that I have no intention of resolving again before the weekend. I'll return to it next week. Sorry.

And keeps conflicting too badly for me to figure out what needs to be done. Is this still needed in dinq?

BR,
Jani.

Quoted 171 lines

BR,
Jani.

Quoted 162 lines

BR,
Jani.

Quoted 154 lines

Thanks,
Ander

Quoted 148 lines
Quoted 147 lines

BR,
Jani.

Quoted 134 lines

Thanks,
Rodrigo.

---------- Forwarded message ----------
From: Rodrigo Vivi <[email protected]>
Date: Fri, May 29, 2015 at 9:45 AM
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Fix IPS related flicker
To: Ville Syrjälä <[email protected]>

Quoted 34 lines · Ville Syrjälä
Quoted 33 lines · Rodrigo Vivi

We cannot let IPS enabled with no plane on the pipe:

BSpec: "IPS cannot be enabled until after at least one plane has been enabled for at least one vertical blank." and "IPS must be disabled while there is still at least one plane enabled on the same pipe as IPS." This restriction apply to HSW and BDW.

However a shortcut path on update primary plane function to make primary plane invisible by setting DSPCTRL to 0 was leting IPS enabled while there was no
other plane enabled on the pipe causing flickerings that we were believing that it was caused by that other restriction where ips cannot be used when pixel rate is greater than 95% of cdclok.

v2: Don't mess with Atomic path as pointed out by Ville.

Reference: https://bugs.freedesktop.org/show_bug.cgi?id=85583

Cc Ville Syrjälä <[email protected]>
Cc Paulo Zanoni <[email protected]>
---
 drivers/gpu/drm/i915/intel_display.c | 13 +++++++++++++
 drivers/gpu/drm/i915/intel_drv.h     |  1 +
 2 files changed, 14 insertions(+)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 4e3f302..5a6b17b 100644
@@ -13309,6 +13309,16 @@ intel_check_primary_plane(struct drm_plane *plane,
                              intel_crtc->atomic.wait_vblank = true;
              }
 
Quoted 12 lines

drivers/gpu/drm/i915/intel_display.c intel_check_primary_plane(struct drm_plane *plane, · line 13321

Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +10 -0
+             /*
+              * FIXME: Actually if we will still have any other plane enabled
+              * on the pipe we could let IPS enabled still, but for
+              * now lets consider that when we make primary invisible
+              * by setting DSPCNTR to 0 on update_primary_plane function
+              * IPS needs to be disable.
+              */
+             if (!state->visible || !fb)
+                     intel_crtc->atomic.disable_ips = true;
+

How could it be visible without an fb?

I don't like this !fb here as well, but I just tried to keep exactly same if statement that makes I915_WRITE(DSPCNTRL, 0) on update primary plane func...

Quoted 20 lines

drivers/gpu/drm/i915/intel_display.c static void intel_begin_crtc_commit(struct drm_crtc *crtc) · line 13423

Quoted 13 lines
drivers/gpu/drm/i915/intel_display.c +3 -0
              intel_crtc->atomic.fb_bits |=
                      INTEL_FRONTBUFFER_PRIMARY(intel_crtc->pipe);
 
@@ -13406,6 +13416,9 @@ static void intel_begin_crtc_commit(struct drm_crtc *crtc)
      if (intel_crtc->atomic.disable_fbc)
              intel_fbc_disable(dev);
 
+     if (intel_crtc->atomic.disable_ips)
+             hsw_disable_ips(intel_crtc);
+
      if (intel_crtc->atomic.pre_disable_primary)
              intel_pre_disable_primary(crtc);

intel_pre_disable_primary() would already disable IPS. Except no one sets .pre_disable_primary=true. OTOH that thing mostly seems to do stuff that has nothing to do with the primary plane (cxsr disable, fifo underrun reporting disable on gen2), so I don't think we want to use that.

Quoted 4 lines

In any case we should really have the IPS state as part of the crtc state. These global disable_foo things should just be killed IMO. Hmm, except to do this properly we'd then need to track the hw IPS state separately somewhere.

agree.

Quoted 4 lines

I guess we can just go with this for now. At least it's not really making things worse, so (maybe with the !fb check dropped):

Thanks

Quoted 17 lines
Quoted 15 lines
drivers/gpu/drm/i915/intel_drv.h +1 -1
index 2afb31a..1059283 100644
@@ -485,6 +485,7 @@ struct intel_crtc_atomic_commit {
      /* Sleepable operations to perform before commit */
      bool wait_for_flips;
      bool disable_fbc;
+     bool disable_ips;
      bool pre_disable_primary;
      bool update_wm;
      unsigned disabled_planes;
--
Quoted 1 line

2.1.0

Quoted 7 lines

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

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

Signature · 2 lines
Rodrigo Vivi
Blog: http://blog.vivi.eng.br
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#14 lore raw
Quoted 34 lines · Jani Nikula
Quoted 2 lines · Jani Nikula
Quoted 1 line · Jani Nikula

On Thu, 18 Jun 2015, Ander Conselvan De Oliveira <[email protected]>

Quoted 30 lines · wrote:
Quoted 29 lines
Quoted 10 lines · Ville Syrjälä
Quoted 9 lines · Jani Nikula
Quoted 8 lines · Rodrigo Vivi
Quoted 6 lines

I just noticed that I had forgotten to reply-all...

Jani, would you consider merge this fix with the explanation above related to Ville's question?

or do you want/need any action here?

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Ville's question, I'd like Ville's ack on it.

It's good enough for me. This part of the driver is a quite a mess anyway currently, so doesn't matter too much what we stick in there.

Ping. Seems like this still isn't merged. Does it need more work or did it just fall through the cracks?

It fell between the cracks. I know the world isn't black and white, but it doesn't help the maintainers when review is some shade of grey.

I've pushed this to drm-intel-next-fixes for now, but it has missed the train for both the v4.1 release and the main drm-next feature pull request for the v4.2 merge window. I expect this to land upstream in v4.2-rc2, unless there's an additional drm-next pull request during the merge window. I've added cc: stable.

Thanks for the patch, and I guess the review was, uh, "good enough for me" now... :p

Quoted 8 lines
Quoted 4 lines

Argh, I'll take that back. This conflicts with dinq, and while doing so also confuses git rerere enough to uncover a previous much bigger conflict that I have no intention of resolving again before the weekend. I'll return to it next week. Sorry.

And keeps conflicting too badly for me to figure out what needs to be done. Is this still needed in dinq?

To be honest, on drm-intel-nightly: 2015y-06m-17d-12h-44m-01s with ips enabled I'm not facing the bad flicker anymore.

However since we still have the following 2 lines on update_primary_plane_function:

if (!visible || !fb) {
I915_WRITE(reg, 0);

I believe we need this protection. Let me refactor it..

Quoted 197 lines

BR,
Jani.

Quoted 49 lines

BR,
Jani.

Quoted 43 lines

BR,
Jani.

Quoted 38 lines

Thanks,
Ander

Quoted 34 lines
Quoted 34 lines

BR,
Jani.

Quoted 28 lines

Thanks,
Rodrigo.

---------- Forwarded message ----------
From: Rodrigo Vivi <[email protected]>
Date: Fri, May 29, 2015 at 9:45 AM
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Fix IPS related flicker
To: Ville Syrjälä <[email protected]>

Quoted 14 lines · Ville Syrjälä
Quoted 13 lines · Rodrigo Vivi

We cannot let IPS enabled with no plane on the pipe:

BSpec: "IPS cannot be enabled until after at least one plane has been enabled for at least one vertical blank." and "IPS must be disabled while there is still at least one plane enabled on the same pipe as IPS." This restriction apply to HSW and BDW.

However a shortcut path on update primary plane function to make primary plane invisible by setting DSPCTRL to 0 was leting IPS enabled while there was no
other plane enabled on the pipe causing flickerings that we were believing that it was caused by that other restriction where ips cannot be used when pixel rate is greater than 95% of

cdclok.

Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines

v2: Don't mess with Atomic path as pointed out by Ville.

Reference: https://bugs.freedesktop.org/show_bug.cgi?id=85583

Cc Ville Syrjälä <[email protected]>
Cc Paulo Zanoni <[email protected]>
---
 drivers/gpu/drm/i915/intel_display.c | 13 +++++++++++++
 drivers/gpu/drm/i915/intel_drv.h     |  1 +
 2 files changed, 14 insertions(+)
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Review

Quoted 1 line
(quoted diff) +0 -0

b/drivers/gpu/drm/i915/intel_display.c

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

drivers/gpu/drm/i915/intel_display.c intel_check_primary_plane(struct

Quoted 4 lines

index 4e3f302..5a6b17b 100644

drivers/gpu/drm/i915/intel_display.c +0 -0
@@ -13309,6 +13309,16 @@ intel_check_primary_plane(struct

drm_plane *plane,

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

drivers/gpu/drm/i915/intel_display.c intel_check_primary_plane(struct · line 13309

Quoted 1 line
drivers/gpu/drm/i915/intel_display.c +0 -0
                              intel_crtc->atomic.wait_vblank =

true;

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

drivers/gpu/drm/i915/intel_display.c intel_check_primary_plane(struct · line 13313

Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +2 -0
              }
 
+             /*
+              * FIXME: Actually if we will still have any

other plane enabled

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

drivers/gpu/drm/i915/intel_display.c intel_check_primary_plane(struct · line 13314

Quoted 1 line
drivers/gpu/drm/i915/intel_display.c +1 -0
+              * on the pipe we could let IPS enabled still,

but for

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

drivers/gpu/drm/i915/intel_display.c intel_check_primary_plane(struct · line 13315

Quoted 1 line
drivers/gpu/drm/i915/intel_display.c +1 -0
+              * now lets consider that when we make primary

invisible

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

drivers/gpu/drm/i915/intel_display.c intel_check_primary_plane(struct · line 13316

Quoted 1 line
drivers/gpu/drm/i915/intel_display.c +1 -0
+              * by setting DSPCNTR to 0 on

update_primary_plane function

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 7 lines

drivers/gpu/drm/i915/intel_display.c intel_check_primary_plane(struct · line 13321

Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +5 -0
+              * IPS needs to be disable.
+              */
+             if (!state->visible || !fb)
+                     intel_crtc->atomic.disable_ips = true;
+

How could it be visible without an fb?

I don't like this !fb here as well, but I just tried to keep

exactly

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

same if statement that makes I915_WRITE(DSPCNTRL, 0) on update

primary

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

plane func...

Quoted 3 lines
Quoted 3 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
              intel_crtc->atomic.fb_bits |=
 

INTEL_FRONTBUFFER_PRIMARY(intel_crtc->pipe);

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

drivers/gpu/drm/i915/intel_display.c static void

Quoted 2 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
@@ -13406,6 +13416,9 @@ static void

intel_begin_crtc_commit(struct drm_crtc *crtc)

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

drivers/gpu/drm/i915/intel_display.c static void · line 13423

Quoted 8 lines
drivers/gpu/drm/i915/intel_display.c +3 -0
      if (intel_crtc->atomic.disable_fbc)
              intel_fbc_disable(dev);
 
+     if (intel_crtc->atomic.disable_ips)
+             hsw_disable_ips(intel_crtc);
+
      if (intel_crtc->atomic.pre_disable_primary)
              intel_pre_disable_primary(crtc);

intel_pre_disable_primary() would already disable IPS. Except no

one

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

sets .pre_disable_primary=true. OTOH that thing mostly seems to

do

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

stuff that has nothing to do with the primary plane (cxsr

disable,

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

fifo underrun reporting disable on gen2), so I don't think we

want

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

to use that.

In any case we should really have the IPS state as part of the

crtc

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

state. These global disable_foo things should just be killed IMO. Hmm, except to do this properly we'd then need to track the hw

IPS

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line

state separately somewhere.

agree.

Quoted 2 lines

I guess we can just go with this for now. At least it's not

really

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines

making things worse, so (maybe with the !fb check dropped):

Thanks

Quoted 3 lines

Review

Quoted 3 lines
(quoted diff) +0 -0

b/drivers/gpu/drm/i915/intel_drv.h

Quoted 43 lines
Quoted 43 lines
Quoted 42 lines
Quoted 40 lines
Quoted 39 lines
Quoted 24 lines
Quoted 14 lines
Quoted 12 lines

index 2afb31a..1059283 100644

drivers/gpu/drm/i915/intel_drv.h +1 -1
@@ -485,6 +485,7 @@ struct intel_crtc_atomic_commit {
      /* Sleepable operations to perform before commit */
      bool wait_for_flips;
      bool disable_fbc;
+     bool disable_ips;
      bool pre_disable_primary;
      bool update_wm;
      unsigned disabled_planes;
--
Quoted 1 line

2.1.0

Quoted 7 lines

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

Quoted 8 lines

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

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

--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Quoted 5 lines
Quoted 2 lines

--
Jani Nikula, Intel Open Source Technology Center

--
Jani Nikula, Intel Open Source Technology Center

Quoted 7 lines

--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
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

maintainer
#15 lore raw
Quoted 49 lines · Rodrigo Vivi
Quoted 34 lines · Jani Nikula
Quoted 2 lines · Jani Nikula
Quoted 1 line · Jani Nikula

On Thu, 18 Jun 2015, Ander Conselvan De Oliveira <[email protected]>

Quoted 30 lines · wrote:
Quoted 29 lines
Quoted 10 lines · Ville Syrjälä
Quoted 9 lines · Jani Nikula
Quoted 8 lines · Rodrigo Vivi
Quoted 6 lines

I just noticed that I had forgotten to reply-all...

Jani, would you consider merge this fix with the explanation above related to Ville's question?

or do you want/need any action here?

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Ville's question, I'd like Ville's ack on it.

It's good enough for me. This part of the driver is a quite a mess anyway currently, so doesn't matter too much what we stick in there.

Ping. Seems like this still isn't merged. Does it need more work or did it just fall through the cracks?

It fell between the cracks. I know the world isn't black and white, but it doesn't help the maintainers when review is some shade of grey.

I've pushed this to drm-intel-next-fixes for now, but it has missed the train for both the v4.1 release and the main drm-next feature pull request for the v4.2 merge window. I expect this to land upstream in v4.2-rc2, unless there's an additional drm-next pull request during the merge window. I've added cc: stable.

Thanks for the patch, and I guess the review was, uh, "good enough for me" now... :p

Quoted 8 lines
Quoted 4 lines

Argh, I'll take that back. This conflicts with dinq, and while doing so also confuses git rerere enough to uncover a previous much bigger conflict that I have no intention of resolving again before the weekend. I'll return to it next week. Sorry.

And keeps conflicting too badly for me to figure out what needs to be done. Is this still needed in dinq?

To be honest, on drm-intel-nightly: 2015y-06m-17d-12h-44m-01s with ips enabled I'm not facing the bad flicker anymore.

Quoted 7 lines

However since we still have the following 2 lines on update_primary_plane_function:

if (!visible || !fb) {
I915_WRITE(reg, 0);

I believe we need this protection. Let me refactor it..

I think we need to apply this patch to drm-intel-next-fixes (for v4.2 and cc: stable), and the refactored version on drm-intel-next-queued (for v4.3).

BR,
Jani.

Quoted 206 lines
Quoted 206 lines

BR,
Jani.

Quoted 49 lines

BR,
Jani.

Quoted 43 lines

BR,
Jani.

Quoted 38 lines

Thanks,
Ander

Quoted 34 lines
Quoted 34 lines

BR,
Jani.

Quoted 28 lines

Thanks,
Rodrigo.

---------- Forwarded message ----------
From: Rodrigo Vivi <[email protected]>
Date: Fri, May 29, 2015 at 9:45 AM
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Fix IPS related flicker
To: Ville Syrjälä <[email protected]>

Quoted 14 lines · Ville Syrjälä
Quoted 13 lines · Rodrigo Vivi

We cannot let IPS enabled with no plane on the pipe:

BSpec: "IPS cannot be enabled until after at least one plane has been enabled for at least one vertical blank." and "IPS must be disabled while there is still at least one plane enabled on the same pipe as IPS." This restriction apply to HSW and BDW.

However a shortcut path on update primary plane function to make primary plane invisible by setting DSPCTRL to 0 was leting IPS enabled while there was no
other plane enabled on the pipe causing flickerings that we were believing that it was caused by that other restriction where ips cannot be used when pixel rate is greater than 95% of

cdclok.

Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines

v2: Don't mess with Atomic path as pointed out by Ville.

Reference: https://bugs.freedesktop.org/show_bug.cgi?id=85583

Cc Ville Syrjälä <[email protected]>
Cc Paulo Zanoni <[email protected]>
---
 drivers/gpu/drm/i915/intel_display.c | 13 +++++++++++++
 drivers/gpu/drm/i915/intel_drv.h     |  1 +
 2 files changed, 14 insertions(+)
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Review

Quoted 1 line
(quoted diff) +0 -0

b/drivers/gpu/drm/i915/intel_display.c

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

drivers/gpu/drm/i915/intel_display.c intel_check_primary_plane(struct

Quoted 4 lines

index 4e3f302..5a6b17b 100644

drivers/gpu/drm/i915/intel_display.c +0 -0
@@ -13309,6 +13309,16 @@ intel_check_primary_plane(struct

drm_plane *plane,

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

drivers/gpu/drm/i915/intel_display.c intel_check_primary_plane(struct · line 13309

Quoted 1 line
drivers/gpu/drm/i915/intel_display.c +0 -0
                              intel_crtc->atomic.wait_vblank =

true;

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

drivers/gpu/drm/i915/intel_display.c intel_check_primary_plane(struct · line 13313

Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +2 -0
              }
 
+             /*
+              * FIXME: Actually if we will still have any

other plane enabled

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

drivers/gpu/drm/i915/intel_display.c intel_check_primary_plane(struct · line 13314

Quoted 1 line
drivers/gpu/drm/i915/intel_display.c +1 -0
+              * on the pipe we could let IPS enabled still,

but for

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

drivers/gpu/drm/i915/intel_display.c intel_check_primary_plane(struct · line 13315

Quoted 1 line
drivers/gpu/drm/i915/intel_display.c +1 -0
+              * now lets consider that when we make primary

invisible

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

drivers/gpu/drm/i915/intel_display.c intel_check_primary_plane(struct · line 13316

Quoted 1 line
drivers/gpu/drm/i915/intel_display.c +1 -0
+              * by setting DSPCNTR to 0 on

update_primary_plane function

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 7 lines

drivers/gpu/drm/i915/intel_display.c intel_check_primary_plane(struct · line 13321

Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +5 -0
+              * IPS needs to be disable.
+              */
+             if (!state->visible || !fb)
+                     intel_crtc->atomic.disable_ips = true;
+

How could it be visible without an fb?

I don't like this !fb here as well, but I just tried to keep

exactly

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

same if statement that makes I915_WRITE(DSPCNTRL, 0) on update

primary

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

plane func...

Quoted 3 lines
Quoted 3 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
              intel_crtc->atomic.fb_bits |=
 

INTEL_FRONTBUFFER_PRIMARY(intel_crtc->pipe);

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

drivers/gpu/drm/i915/intel_display.c static void

Quoted 2 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
@@ -13406,6 +13416,9 @@ static void

intel_begin_crtc_commit(struct drm_crtc *crtc)

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

drivers/gpu/drm/i915/intel_display.c static void · line 13423

Quoted 8 lines
drivers/gpu/drm/i915/intel_display.c +3 -0
      if (intel_crtc->atomic.disable_fbc)
              intel_fbc_disable(dev);
 
+     if (intel_crtc->atomic.disable_ips)
+             hsw_disable_ips(intel_crtc);
+
      if (intel_crtc->atomic.pre_disable_primary)
              intel_pre_disable_primary(crtc);

intel_pre_disable_primary() would already disable IPS. Except no

one

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

sets .pre_disable_primary=true. OTOH that thing mostly seems to

do

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

stuff that has nothing to do with the primary plane (cxsr

disable,

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

fifo underrun reporting disable on gen2), so I don't think we

want

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

to use that.

In any case we should really have the IPS state as part of the

crtc

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

state. These global disable_foo things should just be killed IMO. Hmm, except to do this properly we'd then need to track the hw

IPS

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line

state separately somewhere.

agree.

Quoted 2 lines

I guess we can just go with this for now. At least it's not

really

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines

making things worse, so (maybe with the !fb check dropped):

Thanks

Quoted 3 lines

Review

Quoted 3 lines
(quoted diff) +0 -0

b/drivers/gpu/drm/i915/intel_drv.h

Quoted 43 lines
Quoted 43 lines
Quoted 42 lines
Quoted 40 lines
Quoted 39 lines
Quoted 24 lines
Quoted 14 lines
Quoted 12 lines

index 2afb31a..1059283 100644

drivers/gpu/drm/i915/intel_drv.h +1 -1
@@ -485,6 +485,7 @@ struct intel_crtc_atomic_commit {
      /* Sleepable operations to perform before commit */
      bool wait_for_flips;
      bool disable_fbc;
+     bool disable_ips;
      bool pre_disable_primary;
      bool update_wm;
      unsigned disabled_planes;
--
Quoted 1 line

2.1.0

Quoted 7 lines

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

Quoted 8 lines

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

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

--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Quoted 5 lines
Quoted 2 lines

--
Jani Nikula, Intel Open Source Technology Center

--
Jani Nikula, Intel Open Source Technology Center

--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
author maintainer
#16 lore raw

PATCH 1/1 drm/i915: Fix IPS related flicker

In reply to Rodrigo Vivi

We cannot let IPS enabled with no plane on the pipe:

BSpec: "IPS cannot be enabled until after at least one plane has been enabled for at least one vertical blank." and "IPS must be disabled while there is still at least one plane enabled on the same pipe as IPS." This restriction apply to HSW and BDW.

However a shortcut path on update primary plane function to make primary plane invisible by setting DSPCTRL to 0 was leting IPS enabled while there was no
other plane enabled on the pipe causing flickerings that we were believing that it was caused by that other restriction where ips cannot be used when pixel rate is greater than 95% of cdclok.

v2: Don't mess with Atomic path as pointed out by Ville.

v3: Rebase after a long time and atomic path changes.
Accept Ville suggestion of not check !fb

Reference: https://bugs.freedesktop.org/show_bug.cgi?id=85583

---
 drivers/gpu/drm/i915/intel_display.c | 13 +++++++++++++
 drivers/gpu/drm/i915/intel_drv.h     |  1 +
 2 files changed, 14 insertions(+)
drivers/gpu/drm/i915/intel_display.c +13 -0
index cc68e41..9b0d10b 100644
@@ -11618,6 +11618,16 @@ int intel_plane_atomic_calc_changes(struct drm_crtc_state *crtc_state,
 		if (visible)
 			intel_crtc->atomic.fb_bits |=
 			    INTEL_FRONTBUFFER_PRIMARY(intel_crtc->pipe);
+		else
+			/*
+			 * FIXME: Actually if we will still have any other
+			 * plane enabled on the pipe we could let IPS enabled
+			 * still, but for now lets consider that when we make
+			 * primary invisible by setting DSPCNTR to 0 on
+			 * update_primary_plane function IPS needs to be
+			 * disable.
+			 */
+			intel_crtc->atomic.disable_ips = true;
 
 		intel_crtc->atomic.wait_for_flips = true;
 		intel_crtc->atomic.pre_disable_primary = turn_off;
@@ -13724,6 +13734,9 @@ static void intel_begin_crtc_commit(struct drm_crtc *crtc)
 	if (!needs_modeset(crtc->state))
 		intel_pre_plane_update(intel_crtc);
 
+	if (intel_crtc->atomic.disable_ips)
+		hsw_disable_ips(intel_crtc);
+
 	if (intel_crtc->atomic.update_wm)
 		intel_update_watermarks(crtc);
 
drivers/gpu/drm/i915/intel_drv.h +1 -0
index e90c743..6ffd245 100644
@@ -498,6 +498,7 @@ struct intel_crtc_atomic_commit {
 	/* Sleepable operations to perform before commit */
 	bool wait_for_flips;
 	bool disable_fbc;
+	bool disable_ips;
 	bool pre_disable_primary;
 	bool update_wm;
 	unsigned disabled_planes;
Signature · 6 lines
2.1.0

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

We cannot let IPS enabled with no plane on the pipe:

BSpec: "IPS cannot be enabled until after at least one plane has been enabled for at least one vertical blank." and "IPS must be disabled while there is still at least one plane enabled on the same pipe as IPS." This restriction apply to HSW and BDW.

However a shortcut path on update primary plane function to make primary plane invisible by setting DSPCTRL to 0 was leting IPS enabled while there was no
other plane enabled on the pipe causing flickerings that we were believing that it was caused by that other restriction where ips cannot be used when pixel rate is greater than 95% of cdclok.

v2: Don't mess with Atomic path as pointed out by Ville.

v3: Rebase after a long time and atomic path changes.
Accept Ville suggestion of not check !fb

Quoted 6 lines

Reference: https://bugs.freedesktop.org/show_bug.cgi?id=85583

Already conflicts since I pulled in Ville's frontbuffer_bits rework. Can you please rebase once more?

Thanks, Daniel

Quoted 55 lines
---
 drivers/gpu/drm/i915/intel_display.c | 13 +++++++++++++
 drivers/gpu/drm/i915/intel_drv.h     |  1 +
 2 files changed, 14 insertions(+)
drivers/gpu/drm/i915/intel_display.c +13 -0
index cc68e41..9b0d10b 100644
@@ -11618,6 +11618,16 @@ int intel_plane_atomic_calc_changes(struct drm_crtc_state *crtc_state,
 		if (visible)
 			intel_crtc->atomic.fb_bits |=
 			    INTEL_FRONTBUFFER_PRIMARY(intel_crtc->pipe);
+		else
+			/*
+			 * FIXME: Actually if we will still have any other
+			 * plane enabled on the pipe we could let IPS enabled
+			 * still, but for now lets consider that when we make
+			 * primary invisible by setting DSPCNTR to 0 on
+			 * update_primary_plane function IPS needs to be
+			 * disable.
+			 */
+			intel_crtc->atomic.disable_ips = true;
 
 		intel_crtc->atomic.wait_for_flips = true;
 		intel_crtc->atomic.pre_disable_primary = turn_off;
@@ -13724,6 +13734,9 @@ static void intel_begin_crtc_commit(struct drm_crtc *crtc)
 	if (!needs_modeset(crtc->state))
 		intel_pre_plane_update(intel_crtc);
 
+	if (intel_crtc->atomic.disable_ips)
+		hsw_disable_ips(intel_crtc);
+
 	if (intel_crtc->atomic.update_wm)
 		intel_update_watermarks(crtc);
 
drivers/gpu/drm/i915/intel_drv.h +1 -0
index e90c743..6ffd245 100644
@@ -498,6 +498,7 @@ struct intel_crtc_atomic_commit {
 	/* Sleepable operations to perform before commit */
 	bool wait_for_flips;
 	bool disable_fbc;
+	bool disable_ips;
 	bool pre_disable_primary;
 	bool update_wm;
 	unsigned disabled_planes;
Signature · 6 lines
2.1.0

_______________________________________________
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
#18 lore raw
Quoted 27 lines · Daniel Vetter
Quoted 19 lines · Rodrigo Vivi

We cannot let IPS enabled with no plane on the pipe:

BSpec: "IPS cannot be enabled until after at least one plane has been enabled for at least one vertical blank." and "IPS must be disabled while there is still at least one plane enabled on the same pipe as IPS." This restriction apply to HSW and BDW.

However a shortcut path on update primary plane function to make primary plane invisible by setting DSPCTRL to 0 was leting IPS enabled while there was no
other plane enabled on the pipe causing flickerings that we were believing that it was caused by that other restriction where ips cannot be used when pixel rate is greater than 95% of cdclok.

v2: Don't mess with Atomic path as pointed out by Ville.

v3: Rebase after a long time and atomic path changes.
Accept Ville suggestion of not check !fb

Quoted 6 lines

Reference: https://bugs.freedesktop.org/show_bug.cgi?id=85583

Quoted 2 lines

Already conflicts since I pulled in Ville's frontbuffer_bits rework. Can you please rebase once more?

Preferably on top of drm-intel-next-queued directly, I think. I already applied the earlier version to drm-intel-next-fixes.

BR,
Jani.

Quoted 63 lines

Thanks, Daniel

Quoted 55 lines
---
 drivers/gpu/drm/i915/intel_display.c | 13 +++++++++++++
 drivers/gpu/drm/i915/intel_drv.h     |  1 +
 2 files changed, 14 insertions(+)
drivers/gpu/drm/i915/intel_display.c +13 -0
index cc68e41..9b0d10b 100644
@@ -11618,6 +11618,16 @@ int intel_plane_atomic_calc_changes(struct drm_crtc_state *crtc_state,
 		if (visible)
 			intel_crtc->atomic.fb_bits |=
 			    INTEL_FRONTBUFFER_PRIMARY(intel_crtc->pipe);
+		else
+			/*
+			 * FIXME: Actually if we will still have any other
+			 * plane enabled on the pipe we could let IPS enabled
+			 * still, but for now lets consider that when we make
+			 * primary invisible by setting DSPCNTR to 0 on
+			 * update_primary_plane function IPS needs to be
+			 * disable.
+			 */
+			intel_crtc->atomic.disable_ips = true;
 
 		intel_crtc->atomic.wait_for_flips = true;
 		intel_crtc->atomic.pre_disable_primary = turn_off;
@@ -13724,6 +13734,9 @@ static void intel_begin_crtc_commit(struct drm_crtc *crtc)
 	if (!needs_modeset(crtc->state))
 		intel_pre_plane_update(intel_crtc);
 
+	if (intel_crtc->atomic.disable_ips)
+		hsw_disable_ips(intel_crtc);
+
 	if (intel_crtc->atomic.update_wm)
 		intel_update_watermarks(crtc);
 
drivers/gpu/drm/i915/intel_drv.h +1 -0
index e90c743..6ffd245 100644
@@ -498,6 +498,7 @@ struct intel_crtc_atomic_commit {
 	/* Sleepable operations to perform before commit */
 	bool wait_for_flips;
 	bool disable_fbc;
+	bool disable_ips;
 	bool pre_disable_primary;
 	bool update_wm;
 	unsigned disabled_planes;
Signature · 6 lines
2.1.0

_______________________________________________
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
author maintainer
#19 lore raw

PATCH 1/1 drm/i915: Fix IPS related flicker

We cannot let IPS enabled with no plane on the pipe:

BSpec: "IPS cannot be enabled until after at least one plane has been enabled for at least one vertical blank." and "IPS must be disabled while there is still at least one plane enabled on the same pipe as IPS." This restriction apply to HSW and BDW.

However a shortcut path on update primary plane function to make primary plane invisible by setting DSPCTRL to 0 was leting IPS enabled while there was no
other plane enabled on the pipe causing flickerings that we were believing that it was caused by that other restriction where ips cannot be used when pixel rate is greater than 95% of cdclok.

v2: Don't mess with Atomic path as pointed out by Ville.

v3: Rebase after a long time and atomic path changes.
Accept Ville suggestion of not check !fb

v4: Re-factore on dinq

Reference: https://bugs.freedesktop.org/show_bug.cgi?id=85583

---
 drivers/gpu/drm/i915/intel_display.c | 16 +++++++++++++++-
 drivers/gpu/drm/i915/intel_drv.h     |  1 +
 2 files changed, 16 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +15 -1
index 01eaab8..f87704a 100644
@@ -4766,6 +4766,9 @@ static void intel_pre_plane_update(struct intel_crtc *crtc)
 		mutex_unlock(&dev->struct_mutex);
 	}
 
+	if (intel_crtc->atomic.disable_ips)
+		hsw_disable_ips(intel_crtc);
+
 	if (atomic->pre_disable_primary)
 		intel_pre_disable_primary(&crtc->base);
 }
@@ -11616,8 +11619,19 @@ int intel_plane_atomic_calc_changes(struct drm_crtc_state *crtc_state,
 		intel_crtc->atomic.pre_disable_primary = turn_off;
 		intel_crtc->atomic.post_enable_primary = turn_on;
 
-		if (turn_off)
+		if (turn_off) {
+			/*
+			 * FIXME: Actually if we will still have any other
+			 * plane enabled on the pipe we could let IPS enabled
+			 * still, but for now lets consider that when we make
+			 * primary invisible by setting DSPCNTR to 0 on
+			 * update_primary_plane function IPS needs to be
+			 * disable.
+			 */
+			intel_crtc->atomic.disable_ips = true;
+
 			intel_crtc->atomic.disable_fbc = true;
+		}
 
 		/*
 		 * FBC does not work on some platforms for rotated
drivers/gpu/drm/i915/intel_drv.h +1 -0
index e016d72..33cff9d 100644
@@ -498,6 +498,7 @@ struct intel_crtc_atomic_commit {
 	/* Sleepable operations to perform before commit */
 	bool wait_for_flips;
 	bool disable_fbc;
+	bool disable_ips;
 	bool pre_disable_primary;
 	bool update_wm;
 	unsigned disabled_planes;
Signature · 6 lines
2.1.0

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tested-by on v1 1/1
#20 lore raw
In reply to Rodrigo Vivi

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

PNV                                  276/276              276/276
ILK                                  303/303              303/303
SNB                 -1              315/315              314/315
IVB                                  343/343              343/343
BYT                                  287/287              287/287

BDW -1 320/320 319/320
-------------------------------------Detailed-------------------------------------
Platform Test drm-intel-nightly Series Applied
*SNB igt@pm_rpm@dpms-mode-unset-non-lpsp 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
*BDW igt@gem_flink_race@flink_name PASS(1) DMESG_WARN(1)
(dmesg patch applied)WARNING:at_drivers/gpu/drm/i915/intel_display.c:#assert_plane[i915]()@WARNING:.* at .* assert_plane assertion_failure@assertion failure
WARNING:at_drivers/gpu/drm/drm_irq.c:#drm_wait_one_vblank[drm]()@WARNING:.* at .* drm_wait_one_vblank+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

maintainer Applied
#21 lore raw
In reply to Rodrigo Vivi
Quoted 14 lines · Rodrigo Vivi

We cannot let IPS enabled with no plane on the pipe:

BSpec: "IPS cannot be enabled until after at least one plane has been enabled for at least one vertical blank." and "IPS must be disabled while there is still at least one plane enabled on the same pipe as IPS." This restriction apply to HSW and BDW.

However a shortcut path on update primary plane function to make primary plane invisible by setting DSPCTRL to 0 was leting IPS enabled while there was no
other plane enabled on the pipe causing flickerings that we were believing that it was caused by that other restriction where ips cannot be used when pixel rate is greater than 95% of cdclok.

Quoted 6 lines

v2: Don't mess with Atomic path as pointed out by Ville.

Reference: https://bugs.freedesktop.org/show_bug.cgi?id=85583

Cc Ville Syrjälä <[email protected]>
Cc Paulo Zanoni <[email protected]>

Pushed to drm-intel-next-fixes, thanks for the patch and review. I resolved the conflicts -nightly in favor of drm-intel-next-queued, so your other patch is needed for that.

BR,
Jani.

Quoted 55 lines
---
 drivers/gpu/drm/i915/intel_display.c | 13 +++++++++++++
 drivers/gpu/drm/i915/intel_drv.h     |  1 +
 2 files changed, 14 insertions(+)
drivers/gpu/drm/i915/intel_display.c +13 -0
index 4e3f302..5a6b17b 100644
@@ -13309,6 +13309,16 @@ intel_check_primary_plane(struct drm_plane *plane,
 				intel_crtc->atomic.wait_vblank = true;
 		}
 
+		/*
+		 * FIXME: Actually if we will still have any other plane enabled
+		 * on the pipe we could let IPS enabled still, but for
+		 * now lets consider that when we make primary invisible
+		 * by setting DSPCNTR to 0 on update_primary_plane function
+		 * IPS needs to be disable.
+		 */
+		if (!state->visible || !fb)
+			intel_crtc->atomic.disable_ips = true;
+
 		intel_crtc->atomic.fb_bits |=
 			INTEL_FRONTBUFFER_PRIMARY(intel_crtc->pipe);
 
@@ -13406,6 +13416,9 @@ static void intel_begin_crtc_commit(struct drm_crtc *crtc)
 	if (intel_crtc->atomic.disable_fbc)
 		intel_fbc_disable(dev);
 
+	if (intel_crtc->atomic.disable_ips)
+		hsw_disable_ips(intel_crtc);
+
 	if (intel_crtc->atomic.pre_disable_primary)
 		intel_pre_disable_primary(crtc);
 
drivers/gpu/drm/i915/intel_drv.h +1 -0
index 2afb31a..1059283 100644
@@ -485,6 +485,7 @@ struct intel_crtc_atomic_commit {
 	/* Sleepable operations to perform before commit */
 	bool wait_for_flips;
 	bool disable_fbc;
+	bool disable_ips;
 	bool pre_disable_primary;
 	bool update_wm;
 	unsigned disabled_planes;
Signature · 6 lines
2.1.0

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tested-by on v1 1/1
#22 lore raw
In reply to Rodrigo Vivi

Task id: 6453 -------------------------------------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

Tested-by on v1 1/1
#23 lore raw
In reply to Rodrigo Vivi
Quoted 35 lines · Rodrigo Vivi

We cannot let IPS enabled with no plane on the pipe:

BSpec: "IPS cannot be enabled until after at least one plane has been enabled for at least one vertical blank." and "IPS must be disabled while there is still at least one plane enabled on the same pipe as IPS.

However this shortcut path to make primary plane invisible when updating primary plane was leting IPS enabled while there was no other plane enabled on the pipe causing flickerings that we were believing that it was caused by that other restriction where ips cannot be used when pixel rate is greater than 95% of cdclok.

Reference: https://bugs.freedesktop.org/show_bug.cgi?id=85583

Cc Joe Konno <[email protected]>
Cc Paulo Zanoni <[email protected]>
---
 drivers/gpu/drm/i915/intel_display.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
drivers/gpu/drm/i915/intel_display.c +6 -0
index 9d2d6fb..5519d56 100644
@@ -2789,6 +2789,19 @@ static void ironlake_update_primary_plane(struct drm_crtc *crtc,
 	int pixel_size;
 
 	if (!visible || !fb) {
+		/*
+		 * This shortcut path disables the primary plane making
+		 * IPS really sad and lost when it is enabled alone with no
+		 * plane around on the pipe. So, for now it is safe to disable
+		 * IPS here.
+		 /

drivers/gpu/drm/i915/intel_display.c static void ironlake_update_primary_plane(struct drm_crtc *crtc, · line 2807

Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +7 -0
+		 /*
+		 * FIXME: Any other plane enabled should be enough so it would
+		 * be better to check if there is really no sprite or
+		 * cursor around.
+		 */
+		hsw_disable_ips(intel_crtc);
+
 		I915_WRITE(reg, 0);
 		I915_WRITE(DSPSURF(plane), 0);
 		POSTING_READ(reg);

This fixes a bug on my Lenovo X250 (Broadwell GT2).

1. Boot
2. startx using SNA and KDE 5
3. Quit X

Prior to this patch, the screen was all scrambled. With this patch, it works perfectly.

Thanks, Rodrigo!

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