diff mbox

[i-g-t,2/2] lib/igt_fb: Fix gen2 and 915 Y tile sizes

Message ID 1456850318-17137-2-git-send-email-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ville Syrjala March 1, 2016, 4:38 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

gen2 tile dimensions are 128x32 for both X and Y tiling
915 tile dimensions are 512x8 for both X and Y tiling

Fix igt_get_fb_tile_size() to return the correct Y tile dimensions
for these platforms. X tile was fine already.

Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 lib/igt_fb.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 5f23136e01ac..1d5981a3fc6f 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -93,11 +93,16 @@  static void igt_get_fb_tile_size(int fd, uint64_t tiling, int fb_bpp,
 		}
 		break;
 	case LOCAL_I915_FORMAT_MOD_Y_TILED:
-		if (IS_915(devid))
+		if (intel_gen(devid) == 2) {
+			*width_ret = 128;
+			*height_ret = 16;
+		} else if (IS_915(devid)) {
 			*width_ret = 512;
-		else
+			*height_ret = 8;
+		} else {
 			*width_ret = 128;
-		*height_ret = 32;
+			*height_ret = 32;
+		}
 		break;
 	case LOCAL_I915_FORMAT_MOD_Yf_TILED:
 		switch (fb_bpp) {