diff mbox series

[FFmpeg-devel,1/3] hwcontext_vulkan: expose image queue families

Message ID MzjuD2p--3-2@lynne.ee
State New
Headers show
Series [FFmpeg-devel,1/3] hwcontext_vulkan: expose image queue families | expand

Checks

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

Commit Message

Lynne April 3, 2022, 2:51 p.m. UTC
This allows for queue transition operations to be signalled.

Patch attached.
diff mbox series

Patch

From e1ddb02864a772a0c9ce117c3f68a248c2550853 Mon Sep 17 00:00:00 2001
From: Lynne <dev@lynne.ee>
Date: Sun, 3 Apr 2022 16:40:17 +0200
Subject: [PATCH 1/3] hwcontext_vulkan: expose image queue families

---
 libavutil/hwcontext_vulkan.c | 2 ++
 libavutil/hwcontext_vulkan.h | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index 237caa4bc0..1176858545 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -2111,6 +2111,7 @@  static int create_frame(AVHWFramesContext *hwfc, AVVkFrame **frame,
             return AVERROR_EXTERNAL;
         }
 
+        f->queue_family[i] = p->num_qfs > 1 ? VK_QUEUE_FAMILY_IGNORED : p->qfs[0];
         f->layout[i] = create_info.initialLayout;
         f->access[i] = 0x0;
         f->sem_value[i] = 0;
@@ -2794,6 +2795,7 @@  static int vulkan_map_from_drm_frame_desc(AVHWFramesContext *hwfc, AVVkFrame **f
          * offer us anything we could import and sync with, so instead
          * just signal the semaphore we created. */
 
+        f->queue_family[i] = p->num_qfs > 1 ? VK_QUEUE_FAMILY_IGNORED : p->qfs[0];
         f->layout[i] = create_info.initialLayout;
         f->access[i] = 0x0;
         f->sem_value[i] = 0;
diff --git a/libavutil/hwcontext_vulkan.h b/libavutil/hwcontext_vulkan.h
index df86c85b3c..ce8a835c6f 100644
--- a/libavutil/hwcontext_vulkan.h
+++ b/libavutil/hwcontext_vulkan.h
@@ -264,6 +264,12 @@  typedef struct AVVkFrame {
      * Describes the binding offset of each plane to the VkDeviceMemory.
      */
     ptrdiff_t offset[AV_NUM_DATA_POINTERS];
+
+    /**
+     * Queue family of the images. Must be VK_QUEUE_FAMILY_IGNORED if
+     * the image was allocated with the CONCURRENT concurrency option.
+     */
+    uint32_t queue_family[AV_NUM_DATA_POINTERS];
 } AVVkFrame;
 
 /**
-- 
2.35.1