Skip to contentSkip to conversation

Small IPS fixes

PATCH In review Paulo Zanoni 3 participants 9 messages Sep 19, 2013 – Oct 8, 2013

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

cover Small IPS fixes

From: Paulo Zanoni <[email protected]>

Just simple things I spotted. I tested these patches on top of the 4 patches that fix the Haswell underruns.

Paulo Zanoni (2):
drm/i915: POSTING_READ IPS_CTL before waiting for the vblank drm/i915: wait for IPS_ENABLE when enabling IPS

 drivers/gpu/drm/i915/intel_display.c | 9 +++++++++
 1 file changed, 9 insertions(+)
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/2 drm/i915: POSTING_READ IPS_CTL before waiting for the vblank

From: Paulo Zanoni <[email protected]>

Make sure we write to IPS before we actually wait.

---
 drivers/gpu/drm/i915/intel_display.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/i915/intel_display.c +1 -0
index fc55570..78ff5ed 100644
@@ -3386,6 +3386,7 @@ static void hsw_disable_ips(struct intel_crtc *crtc)
 
 	assert_plane_enabled(dev_priv, crtc->plane);
 	I915_WRITE(IPS_CTL, 0);
+	POSTING_READ(IPS_CTL);
 
 	/* We need to wait for a vblank before we can disable the plane. */
 	intel_wait_for_vblank(dev, crtc->pipe);
Signature · 1 line
1.8.3.1
#2 lore raw

PATCH 2/2 drm/i915: wait for IPS_ENABLE when enabling IPS

In reply to Paulo Zanoni

From: Paulo Zanoni <[email protected]>

At the end of haswell_crtc_enable we have an intel_wait_for_vblank with a big comment, and the message suggests it's a workaround for something we don't really understand. So I removed that wait and started getting HW state readout error messages saying that the IPS state is not what we expected.

I investigated and concluded that after you write IPS_ENABLE to IPS_CTL, the bit will only actually become 1 on the next vblank. So add code to wait for the IPS_ENABLE bit. We don't really need this wait right now due to the wait I already mentioned, but at least this one has a reason to be there, while the other one is just to workaround some problem: we may remove it in the future.

The wait also acts as a POSTING_READ which we missed.

---
 drivers/gpu/drm/i915/intel_display.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/i915/intel_display.c +8 -0
index 78ff5ed..8fd13ab 100644
@@ -3374,6 +3374,14 @@ static void hsw_enable_ips(struct intel_crtc *crtc)
 	 * for a vblank, so all we need to do here is to enable the IPS bit. */
 	assert_plane_enabled(dev_priv, crtc->plane);
 	I915_WRITE(IPS_CTL, IPS_ENABLE);
+
+	/* The bit only becomes 1 in the next vblank, so this wait here is
+	 * essentially intel_wait_for_vblank. If we don't have this and don't
+	 * wait for vblanks until the end of crtc_enable, then the HW state
+	 * readout code will complain that the expected IPS_CTL value is not the
+	 * one we read. */
+	if (wait_for(I915_READ_NOTRACE(IPS_CTL) & IPS_ENABLE, 50))
+		DRM_ERROR("Timed out waiting for IPS enable\n");
 }
 
 static void hsw_disable_ips(struct intel_crtc *crtc)
Signature · 1 line
1.8.3.1
Reviewed-by on v1 2/2
#3 lore raw

Re: [PATCH 2/2] drm/i915: wait for IPS_ENABLE when enabling IPS

Quoted 15 lines · Paulo Zanoni

From: Paulo Zanoni <[email protected]>

At the end of haswell_crtc_enable we have an intel_wait_for_vblank with a big comment, and the message suggests it's a workaround for something we don't really understand. So I removed that wait and started getting HW state readout error messages saying that the IPS state is not what we expected.

I investigated and concluded that after you write IPS_ENABLE to IPS_CTL, the bit will only actually become 1 on the next vblank. So add code to wait for the IPS_ENABLE bit. We don't really need this wait right now due to the wait I already mentioned, but at least this one has a reason to be there, while the other one is just to workaround some problem: we may remove it in the future.

Quoted 3 lines

