igt-dev.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t v2] lib/igt_fb: Don't use blitter for large buffers
@ 2018-09-11 14:29 Ville Syrjala
  2018-09-11 16:30 ` Chris Wilson
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Ville Syrjala @ 2018-09-11 14:29 UTC (permalink / raw)
  To: igt-dev

From: Ville Syrjälä <ville.syrjala@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.

v2: Throw in some warnings for gtt mmap vs. yf tiling (Chris)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> #v1
---
 lib/igt_fb.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 1ba1aa7c19cf..741f13fa65cf 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -402,6 +402,9 @@ static int create_bo_for_fb(int fd, int width, int height,
 			bo = gem_create(fd, size);
 			gem_set_tiling(fd, bo, igt_fb_mod_to_tiling(tiling), stride);
 
+			igt_warn_on_f(tiling == LOCAL_I915_FORMAT_MOD_Yf_TILED,
+				      "GTT mmap does not support Yf tiling\n");
+
 			gem_set_domain(fd, bo,
 				       I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
 
@@ -1344,6 +1347,9 @@ static void create_cairo_surface__gtt(int fd, struct igt_fb *fb)
 {
 	void *ptr;
 
+	igt_warn_on_f(fb->tiling == LOCAL_I915_FORMAT_MOD_Yf_TILED,
+		      "GTT mmap does not support Yf tiling\n");
+
 	gem_set_domain(fd, fb->gem_handle,
 		       I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
 
@@ -1791,10 +1797,13 @@ 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 {
+		igt_warn_on_f(fb->tiling == LOCAL_I915_FORMAT_MOD_Yf_TILED,
+			      "GTT mmap does not support Yf tiling\n");
 		blit->linear.handle = 0;
 		gem_set_domain(fd, fb->gem_handle,
 			       I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
@@ -1849,8 +1858,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

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-09-13  7:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-11 14:29 [igt-dev] [PATCH i-g-t v2] lib/igt_fb: Don't use blitter for large buffers Ville Syrjala
2018-09-11 16:30 ` Chris Wilson
2018-09-11 17:58 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-09-11 22:49 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2018-09-13  7:33 ` [igt-dev] [PATCH i-g-t v2] " Maxime Ripard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).