diff mbox series

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

Message ID 20210831014338.134086-2-wenbin.chen@intel.com
State New
Headers show
Series [FFmpeg-devel,01/10] libavfilter/vulkan: Fix problem when device have queue_count greater than 1
Related show

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Wenbin Chen Aug. 31, 2021, 1:43 a.m. UTC
From: "Chen,Wenbin" <wenbin.chen@intel.com>

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@intel.com>
---
 libavutil/hwcontext_vulkan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

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,
         };