[FFmpeg-devel] [PATCH 55/97] Vulkan patchset part 2 - hwcontext rewrite and filtering

Anton Khirnov anton at khirnov.net
Tue May 16 16:31:55 EEST 2023


Quoting Lynne (2023-05-11 20:55:40)
> May 11, 2023, 18:04 by anton at khirnov.net:
> 
> > Quoting Lynne (2023-04-24 17:56:38)
> >
> >> From b0c429d0d77d1789b6349bc6b296449ae1f8e9da Mon Sep 17 00:00:00 2001
> >> From: Lynne <dev at lynne.ee>
> >> Date: Tue, 15 Mar 2022 23:00:32 +0100
> >> Subject: [PATCH 26/97] hwcontext_vulkan: support threadsafe queue and frame
> >>  operations
> >>
> >> ---
> >>  libavutil/hwcontext_vulkan.c | 176 +++++++++++++++++++++++++----------
> >>  libavutil/hwcontext_vulkan.h |  40 +++++++-
> >>  2 files changed, 167 insertions(+), 49 deletions(-)
> >>
> >> diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
> >> index 894b4b83f3..b0db59b2d8 100644
> >> --- a/libavutil/hwcontext_vulkan.c
> >> +++ b/libavutil/hwcontext_vulkan.c
> >> @@ -27,6 +27,7 @@
> >>  #include <dlfcn.h>
> >>  #endif
> >>  
> >> +#include <pthread.h>
> >>  #include <unistd.h>
> >>  
> >>  #include "config.h"
> >> @@ -92,8 +93,10 @@ typedef struct VulkanDevicePriv {
> >>  VkPhysicalDeviceVulkan13Features device_features_1_3;
> >>  
> >>  /* Queues */
> >> -    uint32_t qfs[5];
> >> -    int num_qfs;
> >> +    pthread_mutex_t **qf_mutex;
> >> +    int nb_tot_qfs;
> >> +    uint32_t img_qfs[5];
> >> +    int nb_img_qfs;
> >>
> >
> > This patch would be so much more readable without random renamings.
> >
> 
> They're not random, the meaning of each variable is different
> to what they meant before.
> nb_img_qfs is the total number of enabled queue familiesnb_tot_qfs is the total number of queue families listed by the driver
> 
> 
> >> /* Debug callback */
> >>  VkDebugUtilsMessengerEXT debug_ctx;
> >> @@ -127,6 +130,8 @@ typedef struct VulkanFramesPriv {
> >>  } VulkanFramesPriv;
> >>  
> >>  typedef struct AVVkFrameInternal {
> >> +    pthread_mutex_t update_mutex;
> >>
> >
> > As far as I can see, none of the mutices you're adding here are
> > ever destroyed.
> >
> 
> Fixed.

In your current tree you're only destrying update_mutex, not qf_mutexes.

And not checking thre creation of update_mutex.

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list