public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: use crtc_htotal when calculating ilk watermarks
@ 2013-12-20 21:08 Jesse Barnes
  2014-01-08  7:50 ` Daniel Vetter
  2014-01-08  9:27 ` Ville Syrjälä
  0 siblings, 2 replies; 3+ messages in thread
From: Jesse Barnes @ 2013-12-20 21:08 UTC (permalink / raw)
  To: intel-gfx

This was introduced in:

commit 7c4a395ff8f441acb7876281c6777624e6410349
Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
Date:   Wed Oct 9 19:17:56 2013 +0300

    drm/i915: Don't re-compute pipe watermarks except for the affected pipe

and I missed fixing it in:

commit fec8cba306f974f3a4491176994de5d821273643
Author: Jesse Barnes <jbarnes@virtuousgeek.org>
Date:   Wed Nov 27 11:10:26 2013 -0800

    drm/i915: use crtc_htotal in watermark calculations to match fastboot v2

It's needed for ILK+ platforms to fastboot without crashing on a divide
by 0 after a DPMS on action.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
---
 drivers/gpu/drm/i915/intel_pm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 469170c..0f1efa4 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -2124,7 +2124,7 @@ static void ilk_compute_wm_parameters(struct drm_crtc *crtc,
 
 	p->active = intel_crtc_active(crtc);
 	if (p->active) {
-		p->pipe_htotal = intel_crtc->config.adjusted_mode.htotal;
+		p->pipe_htotal = intel_crtc->config.adjusted_mode.crtc_htotal;
 		p->pixel_rate = ilk_pipe_pixel_rate(dev, crtc);
 		p->pri.bytes_per_pixel = crtc->fb->bits_per_pixel / 8;
 		p->cur.bytes_per_pixel = 4;
-- 
1.7.9.5

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/i915: use crtc_htotal when calculating ilk watermarks
  2013-12-20 21:08 [PATCH] drm/i915: use crtc_htotal when calculating ilk watermarks Jesse Barnes
@ 2014-01-08  7:50 ` Daniel Vetter
  2014-01-08  9:27 ` Ville Syrjälä
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2014-01-08  7:50 UTC (permalink / raw)
  To: Jesse Barnes; +Cc: intel-gfx

On Fri, Dec 20, 2013 at 01:08:00PM -0800, Jesse Barnes wrote:
> This was introduced in:
> 
> commit 7c4a395ff8f441acb7876281c6777624e6410349
> Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Date:   Wed Oct 9 19:17:56 2013 +0300
> 
>     drm/i915: Don't re-compute pipe watermarks except for the affected pipe
> 
> and I missed fixing it in:
> 
> commit fec8cba306f974f3a4491176994de5d821273643
> Author: Jesse Barnes <jbarnes@virtuousgeek.org>
> Date:   Wed Nov 27 11:10:26 2013 -0800
> 
>     drm/i915: use crtc_htotal in watermark calculations to match fastboot v2
> 
> It's needed for ILK+ platforms to fastboot without crashing on a divide
> by 0 after a DPMS on action.
> 
> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>

Hm, ugly fallout. Double so since with 3d modes using htotal is already a
bug. I think long-term we need to clear out the crtc->config struct and
replace it with only the state we can actually read back from the hw to
catch such bugs reliably. But I think we're still missing a few pieces of
state readback to make this feasible currently :(
-Daniel

> ---
>  drivers/gpu/drm/i915/intel_pm.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 469170c..0f1efa4 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -2124,7 +2124,7 @@ static void ilk_compute_wm_parameters(struct drm_crtc *crtc,
>  
>  	p->active = intel_crtc_active(crtc);
>  	if (p->active) {
> -		p->pipe_htotal = intel_crtc->config.adjusted_mode.htotal;
> +		p->pipe_htotal = intel_crtc->config.adjusted_mode.crtc_htotal;
>  		p->pixel_rate = ilk_pipe_pixel_rate(dev, crtc);
>  		p->pri.bytes_per_pixel = crtc->fb->bits_per_pixel / 8;
>  		p->cur.bytes_per_pixel = 4;
> -- 
> 1.7.9.5
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/i915: use crtc_htotal when calculating ilk watermarks
  2013-12-20 21:08 [PATCH] drm/i915: use crtc_htotal when calculating ilk watermarks Jesse Barnes
  2014-01-08  7:50 ` Daniel Vetter
@ 2014-01-08  9:27 ` Ville Syrjälä
  1 sibling, 0 replies; 3+ messages in thread
From: Ville Syrjälä @ 2014-01-08  9:27 UTC (permalink / raw)
  To: Jesse Barnes; +Cc: intel-gfx

On Fri, Dec 20, 2013 at 01:08:00PM -0800, Jesse Barnes wrote:
> This was introduced in:
> 
> commit 7c4a395ff8f441acb7876281c6777624e6410349
> Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Date:   Wed Oct 9 19:17:56 2013 +0300
> 
>     drm/i915: Don't re-compute pipe watermarks except for the affected pipe

git blame tells me the code has been like that since its introduction
in:

commit 801bcfffbb0721d7131e930f9a46103e539c43a4
Author: Paulo Zanoni <paulo.r.zanoni@intel.com>
Date:   Fri May 31 10:08:35 2013 -0300

    drm/i915: properly set HSW WM_PIPE registers

> 
> and I missed fixing it in:
> 
> commit fec8cba306f974f3a4491176994de5d821273643
> Author: Jesse Barnes <jbarnes@virtuousgeek.org>
> Date:   Wed Nov 27 11:10:26 2013 -0800
> 
>     drm/i915: use crtc_htotal in watermark calculations to match fastboot v2
> 
> It's needed for ILK+ platforms to fastboot without crashing on a divide
> by 0 after a DPMS on action.
> 
> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>

grep didn't find any more non-crtc_ values in intel_pm.c, so hopefully
we're now good.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/intel_pm.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 469170c..0f1efa4 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -2124,7 +2124,7 @@ static void ilk_compute_wm_parameters(struct drm_crtc *crtc,
>  
>  	p->active = intel_crtc_active(crtc);
>  	if (p->active) {
> -		p->pipe_htotal = intel_crtc->config.adjusted_mode.htotal;
> +		p->pipe_htotal = intel_crtc->config.adjusted_mode.crtc_htotal;
>  		p->pixel_rate = ilk_pipe_pixel_rate(dev, crtc);
>  		p->pri.bytes_per_pixel = crtc->fb->bits_per_pixel / 8;
>  		p->cur.bytes_per_pixel = 4;
> -- 
> 1.7.9.5

-- 
Ville Syrjälä
Intel OTC

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-01-08  9:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-20 21:08 [PATCH] drm/i915: use crtc_htotal when calculating ilk watermarks Jesse Barnes
2014-01-08  7:50 ` Daniel Vetter
2014-01-08  9:27 ` Ville Syrjälä

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox