diff --git a/.pick_status.json b/.pick_status.json index a47eacdb9b8..40fc8030320 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1939,7 +1939,7 @@ "description": "frontends/va: Use correct size for secondary planes.", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "f7a4051b836294ab8f55c71d239e99c5cbf63170" }, diff --git a/src/gallium/frontends/va/surface.c b/src/gallium/frontends/va/surface.c index e95f604ef2c..5ee4a17e1ba 100644 --- a/src/gallium/frontends/va/surface.c +++ b/src/gallium/frontends/va/surface.c @@ -593,8 +593,6 @@ surface_from_external_memory(VADriverContextP ctx, vlVaSurface *surface, res_templ.last_level = 0; res_templ.depth0 = 1; res_templ.array_size = 1; - res_templ.width0 = memory_attribute->width; - res_templ.height0 = memory_attribute->height; res_templ.bind = PIPE_BIND_SAMPLER_VIEW; res_templ.usage = PIPE_USAGE_DEFAULT; @@ -602,6 +600,7 @@ surface_from_external_memory(VADriverContextP ctx, vlVaSurface *surface, whandle.type = WINSYS_HANDLE_TYPE_FD; whandle.handle = memory_attribute->buffers[index]; whandle.modifier = DRM_FORMAT_MOD_INVALID; + whandle.format = templat->buffer_format; // Create a resource for each plane. memset(resources, 0, sizeof resources); @@ -612,6 +611,11 @@ surface_from_external_memory(VADriverContextP ctx, vlVaSurface *surface, goto fail; } + res_templ.width0 = util_format_get_plane_width(templat->buffer_format, i, + memory_attribute->width); + res_templ.height0 = util_format_get_plane_height(templat->buffer_format, i, + memory_attribute->height); + whandle.stride = memory_attribute->pitches[i]; whandle.offset = memory_attribute->offsets[i]; resources[i] = pscreen->resource_from_handle(pscreen, &res_templ, &whandle,