The wait also acts as a POSTING_READ which we missed.

Both patches:

I was thinking that maybe the intel_wait_for_vblank would be better from a documenting perspective - and it would also give warnings for trying to enable ips whilst the pipe was off. But you would still need the wait for IPS_ENABLE as confirmation anyway.
-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
#4 lore raw

Re: [PATCH 2/2] drm/i915: wait for IPS_ENABLE when enabling IPS

Quoted 20 lines · Chris Wilson
Quoted 15 lines · Paulo Zanoni

From: Paulo Zanoni <[email protected]>

At the end of haswell_crtc_enable we have an intel_wait_for_vblank with a big comment, and the message suggests it's a workaround for something we don't really understand. So I removed that wait and started getting HW state readout error messages saying that the IPS state is not what we expected.

I investigated and concluded that after you write IPS_ENABLE to IPS_CTL, the bit will only actually become 1 on the next vblank. So add code to wait for the IPS_ENABLE bit. We don't really need this wait right now due to the wait I already mentioned, but at least this one has a reason to be there, while the other one is just to workaround some problem: we may remove it in the future.

Quoted 3 lines

The wait also acts as a POSTING_READ which we missed.

Quoted 7 lines

Both patches:

I was thinking that maybe the intel_wait_for_vblank would be better from a documenting perspective - and it would also give warnings for trying to enable ips whilst the pipe was off. But you would still need the wait for IPS_ENABLE as confirmation anyway.

Both queued for -next, thanks for the patches&review. -Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#5 lore raw

Re: [PATCH 2/2] drm/i915: wait for IPS_ENABLE when enabling IPS

2013/9/20 Daniel Vetter <[email protected]>:

Quoted 24 lines · Chris Wilson
Quoted 23 lines · Paulo Zanoni
Quoted 15 lines

From: Paulo Zanoni <[email protected]>

At the end of haswell_crtc_enable we have an intel_wait_for_vblank with a big comment, and the message suggests it's a workaround for something we don't really understand. So I removed that wait and started getting HW state readout error messages saying that the IPS state is not what we expected.

I investigated and concluded that after you write IPS_ENABLE to IPS_CTL, the bit will only actually become 1 on the next vblank. So add code to wait for the IPS_ENABLE bit. We don't really need this wait right now due to the wait I already mentioned, but at least this one has a reason to be there, while the other one is just to workaround some problem: we may remove it in the future.

Quoted 3 lines

The wait also acts as a POSTING_READ which we missed.

Both patches:

Quoted 6 lines
Quoted 4 lines

I was thinking that maybe the intel_wait_for_vblank would be better from a documenting perspective - and it would also give warnings for trying to enable ips whilst the pipe was off. But you would still need the wait for IPS_ENABLE as confirmation anyway.

Both queued for -next, thanks for the patches&review.

