From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id AA8CB462DF for ; Thu, 11 May 2023 18:13:36 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5D14968C0A3; Thu, 11 May 2023 21:13:35 +0300 (EEST) Received: from w4.tutanota.de (w4.tutanota.de [81.3.6.165]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A5A9768C05A for ; Thu, 11 May 2023 21:13:29 +0300 (EEST) Received: from tutadb.w10.tutanota.de (unknown [192.168.1.10]) by w4.tutanota.de (Postfix) with ESMTP id 60BB810602EF for ; Thu, 11 May 2023 18:13:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1683828809; s=s1; d=lynne.ee; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Content-Transfer-Encoding:Cc:Date:Date:In-Reply-To:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:References:Sender; bh=DG9jADlIJ1Owb04FLZz1hAUs/Nx/+INdsgKGOpWzV/s=; b=HhXjKgWh9Vhhy20woL5y/AVMuUQHvuvfnRwSyJex/FCqo6MdFJpIhDvV5nBBz854 1V7+Y0ceY9X8YiVfocmmtL9bYv/4PTyT6dEz5TL9gUsYhDO3HeYQ7GV3wBRgpJ6xuEU rwNnQf2EaJ13KpaZQBFvZ3y1CeumEpRY6SFceoMpBumEgszz6uAZOWo4kaKItWd2FPk sW6yxoH7Kth8juJiOcbXLiN8kfB83pUZqzNTgeBwVquBrop5PE5xQQTgdYx7hzTrZ+B /3/xdK1cZ4/PTdT0NzDwkoNu6nPT7R4rWdUnXMnZCax+DBGwmuADbnoDM2wkQOmUZ1i N0iitSPuMQ== Date: Thu, 11 May 2023 20:13:29 +0200 (CEST) From: Lynne To: FFmpeg development discussions and patches Message-ID: In-Reply-To: <168382259881.3843.17606833076993456127@lain.khirnov.net> References: <168382259881.3843.17606833076993456127@lain.khirnov.net> MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 55/97] Vulkan patchset part 2 - hwcontext rewrite and filtering X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: May 11, 2023, 18:30 by anton@khirnov.net: > Quoting Lynne (2023-04-24 17:56:38) > >> From 786a7d08bc90a88f77057fc31d0943dcb91e4558 Mon Sep 17 00:00:00 2001 >> From: Lynne >> Date: Thu, 22 Dec 2022 17:37:51 +0100 >> Subject: [PATCH 53/97] vulkan: add support for retrieving queue, query and >> video properties >> >> --- >> libavutil/vulkan.c | 87 ++++++++++++++++++++++++++++++------ >> libavutil/vulkan.h | 14 ++++-- >> libavutil/vulkan_functions.h | 1 + >> 3 files changed, 85 insertions(+), 17 deletions(-) >> >> diff --git a/libavutil/vulkan.c b/libavutil/vulkan.c >> index de0c300c0e..d045ff83c1 100644 >> --- a/libavutil/vulkan.c >> +++ b/libavutil/vulkan.c >> @@ -108,8 +108,9 @@ const char *ff_vk_ret2str(VkResult res) >> #undef CASE >> } >> >> -void ff_vk_load_props(FFVulkanContext *s) >> +int ff_vk_load_props(FFVulkanContext *s) >> { >> + uint32_t qc = 0; >> FFVulkanFunctions *vk = &s->vkfn; >> >> s->driver_props = (VkPhysicalDeviceDriverProperties) { >> @@ -120,8 +121,48 @@ void ff_vk_load_props(FFVulkanContext *s) >> .pNext = &s->driver_props, >> }; >> >> + >> vk->GetPhysicalDeviceProperties2(s->hwctx->phys_dev, &s->props); >> vk->GetPhysicalDeviceMemoryProperties(s->hwctx->phys_dev, &s->mprops); >> + vk->GetPhysicalDeviceQueueFamilyProperties2(s->hwctx->phys_dev, &qc, s->qf_props); >> + >> + if (s->qf_props) >> + return 0; >> + >> + s->qf_props = av_mallocz(sizeof(*s->qf_props)*qc); >> > > av_calloc() > Fixed (for all 3). > > Also, wouldn't it be better to allocate a single array of > { qf_props; query_props; video_props; } > No, the way they're read requires the array to be contiguous. >> diff --git a/libavutil/vulkan.h b/libavutil/vulkan.h >> index 4bd1c9fc00..4c38dbc2e6 100644 >> --- a/libavutil/vulkan.h >> +++ b/libavutil/vulkan.h >> @@ -216,6 +216,9 @@ typedef struct FFVulkanContext { >> VkPhysicalDeviceProperties2 props; >> VkPhysicalDeviceDriverProperties driver_props; >> VkPhysicalDeviceMemoryProperties mprops; >> + VkQueueFamilyQueryResultStatusPropertiesKHR *query_props; >> + VkQueueFamilyVideoPropertiesKHR *video_props; >> + VkQueueFamilyProperties2 *qf_props; >> > > How does the user of these know how many elements are in each array? > They don't have to, we read the total number of queues available for the device, so all indices are always available. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".