From: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx> It will be used in a later patch. v2: Rebased for fb modifiers. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx> Reviewed-by: Michel Thierry <michel.thierry@xxxxxxxxx> --- drivers/gpu/drm/i915/intel_display.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index c54a6e9..7a5d0a7 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -2189,13 +2189,11 @@ static bool need_vtd_wa(struct drm_device *dev) return false; } -int -intel_fb_align_height(struct drm_device *dev, int height, - uint32_t pixel_format, - uint64_t fb_format_modifier) +static int +intel_tile_height(struct drm_device *dev, uint32_t bits_per_pixel, + uint64_t fb_format_modifier) { int tile_height; - uint32_t bits_per_pixel; switch (fb_format_modifier) { case DRM_FORMAT_MOD_NONE: @@ -2208,7 +2206,6 @@ intel_fb_align_height(struct drm_device *dev, int height, tile_height = 32; break; case I915_FORMAT_MOD_Yf_TILED: - bits_per_pixel = drm_format_plane_cpp(pixel_format, 0) * 8; switch (bits_per_pixel) { default: case 8: @@ -2234,7 +2231,17 @@ intel_fb_align_height(struct drm_device *dev, int height, break; } - return ALIGN(height, tile_height); + return tile_height; +} + +int +intel_fb_align_height(struct drm_device *dev, int height, uint32_t pixel_format, + uint64_t fb_format_modifier) +{ + uint32_t bits_per_pixel = drm_format_plane_cpp(pixel_format, 0) * 8; + + return ALIGN(height, intel_fb_tile_height(dev, bits_per_pixel, + fb_format_modifier)); } int -- 2.3.0 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/intel-gfx