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

Chris Wilson chris at chris-wilson.co.uk
Thu Jan 30 10:24:05 UTC 2020


Quoting Imre Deak (2020-01-29 18:16:00)
> 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);

Any read from WC (including from GGTT) is greatly improved by using
memcpy_from_wc, and it even works with X/Y-tiling through fences.

slow_reads is a question of the mapping, at the time of use.
-Chris


More information about the igt-dev mailing list