[Intel-gfx] [PATCH] drm/i915: Round up the watermark entries (v2)

Jesse Barnes jbarnes at virtuousgeek.org
Mon Jul 19 20:43:50 CEST 2010


On Mon, 19 Jul 2010 19:37:07 +0100
Chris Wilson <chris at chris-wilson.co.uk> wrote:

> Even though "we have enough padding that it should be ok", round up the
> watermark entries to the next unit to be on the safe side...
> 
> v2: Use the DIV_ROUND_UP macro
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Jesse Barnes <jbarnes at virtuousgeek.org>
> ---
>  drivers/gpu/drm/i915/intel_display.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index f674b7a..aae3686 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -2727,7 +2727,7 @@ static unsigned long intel_calculate_wm(unsigned long clock_in_khz,
>  	 */
>  	entries_required = ((clock_in_khz / 1000) * pixel_size * latency_ns) /
>  		1000;
> -	entries_required /= wm->cacheline_size;
> +	entries_required = DIV_ROUND_UP(entries_required, wm->cacheline_size);
>  
>  	DRM_DEBUG_KMS("FIFO entries required for mode: %d\n", entries_required);
>  

Looks good to me, thanks.

Reviewed-by: Jesse Barnes <jbarnes at virtuousgeek.org>

-- 
Jesse Barnes, Intel Open Source Technology Center



More information about the Intel-gfx mailing list