diff options
author | wm4 <wm4@nowhere> | 2015-09-25 18:58:49 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-09-25 19:18:16 +0200 |
commit | ac5538c7df460f218d9eaf10f7c0ee17a300ee7b (patch) | |
tree | 4713c373ee8a5d109545ebeefcab7768e57941af /video/vaapi.c | |
parent | 0ae8aebb89b5d0b2226a5d3852a9c72cd52da2ff (diff) | |
download | mpv-ac5538c7df460f218d9eaf10f7c0ee17a300ee7b.tar.bz2 mpv-ac5538c7df460f218d9eaf10f7c0ee17a300ee7b.tar.xz |
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.
Diffstat (limited to 'video/vaapi.c')
-rw-r--r-- | video/vaapi.c | 6 |
1 files changed, 5 insertions, 1 deletions
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); |