* [PATCH 0/2] Small IPS fixes @ 2013-09-19 20:03 Paulo Zanoni 2013-09-19 20:03 ` [PATCH 1/2] drm/i915: POSTING_READ IPS_CTL before waiting for the vblank Paulo Zanoni 2013-09-19 20:03 ` [PATCH 2/2] drm/i915: wait for IPS_ENABLE when enabling IPS Paulo Zanoni 0 siblings, 2 replies; 9+ messages in thread From: Paulo Zanoni @ 2013-09-19 20:03 UTC (permalink / raw) To: intel-gfx; +Cc: Paulo Zanoni From: Paulo Zanoni <paulo.r.zanoni@intel.com> 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(+) -- 1.8.3.1 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/2] drm/i915: POSTING_READ IPS_CTL before waiting for the vblank 2013-09-19 20:03 [PATCH 0/2] Small IPS fixes Paulo Zanoni @ 2013-09-19 20:03 ` Paulo Zanoni 2013-09-19 20:03 ` [PATCH 2/2] drm/i915: wait for IPS_ENABLE when enabling IPS Paulo Zanoni 1 sibling, 0 replies; 9+ messages in thread From: Paulo Zanoni @ 2013-09-19 20:03 UTC (permalink / raw) To: intel-gfx; +Cc: Paulo Zanoni From: Paulo Zanoni <paulo.r.zanoni@intel.com> Make sure we write to IPS before we actually wait. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> --- drivers/gpu/drm/i915/intel_display.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index fc55570..78ff5ed 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -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); -- 1.8.3.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2] drm/i915: wait for IPS_ENABLE when enabling IPS 2013-09-19 20:03 [PATCH 0/2] Small IPS fixes Paulo Zanoni 2013-09-19 20:03 ` [PATCH 1/2] drm/i915: POSTING_READ IPS_CTL before waiting for the vblank Paulo Zanoni @ 2013-09-19 20:03 ` Paulo Zanoni 2013-09-19 20:24 ` Chris Wilson 1 sibling, 1 reply; 9+ messages in thread From: Paulo Zanoni @ 2013-09-19 20:03 UTC (permalink / raw) To: intel-gfx; +Cc: Paulo Zanoni From: Paulo Zanoni <paulo.r.zanoni@intel.com> 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. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> --- drivers/gpu/drm/i915/intel_display.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 78ff5ed..8fd13ab 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -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) -- 1.8.3.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] drm/i915: wait for IPS_ENABLE when enabling IPS 2013-09-19 20:03 ` [PATCH 2/2] drm/i915: wait for IPS_ENABLE when enabling IPS Paulo Zanoni @ 2013-09-19 20:24 ` Chris Wilson 2013-09-20 8:12 ` Daniel Vetter 0 siblings, 1 reply; 9+ messages in thread From: Chris Wilson @ 2013-09-19 20:24 UTC (permalink / raw) To: Paulo Zanoni; +Cc: intel-gfx, Paulo Zanoni On Thu, Sep 19, 2013 at 05:03:06PM -0300, Paulo Zanoni wrote: > From: Paulo Zanoni <paulo.r.zanoni@intel.com> > > 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. > > Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Both patches: Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> 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 -- Chris Wilson, Intel Open Source Technology Centre ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] drm/i915: wait for IPS_ENABLE when enabling IPS 2013-09-19 20:24 ` Chris Wilson @ 2013-09-20 8:12 ` Daniel Vetter 2013-09-20 15:18 ` Paulo Zanoni 0 siblings, 1 reply; 9+ messages in thread From: Daniel Vetter @ 2013-09-20 8:12 UTC (permalink / raw) To: Chris Wilson, Paulo Zanoni, intel-gfx, Paulo Zanoni On Thu, Sep 19, 2013 at 09:24:33PM +0100, Chris Wilson wrote: > On Thu, Sep 19, 2013 at 05:03:06PM -0300, Paulo Zanoni wrote: > > From: Paulo Zanoni <paulo.r.zanoni@intel.com> > > > > 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. > > > > Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> > > Both patches: > Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> > > 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 -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] drm/i915: wait for IPS_ENABLE when enabling IPS 2013-09-20 8:12 ` Daniel Vetter @ 2013-09-20 15:18 ` Paulo Zanoni 2013-09-20 21:49 ` Daniel Vetter 0 siblings, 1 reply; 9+ messages in thread From: Paulo Zanoni @ 2013-09-20 15:18 UTC (permalink / raw) To: Daniel Vetter; +Cc: Intel Graphics Development, Paulo Zanoni 2013/9/20 Daniel Vetter <daniel@ffwll.ch>: > On Thu, Sep 19, 2013 at 09:24:33PM +0100, Chris Wilson wrote: >> On Thu, Sep 19, 2013 at 05:03:06PM -0300, Paulo Zanoni wrote: >> > From: Paulo Zanoni <paulo.r.zanoni@intel.com> >> > >> > 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. >> > >> > Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> >> >> Both patches: >> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> >> >> 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 > -Daniel > -- > Daniel Vetter > Software Engineer, Intel Corporation > +41 (0) 79 365 57 48 - http://blog.ffwll.ch -- Paulo Zanoni ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] drm/i915: wait for IPS_ENABLE when enabling IPS 2013-09-20 15:18 ` Paulo Zanoni @ 2013-09-20 21:49 ` Daniel Vetter 2013-10-08 21:02 ` Paulo Zanoni 0 siblings, 1 reply; 9+ messages in thread From: Daniel Vetter @ 2013-09-20 21:49 UTC (permalink / raw) To: Paulo Zanoni; +Cc: Intel Graphics Development, Paulo Zanoni On Fri, Sep 20, 2013 at 12:18:29PM -0300, Paulo Zanoni wrote: > 2013/9/20 Daniel Vetter <daniel@ffwll.ch>: > > On Thu, Sep 19, 2013 at 09:24:33PM +0100, Chris Wilson wrote: > >> On Thu, Sep 19, 2013 at 05:03:06PM -0300, Paulo Zanoni wrote: > >> > From: Paulo Zanoni <paulo.r.zanoni@intel.com> > >> > > >> > 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. > >> > > >> > Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> > >> > >> Both patches: > >> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> > >> > >> 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 :( Ok, I've dropped it again. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] drm/i915: wait for IPS_ENABLE when enabling IPS 2013-09-20 21:49 ` Daniel Vetter @ 2013-10-08 21:02 ` Paulo Zanoni 2013-10-08 21:58 ` Daniel Vetter 0 siblings, 1 reply; 9+ messages in thread From: Paulo Zanoni @ 2013-10-08 21:02 UTC (permalink / raw) To: Daniel Vetter; +Cc: Intel Graphics Development, Paulo Zanoni 2013/9/20 Daniel Vetter <daniel@ffwll.ch>: > On Fri, Sep 20, 2013 at 12:18:29PM -0300, Paulo Zanoni wrote: >> 2013/9/20 Daniel Vetter <daniel@ffwll.ch>: >> > On Thu, Sep 19, 2013 at 09:24:33PM +0100, Chris Wilson wrote: >> >> On Thu, Sep 19, 2013 at 05:03:06PM -0300, Paulo Zanoni wrote: >> >> > From: Paulo Zanoni <paulo.r.zanoni@intel.com> >> >> > >> >> > 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. >> >> > >> >> > Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> >> >> >> >> Both patches: >> >> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> >> >> >> >> 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 :( > > Ok, I've dropped it again. It should be safe to merge it now. > -Daniel > -- > Daniel Vetter > Software Engineer, Intel Corporation > +41 (0) 79 365 57 48 - http://blog.ffwll.ch -- Paulo Zanoni ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] drm/i915: wait for IPS_ENABLE when enabling IPS 2013-10-08 21:02 ` Paulo Zanoni @ 2013-10-08 21:58 ` Daniel Vetter 0 siblings, 0 replies; 9+ messages in thread From: Daniel Vetter @ 2013-10-08 21:58 UTC (permalink / raw) To: Paulo Zanoni; +Cc: Intel Graphics Development, Paulo Zanoni On Tue, Oct 08, 2013 at 06:02:30PM -0300, Paulo Zanoni wrote: > 2013/9/20 Daniel Vetter <daniel@ffwll.ch>: > > On Fri, Sep 20, 2013 at 12:18:29PM -0300, Paulo Zanoni wrote: > >> 2013/9/20 Daniel Vetter <daniel@ffwll.ch>: > >> > On Thu, Sep 19, 2013 at 09:24:33PM +0100, Chris Wilson wrote: > >> >> On Thu, Sep 19, 2013 at 05:03:06PM -0300, Paulo Zanoni wrote: > >> >> > From: Paulo Zanoni <paulo.r.zanoni@intel.com> > >> >> > > >> >> > 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. > >> >> > > >> >> > Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> > >> >> > >> >> Both patches: > >> >> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> > >> >> > >> >> 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 :( > > > > Ok, I've dropped it again. > > It should be safe to merge it now. Done, thanks for the ping. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2013-10-08 21:57 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-09-19 20:03 [PATCH 0/2] Small IPS fixes Paulo Zanoni 2013-09-19 20:03 ` [PATCH 1/2] drm/i915: POSTING_READ IPS_CTL before waiting for the vblank Paulo Zanoni 2013-09-19 20:03 ` [PATCH 2/2] drm/i915: wait for IPS_ENABLE when enabling IPS Paulo Zanoni 2013-09-19 20:24 ` Chris Wilson 2013-09-20 8:12 ` Daniel Vetter 2013-09-20 15:18 ` Paulo Zanoni 2013-09-20 21:49 ` Daniel Vetter 2013-10-08 21:02 ` Paulo Zanoni 2013-10-08 21:58 ` Daniel Vetter
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox