From patchwork Tue Aug 31 01:43:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenbin Chen X-Patchwork-Id: 29883 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2a4a:0:0:0:0 with SMTP id k10csp4497223iov; Mon, 30 Aug 2021 18:46:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJ41oUTg3/YaBIRln8jrkriAJTBQhpG9dUu4nlE7ssraeGYLatuEcaGOJZuur0Pq84ImN8 X-Received: by 2002:a17:906:3146:: with SMTP id e6mr27863453eje.296.1630374364156; Mon, 30 Aug 2021 18:46:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630374364; cv=none; d=google.com; s=arc-20160816; b=yvhWrgnYnVpNcFI4l0gtYT8P8fVkt5ERwyQKCaY429xP0gnsUPuT48Hz4oBFYKYDVb 50wB3dFL92wS0LAB/cp21te6j5D201HpNVFNJE7+pLuMgKThl8ZkYRkGntwAMZrQmZfy 54InQKsSKR2Tm+DhO2fiDc49c1qF4EVPXt36Sb8txyyhJl00JDmaqnckqDvEklar7vcW n4XUdUu+PIoKxXqN3TnX6R2sLkch8WPq+qzBrdYYVlEiVR2jmL5Q0U6H5fwxUxBtMvzU wtOSAAt1u77sfY6ytKlsxEXJVmNIRIddBt6DOCH/cvuW4gt2agSlMCCWS/CkVK6Fd2Qv qkRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :delivered-to; bh=njcsD77SC/Dionl0xjX0KHezo+vMzyW0V1KIJOwBnHc=; b=Q/AUPxF95sb8aHTiIu/gGYxq/nZlT6RUGMDoj/xRSyF3xtOYOiXKcEX4RvhXuwAwuB V7onFQzNlc4pX+B/nwyFXhNCqP2DIodR2EsAJ3EsoF50oTTJXPlU7CdxC/PU48SLQbVP xtkPyMibvHzShmXJudTqW7O0FI3ZAxUbOLrTsorx3ISfuLwUG+LDn4r+JEOWHt5kfZQ+ BgG6RcJaFF5ewtNlyoAMBjNofd8SXyGPt0Hr0VlMET0USpi73DVhsWAxghCKFT7Q9qpC o8PAfP7YXVtPyzWVFxcOBiZBJoPY77SRReJp9PJBhdtnmrpfGEvPe/KqLi3bMF9x/CiB aNBw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id la20si19279201ejc.3.2021.08.30.18.45.59; Mon, 30 Aug 2021 18:46:04 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EA75468A066; Tue, 31 Aug 2021 04:45:55 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 16EC3689738 for ; Tue, 31 Aug 2021 04:45:47 +0300 (EEST) X-IronPort-AV: E=McAfee;i="6200,9189,10092"; a="216531693" X-IronPort-AV: E=Sophos;i="5.84,365,1620716400"; d="scan'208";a="216531693" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Aug 2021 18:45:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,365,1620716400"; d="scan'208";a="530827015" Received: from chenwenbin-z390-aorus-ultra.sh.intel.com ([10.239.35.5]) by FMSMGA003.fm.intel.com with ESMTP; 30 Aug 2021 18:45:40 -0700 From: wenbin.chen@intel.com To: ffmpeg-devel@ffmpeg.org Date: Tue, 31 Aug 2021 09:43:29 +0800 Message-Id: <20210831014338.134086-1-wenbin.chen@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 01/10] libavfilter/vulkan: Fix problem when device have queue_count greater than 1 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 Cc: "Chen,Wenbin" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: dlcl/fKmAsJc From: "Chen,Wenbin" If the descriptorSetCount is greater than the number of setLayouts, vkAllocateDescriptorSets will report error. Now fix it. Now the following command can run on the device that has queue_count greater than one: ffmpeg -v verbose -init_hw_device vulkan=vul:0 -filter_hw_device vul -i input1080p.264 -vf "hwupload=extra_hw_frames=16,scale_vulkan=1920:1080, hwdownload,format=yuv420p" -f rawvideo output.yuv Signed-off-by: Wenbin Chen --- libavfilter/vulkan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/vulkan.c b/libavfilter/vulkan.c index 337c8d7d5a..e5b070b3e6 100644 --- a/libavfilter/vulkan.c +++ b/libavfilter/vulkan.c @@ -1160,7 +1160,7 @@ void ff_vk_update_descriptor_set(AVFilterContext *avctx, VulkanPipeline *pl, VulkanFilterContext *s = avctx->priv; vkUpdateDescriptorSetWithTemplate(s->hwctx->act_dev, - pl->desc_set[s->cur_queue_idx * pl->desc_layout_num + set_id], + pl->desc_set[set_id], pl->desc_template[set_id], s); } @@ -1179,7 +1179,7 @@ int ff_vk_init_pipeline_layout(AVFilterContext *avctx, VulkanPipeline *pl) VkResult ret; VulkanFilterContext *s = avctx->priv; - pl->descriptor_sets_num = pl->desc_layout_num * s->queue_count; + pl->descriptor_sets_num = pl->desc_layout_num; { /* Init descriptor set pool */ VkDescriptorPoolCreateInfo pool_create_info = {