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 2C8E144D6B for ; Sun, 22 Oct 2023 01:56:39 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4781768C991; Sun, 22 Oct 2023 04:56:38 +0300 (EEST) Received: from w4.tutanota.de (w4.tutanota.de [81.3.6.165]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 58DDF680101 for ; Sun, 22 Oct 2023 04:56:32 +0300 (EEST) Received: from tutadb.w10.tutanota.de (unknown [192.168.1.10]) by w4.tutanota.de (Postfix) with ESMTP id 0F4A21060147 for ; Sun, 22 Oct 2023 01:56:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1697939792; s=s1; d=lynne.ee; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Cc:Date:Date:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:Sender; bh=DDTwqAgLbYuICSBEQgrqfI8fqquxGg1Cz0lc+OxtaN4=; b=JiHBb99NmQKxyX5WbpAg4mf0RrYw+xMj28VwXKx+E+pJ0HuWp2N9Qs+7BtCQbHBY Mh87Yjg821k4cxzXPT+TiHTt31/bRyfcOB0GdveHv/KjOLGTsq98sD6mGpH2C3wZY6J nZFJpepsLBrchSqYyOxMJcYGlFNCUqZ+i9XMs11jVPzsPf6ySKbLjkLURjhia7/+DDW 9Z8WxqqBICjaSXij6kUxU11IpgfencqgJt1TV2bM9VRhvySepsqcQi1bRGN2CFXfbl7 5FAG261JTmWOUgCf0LPIF17OvAK8xegKnG4cBEkyYQwFL5b43gIuKWAWOmsXvpzJoPr o7VJKG+Rsg== Date: Sun, 22 Oct 2023 03:56:32 +0200 (CEST) From: Lynne To: Ffmpeg Devel Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_525515_369204015.1697939792057" Subject: [FFmpeg-devel] hwcontext_vulkan: improve queue family init code 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: ------=_Part_525515_369204015.1697939792057 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit When users zero-init'd the struct, or left it as-is, the encode queue family matched the graphics queue family, which led it to be incorrectly logged as being used for encode. This just improves the logging so this isn't printed anymore. Patch attached. ------=_Part_525515_369204015.1697939792057 Content-Type: text/x-diff; charset=us-ascii; name=0001-hwcontext_vulkan-improve-queue-family-init-code.patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0001-hwcontext_vulkan-improve-queue-family-init-code.patch >From 39ff0b95e9d7038775da8c07af526c4a50b0af24 Mon Sep 17 00:00:00 2001 From: Lynne Date: Sun, 22 Oct 2023 03:52:33 +0200 Subject: [PATCH] hwcontext_vulkan: improve queue family init code When users zero-init'd the struct, or left it as-is, the encode queue family matched the graphics queue family, which led it to be incorrectly logged as being used for encode. This just improves the logging so this isn't printed anymore. --- libavutil/hwcontext_vulkan.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index b955ec483e..4adcc0e839 100644 --- a/libavutil/hwcontext_vulkan.c +++ b/libavutil/hwcontext_vulkan.c @@ -1475,11 +1475,11 @@ static int vulkan_device_init(AVHWDeviceContext *ctx) av_free(qf); - graph_index = hwctx->queue_family_index; - comp_index = hwctx->queue_family_comp_index; - tx_index = hwctx->queue_family_tx_index; - enc_index = hwctx->queue_family_encode_index; - dec_index = hwctx->queue_family_decode_index; + graph_index = hwctx->nb_graphics_queues ? hwctx->queue_family_index : -1; + comp_index = hwctx->nb_comp_queues ? hwctx->queue_family_comp_index : -1; + tx_index = hwctx->nb_tx_queues ? hwctx->queue_family_tx_index : -1; + dec_index = hwctx->nb_decode_queues ? hwctx->queue_family_decode_index : -1; + enc_index = hwctx->nb_encode_queues ? hwctx->queue_family_encode_index : -1; #define CHECK_QUEUE(type, required, fidx, ctx_qf, qc) \ do { \ @@ -1512,10 +1512,10 @@ static int vulkan_device_init(AVHWDeviceContext *ctx) } while (0) CHECK_QUEUE("graphics", 0, graph_index, hwctx->queue_family_index, hwctx->nb_graphics_queues); - CHECK_QUEUE("upload", 1, tx_index, hwctx->queue_family_tx_index, hwctx->nb_tx_queues); CHECK_QUEUE("compute", 1, comp_index, hwctx->queue_family_comp_index, hwctx->nb_comp_queues); - CHECK_QUEUE("encode", 0, enc_index, hwctx->queue_family_encode_index, hwctx->nb_encode_queues); + CHECK_QUEUE("upload", 1, tx_index, hwctx->queue_family_tx_index, hwctx->nb_tx_queues); CHECK_QUEUE("decode", 0, dec_index, hwctx->queue_family_decode_index, hwctx->nb_decode_queues); + CHECK_QUEUE("encode", 0, enc_index, hwctx->queue_family_encode_index, hwctx->nb_encode_queues); #undef CHECK_QUEUE -- 2.42.0 ------=_Part_525515_369204015.1697939792057 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". ------=_Part_525515_369204015.1697939792057--