On Mon, May 11, 2015 at 04:27:40PM -0700, [email protected] wrote:
> From: Abhay <[email protected]>
> 
> Current WM calculation is causing regression on SR residency.
> Recomputing WM using new formula as provided by VPG

Well, really it's the same formula that's been in use since forever for
watermarks. I think we have at least a couple of copies if that formula
in the wm code (should unify a bit at some point).

However to get DDR DVFS enabled we'll need to go quite a bit beyond
this. In the meantime I suppose we might try to just use the old formula
with some kind of pessimistic latency value (not sure where the 23usec
came from, last time I heard it was 33usec for DDR DVFS, and 11usec for
PM5). But that would probably mean we'd already need to hardcode the
drain latency to a small value. In fact the current drain latency
values we're using still seem insufficient in some cases.

> 
> Change-Id: I9dbd6a7b70c84454748dee41738130934230b763
> Signed-off-by: Abhay <[email protected]>
> ---
>  drivers/gpu/drm/i915/intel_pm.c | 26 +++++++++++++++-----------
>  1 file changed, 15 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index a960cdd..01a5d79 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -1546,6 +1546,13 @@ static int vlv_compute_wm(struct intel_crtc *crtc,
>                         int fifo_size)
>  {
>       int clock, entries, pixel_size;
> +     uint32_t line_time = 0,buffer_wm = 0;
> +
> +     /* using memory DVFS latency of 23usec */
> +     int latency = 23000;
> +
> +     int htotal = crtc->config.adjusted_mode.crtc_htotal;
> +     int hdisplay = to_intel_crtc(crtc)->config.pipe_src_w;
>  
>       /*
>        * FIXME the plane might have an fb
> @@ -1557,18 +1564,15 @@ static int vlv_compute_wm(struct intel_crtc *crtc,
>       pixel_size = drm_format_plane_cpp(plane->base.fb->pixel_format, 0);
>       clock = crtc->config.adjusted_mode.crtc_clock;
>  
> -     entries = DIV_ROUND_UP(clock, 1000) * pixel_size;
> +     line_time = max(htotal * 1000 / clock, 1);
> +
> +     /* Max FIFO size */
> +     fifo_size = 96 * 1024;
> +
> +     buffer_wm = (fifo_size -  (((latency /line_time /1000) + 1 ) *
> +                                                     hdisplay * pixel_size));
> +     return buffer_wm;
>  
> -     /*
> -      * Set up the watermark such that we don't start issuing memory
> -      * requests until we are within PND's max deadline value (256us).
> -      * Idea being to be idle as long as possible while still taking
> -      * advatange of PND's deadline scheduling. The limit of 8
> -      * cachelines (used when the FIFO will anyway drain in less time
> -      * than 256us) should match what we would be done if trickle
> -      * feed were enabled.
> -      */
> -     return fifo_size - clamp(DIV_ROUND_UP(256 * entries, 64), 0, fifo_size 
> - 8);
>  }
>  
>  static bool vlv_compute_sr_wm(struct drm_device *dev,
> -- 
> 2.1.4
> 
> _______________________________________________
> Intel-gfx mailing list
> [email protected]
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

Reply via email to