- va_status = vaUnmapBuffer(va_dpy->va_dpy, image.buf);
- CHECK_VASTATUS(va_status, "vaUnmapBuffer");
- va_status = vaDestroyImage(va_dpy->va_dpy, image.image_id);
- CHECK_VASTATUS(va_status, "vaDestroyImage");
+ qf.frame->data_copy = nullptr;
+
+ // Seemingly vaPutImage() (which triggers a GPU copy) is much nicer to the
+ // CPU than vaDeriveImage() and copying directly into the GPU's buffers.
+ // Exactly why is unclear, but it seems to involve L3 cache usage when there
+ // are many high-res (1080p+) images in play.
+ va_status = vaPutImage(va_dpy->va_dpy, resources.surface, resources.image.image_id, 0, 0, width, height, 0, 0, width, height);
+ CHECK_VASTATUS(va_status, "vaPutImage");