[igt-dev] [PATCH i-g-t 8/9] lib/igt_fb: Speed up format conversion for local memory

Imre Deak imre.deak at intel.com
Wed Jan 29 18:16:00 UTC 2020


To speed up the conversion that needs to read from a dGFX local memory
use the same trick as what's used for GTT apertures and make a copy
first into system memory.

Signed-off-by: Imre Deak <imre.deak at intel.com>
---
 lib/igt_fb.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 30f3bfba..ef3fa2ed 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -3427,6 +3427,10 @@ static void create_cairo_surface__convert(int fd, struct igt_fb *fb)
 	if (use_enginecopy(fb) || use_blitter(fb) ||
 	    igt_vc4_is_tiled(fb->modifier)) {
 		setup_linear_mapping(&blit->base);
+
+		/* speed things up by working from a copy in system memory */
+		cvt.src.slow_reads =
+			is_i915_device(fd) && !gem_has_mappable_ggtt(fd);
 	} else {
 		blit->base.linear.fb = *fb;
 		blit->base.linear.fb.gem_handle = 0;
-- 
2.23.1



More information about the igt-dev mailing list