[igt-dev] [PATCH i-g-t 21/25] lib/igt_fb: Don't use blitter for large buffers

Ville Syrjala ville.syrjala at linux.intel.com
Thu Jul 19 15:04:11 UTC 2018


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

The blitter stride is limited to <32k. Fall back to gtt mmap if we're
about to exceed that.

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 lib/igt_fb.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index a0859230f37f..a81b6069a0b0 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -1786,8 +1786,9 @@ static void create_cairo_surface__convert(int fd, struct igt_fb *fb)
 	blit->rgb24.map = mmap(NULL, blit->rgb24.size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
 	igt_assert(blit->rgb24.map != MAP_FAILED);
 
-	if (fb->tiling == LOCAL_I915_FORMAT_MOD_Y_TILED ||
-	    fb->tiling == LOCAL_I915_FORMAT_MOD_Yf_TILED) {
+	if ((fb->tiling == LOCAL_I915_FORMAT_MOD_Y_TILED ||
+	     fb->tiling == LOCAL_I915_FORMAT_MOD_Yf_TILED) &&
+	    fb->strides[0] < 32768) {
 		setup_linear_mapping(fd, fb, &blit->base.linear);
 	} else {
 		blit->base.linear.fb.gem_handle = 0;
@@ -1842,8 +1843,9 @@ cairo_surface_t *igt_get_cairo_surface(int fd, struct igt_fb *fb)
 	if (fb->cairo_surface == NULL) {
 		if (igt_format_is_yuv(fb->drm_format))
 			create_cairo_surface__convert(fd, fb);
-		else if (fb->tiling == LOCAL_I915_FORMAT_MOD_Y_TILED ||
-		    fb->tiling == LOCAL_I915_FORMAT_MOD_Yf_TILED)
+		else if ((fb->tiling == LOCAL_I915_FORMAT_MOD_Y_TILED ||
+			  fb->tiling == LOCAL_I915_FORMAT_MOD_Yf_TILED) &&
+			 fb->strides[0] < 32768)
 			create_cairo_surface__blit(fd, fb);
 		else
 			create_cairo_surface__gtt(fd, fb);
-- 
2.16.4



More information about the igt-dev mailing list