[Intel-gfx] [PATCH 1/5] drm/i915: make pitch_for_width take a tiled arg

Chris Wilson chris at chris-wilson.co.uk
Wed Nov 13 22:59:04 CET 2013


On Wed, Nov 13, 2013 at 10:20:44AM -0800, Jesse Barnes wrote:
> And move it up in the file for earlier usage.
> 
> Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 26 ++++++++++++++++----------
>  1 file changed, 16 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 2df2366..d4cc00c 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -5452,6 +5452,17 @@ static void vlv_crtc_clock_get(struct intel_crtc *crtc,
>  	pipe_config->port_clock = clock.dot / 5;
>  }
>  
> +static u32
> +intel_framebuffer_pitch_for_width(int width, int bpp, bool tiled)
> +{
> +	u32 pitch = DIV_ROUND_UP(width * bpp, 8);
> +
> +	if (tiled)
> +		return ALIGN(pitch, 512);

Should this not go the whole hog and do pot alignment on gen2/3?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre



More information about the Intel-gfx mailing list