Hmmm, this patch depends on the "enable planes only after the pipe is really running" patch. Due to that missing patch, now I get "[drm:hsw_enable_ips] *ERROR* Timed out waiting for IPS enable" when booting. I should have said this, sorry :(

I

Quoted 5 lines

-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

Signature · 1 line
Paulo Zanoni
#6 lore raw

Re: [PATCH 2/2] drm/i915: wait for IPS_ENABLE when enabling IPS

Quoted 30 lines · Paulo Zanoni

2013/9/20 Daniel Vetter <[email protected]>:

Quoted 29 lines · Chris Wilson
Quoted 27 lines · Paulo Zanoni
Quoted 15 lines

From: Paulo Zanoni <[email protected]>

At the end of haswell_crtc_enable we have an intel_wait_for_vblank with a big comment, and the message suggests it's a workaround for something we don't really understand. So I removed that wait and started getting HW state readout error messages saying that the IPS state is not what we expected.

I investigated and concluded that after you write IPS_ENABLE to IPS_CTL, the bit will only actually become 1 on the next vblank. So add code to wait for the IPS_ENABLE bit. We don't really need this wait right now due to the wait I already mentioned, but at least this one has a reason to be there, while the other one is just to workaround some problem: we may remove it in the future.

Quoted 3 lines

The wait also acts as a POSTING_READ which we missed.

Both patches:

I was thinking that maybe the intel_wait_for_vblank would be better from a documenting perspective - and it would also give warnings for trying to enable ips whilst the pipe was off. But you would still need the wait for IPS_ENABLE as confirmation anyway.

Quoted 6 lines
Quoted 1 line

Both queued for -next, thanks for the patches&review.

Hmmm, this patch depends on the "enable planes only after the pipe is really running" patch. Due to that missing patch, now I get "[drm:hsw_enable_ips] *ERROR* Timed out waiting for IPS enable" when booting. I should have said this, sorry :(

Ok, I've dropped it again.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#7 lore raw

Re: [PATCH 2/2] drm/i915: wait for IPS_ENABLE when enabling IPS

2013/9/20 Daniel Vetter <[email protected]>:

Quoted 31 lines · Paulo Zanoni
Quoted 30 lines

2013/9/20 Daniel Vetter <[email protected]>:

Quoted 29 lines · Chris Wilson
Quoted 27 lines · Paulo Zanoni
Quoted 15 lines

From: Paulo Zanoni <[email protected]>

At the end of haswell_crtc_enable we have an intel_wait_for_vblank with a big comment, and the message suggests it's a workaround for something we don't really understand. So I removed that wait and started getting HW state readout error messages saying that the IPS state is not what we expected.

I investigated and concluded that after you write IPS_ENABLE to IPS_CTL, the bit will only actually become 1 on the next vblank. So add code to wait for the IPS_ENABLE bit. We don't really need this wait right now due to the wait I already mentioned, but at least this one has a reason to be there, while the other one is just to workaround some problem: we may remove it in the future.

Quoted 3 lines

The wait also acts as a POSTING_READ which we missed.

Both patches:

I was thinking that maybe the intel_wait_for_vblank would be better from a documenting perspective - and it would also give warnings for trying to enable ips whilst the pipe was off. But you would still need the wait for IPS_ENABLE as confirmation anyway.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Both queued for -next, thanks for the patches&review.

Hmmm, this patch depends on the "enable planes only after the pipe is really running" patch. Due to that missing patch, now I get "[drm:hsw_enable_ips] *ERROR* Timed out waiting for IPS enable" when booting. I should have said this, sorry :(

Ok, I've dropped it again.

It should be safe to merge it now.

Quoted 5 lines

-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

Signature · 1 line
Paulo Zanoni
#8 lore raw

Re: [PATCH 2/2] drm/i915: wait for IPS_ENABLE when enabling IPS

Quoted 34 lines · Paulo Zanoni

2013/9/20 Daniel Vetter <[email protected]>:

Quoted 33 lines · Paulo Zanoni
Quoted 32 lines

2013/9/20 Daniel Vetter <[email protected]>:

Quoted 30 lines · Chris Wilson
Quoted 20 lines · Paulo Zanoni
Quoted 15 lines

From: Paulo Zanoni <[email protected]>

At the end of haswell_crtc_enable we have an intel_wait_for_vblank with a big comment, and the message suggests it's a workaround for something we don't really understand. So I removed that wait and started getting HW state readout error messages saying that the IPS state is not what we expected.

I investigated and concluded that after you write IPS_ENABLE to IPS_CTL, the bit will only actually become 1 on the next vblank. So add code to wait for the IPS_ENABLE bit. We don't really need this wait right now due to the wait I already mentioned, but at least this one has a reason to be there, while the other one is just to workaround some problem: we may remove it in the future.

Quoted 3 lines

The wait also acts as a POSTING_READ which we missed.

Quoted 7 lines

Both patches:

I was thinking that maybe the intel_wait_for_vblank would be better from a documenting perspective - and it would also give warnings for trying to enable ips whilst the pipe was off. But you would still need the wait for IPS_ENABLE as confirmation anyway.

Both queued for -next, thanks for the patches&review.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

Hmmm, this patch depends on the "enable planes only after the pipe is really running" patch. Due to that missing patch, now I get "[drm:hsw_enable_ips] *ERROR* Timed out waiting for IPS enable" when booting. I should have said this, sorry :(

Ok, I've dropped it again.

It should be safe to merge it now.

Done, thanks for the ping.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch