[Intel-gfx] [PATCH 2/8] drm/i915/skl: Extract tile height code into a helper function

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Tue Mar 3 06:22:32 PST 2015


From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

It will be used in a later patch.

v2: Rebased for fb modifiers.
v3: Fixed v2 rebase.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Reviewed-by: Michel Thierry <michel.thierry at intel.com> (v1)
---
 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 abeef74..e6f2533 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_tile_height(dev, bits_per_pixel,
+					       fb_format_modifier));
 }
 
 int
-- 
2.3.0



More information about the Intel-gfx mailing list