From ac5538c7df460f218d9eaf10f7c0ee17a300ee7b Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 25 Sep 2015 18:58:49 +0200 Subject: vaapi: use GPU memcpy for reading back from HW surface This makes it much faster if the surface is really mapped from GPU memory. It's slightly slower than system memcpy if used on system memory. We don't really know definitely in which type of memory it's located, so we use the GPU memcpy in all cases. Fixes #2317. --- video/vaapi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'video/vaapi.c') diff --git a/video/vaapi.c b/video/vaapi.c index c2a298f556..16954f7313 100644 --- a/video/vaapi.c +++ b/video/vaapi.c @@ -439,7 +439,11 @@ static struct mp_image *try_download(struct mp_image *src, mp_image_set_size(&tmp, src->w, src->h); // copy only visible part dst = mp_image_pool_get(pool, tmp.imgfmt, tmp.w, tmp.h); if (dst) { - mp_image_copy(dst, &tmp); + va_lock(p->ctx); + mp_check_gpu_memcpy(p->ctx->log, &p->ctx->gpu_memcpy_message); + va_unlock(p->ctx); + + mp_image_copy_gpu(dst, &tmp); mp_image_copy_attributes(dst, src); } va_image_unmap(p->ctx, image); -- cgit v1.2.3