[igt-dev] [PATCH 04/10] lib/igt_fb: Remove set_tiling calls on devices without HW tiling support

Vanshidhar Konda vanshidhar.r.konda at intel.com
Wed Dec 18 19:39:09 UTC 2019


On devices that don't support tiling/de-tiling in HW, skip the usage
of the SET_TILING IOCTL and use blitter for drawing.

Signed-off-by: Vanshidhar Konda <vanshidhar.r.konda at intel.com>
---
 lib/igt_fb.c | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 35a50eeb..2843ab4d 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -922,9 +922,11 @@ static int create_bo_for_fb(struct igt_fb *fb)
 
 		if (is_i915_device(fd)) {
 			fb->gem_handle = gem_create(fd, fb->size);
-			gem_set_tiling(fd, fb->gem_handle,
-				       igt_fb_mod_to_tiling(fb->modifier),
-				       fb->strides[0]);
+			if (gem_has_legacy_hw_tiling(fd)) {
+				gem_set_tiling(fd, fb->gem_handle,
+					       igt_fb_mod_to_tiling(fb->modifier),
+					       fb->strides[0]);
+			}
 		} else if (is_vc4_device(fd)) {
 			fb->gem_handle = igt_vc4_create_bo(fd, fb->size);
 
@@ -1962,9 +1964,14 @@ static bool use_enginecopy(const struct igt_fb *fb)
 
 static bool use_blitter(const struct igt_fb *fb)
 {
+	if (!blitter_ok(fb))
+		return false;
+
+	if (!gem_has_legacy_hw_tiling(fb->fd))
+		return true;
+
 	return (fb->modifier == I915_FORMAT_MOD_Y_TILED ||
-		fb->modifier == I915_FORMAT_MOD_Yf_TILED) &&
-		blitter_ok(fb);
+		fb->modifier == I915_FORMAT_MOD_Yf_TILED);
 }
 
 static void init_buf(struct fb_blit_upload *blit,
@@ -3381,8 +3388,10 @@ cairo_surface_t *igt_get_cairo_surface(int fd, struct igt_fb *fb)
 		else if (use_blitter(fb) || use_enginecopy(fb) ||
 			 igt_vc4_is_tiled(fb->modifier))
 			create_cairo_surface__gpu(fd, fb);
-		else
+		else if (gem_has_mappable_ggtt(fd))
 			create_cairo_surface__gtt(fd, fb);
+		else
+			igt_assert_f(false, "Configuration not supported.\n");
 	}
 
 	igt_assert(cairo_surface_status(fb->cairo_surface) == CAIRO_STATUS_SUCCESS);
-- 
2.24.0



More information about the igt-dev mailing list