[FFmpeg-devel] [V2 02/10] libavutil/hwcontext_vulkan: fix a tile mismatch problem

Wenbin Chen wenbin.chen at intel.com
Tue Aug 31 10:24:22 EEST 2021


We should configure VkImageSubresource according to tiling rather than
extension. We use extension to set tiling only when we map from drm.
Normally the output VkImages are not created in this way, and it will
report error when we map these VkImage to drm, so we should configure
VkImageSubresource according to tiling rather than
extension. Now fix it.

Signed-off-by: Wenbin Chen <wenbin.chen at intel.com>
---
 libavutil/hwcontext_vulkan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index 94fdad7f06..88db5b8b70 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -2888,7 +2888,7 @@ static int vulkan_map_to_drm(AVHWFramesContext *hwfc, AVFrame *dst,
     for (int i = 0; i < drm_desc->nb_layers; i++) {
         VkSubresourceLayout layout;
         VkImageSubresource sub = {
-            .aspectMask = p->extensions & EXT_DRM_MODIFIER_FLAGS ?
+            .aspectMask = f->tiling == VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT ?
                           VK_IMAGE_ASPECT_MEMORY_PLANE_0_BIT_EXT :
                           VK_IMAGE_ASPECT_COLOR_BIT,
         };
-- 
2.25.1



More information about the ffmpeg-devel mailing list