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

Ville Syrjala ville.syrjala at linux.intel.com
Mon Sep 10 15:34:06 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.

This won't work for Yf as the fence doesn't know about Yf. So for that
case we'd need to use cpu mmap and (de)tile manually. For now just
pretend that there is no problem.

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 7c71e52a472b..26720a7bc2ac 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -1795,8 +1795,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->stride < 32768) {
 		setup_linear_mapping(fd, fb, &blit->linear);
 	} else {
 		blit->linear.handle = 0;
@@ -1853,8 +1854,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->stride < 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