va/surface: set the correct size in vaExportSurfaceHandle

The size must be the size of the total object, not the size
of the resource.
For instance, when using a single object for a multi-plane
format, the size of each plane should be equal to the size
of the underlying object to match libva's documentation:

        /** Total size of this object (may include regions which are
         *  not part of the surface). */
        uint32_t size;

Fixes: 13b79266e4 ("frontend/va: Setting the size of VADRMPRIMESurfaceDescriptor")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16813>
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2022-06-01 10:46:11 +02:00
parent 8c07d7cbdd
commit bce227611d

View File

@ -1293,7 +1293,10 @@ vlVaExportSurfaceHandle(VADriverContextP ctx,
}
desc->objects[p].fd = (int)whandle.handle;
desc->objects[p].size = surf->templat.width * surf->templat.height;
/* As per VADRMPRIMESurfaceDescriptor documentation, size must be the
* "Total size of this object (may include regions which are not part
* of the surface)."" */
desc->objects[p].size = (uint32_t) whandle.size;
desc->objects[p].drm_format_modifier = whandle.modifier;
if (flags & VA_EXPORT_SURFACE_COMPOSED_LAYERS) {