From: Sil Vilerino Date: Fri, 25 Aug 2023 21:02:00 +0000 (-0400) Subject: d3d12: Fix Map/Unmap of YUV resources X-Git-Tag: upstream/23.3.3~2754 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c3cf7f3e35c0a2cf5124cf8f6084de84fe3e89ad;p=platform%2Fupstream%2Fmesa.git d3d12: Fix Map/Unmap of YUV resources Restore transfer box original size after temporal per plane dimension calculation. Currently the returned transfer object on Map will have the size (usually downsampled) of the latest plane instead of the overall resource size. Then on unmap, when flushing the changes the received transfer box has the wrong dimensions and only partial data is flushed. Fixes: 12a4f2c1328 ("frontends/va: Also map VAImageBufferType for reading") Part-of: --- diff --git a/src/gallium/drivers/d3d12/d3d12_resource.cpp b/src/gallium/drivers/d3d12/d3d12_resource.cpp index a625347..05d0359 100644 --- a/src/gallium/drivers/d3d12/d3d12_resource.cpp +++ b/src/gallium/drivers/d3d12/d3d12_resource.cpp @@ -1716,7 +1716,7 @@ d3d12_transfer_map(struct pipe_context *pctx, return NULL; } } - + ptrans->box = original_box; d3d12_flush_cmdlist_and_wait(ctx); } @@ -1868,6 +1868,7 @@ d3d12_transfer_unmap(struct pipe_context *pctx, transfer_buf_to_image(ctx, d3d12_resource(planes[plane_slice]), staging_res, trans, 0); } + ptrans->box = original_box; } pipe_resource_reference(&trans->staging_res, NULL);