From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 73244606A31E for ; Thu, 29 Oct 2026 09:59:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=lkHYOsCT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 23D5311217A; Thu, 29 Oct 2026 09:59:23 +0000 (UTC) Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id B3C32112187; Thu, 29 Oct 2026 09:59:16 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 3667060202; Thu, 29 Oct 2026 09:59:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4570B1F01829; Thu, 29 Oct 2026 09:58:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1793267955; bh=TzR0iS7QHEr3XjS3VyvSCg4YGglik9yLN4DV8S4aDGQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=lkHYOsCTkFVL1U8yRfvPJ5LQM5O66jziEjdl0fS4qhg5XrAwQZiZAIcO+FkL8Uee6 LEF1qMxPTYsF45eiNTGuIRhd1orc6LRJa2TrGpcx/oqhyiZ8UrhWHcoE5O230LvGwU Z8m5FBeVHmK3RzUCBBmTRRYUtwLYKwiaMwWTyAzFIqRZmCwnXZcS/AnXFvVUNSN/52 oIG3H2hmGhCVc7oxGv/JEbteBqLgLY97KfSXyuemp5dfN8ZO25PCwQbXNBAIuoYfbD cIRTgtWLTo1n5pVfgUc9hwVpoSrHgSsAkrVRczOUN+dLo4bmpH3m140Y7raMV9s1sY 7Ola2pOJMfgHw== From: Philipp Stanner To: Min Ma , Lizhi Hou , Oded Gabbay , "Rob Herring (Arm)" , Tomeu Vizoso , Karol Wachowski , Andrzej Kacprowski , Sumit Semwal , =?UTF-8?q?Christian=20K=C3=B6nig?= , Felix Kuehling , Alex Deucher , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Lucas Stach , Russell King , Christian Gmeiner , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Alessio Belle , Luigi Santivetti , Qiang Yu , Rob Clark , Dmitry Baryshkov , Abhinav Kumar , Jessica Zhang , Sean Paul , Marijn Suijten , Lyude Paul , Danilo Krummrich , Boris Brezillon , Steven Price , =?UTF-8?q?Adri=C3=A1n=20Larumbe?= , Liviu Dudau , Dave Airlie , Gerd Hoffmann , Matthew Brost , Philipp Stanner , Natalie Vock , Arun Pravin , Matthew Auld , =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= , Melissa Wen , =?UTF-8?q?Ma=C3=ADra=20Canal?= , Dave Stevenson , Raspberry Pi Kernel Maintenance , Dmitry Osipenko , Gurchetan Singh , Chia-I Wu , Zack Rusin , Broadcom internal kernel review list , Thierry Reding , Mikko Perttunen , Jonathan Cameron , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Greg Kroah-Hartman , Sunil Khatri , Kees Cook , Jesse Zhang , =?UTF-8?q?Timur=20Krist=C3=B3f?= , Srinivasan Shanmugam , Kexin Sun , Prike Liang , David Rosca , Krzysztof Karas , Marco Crivellari , Shixiong Ou , =?UTF-8?q?Jouni=20H=C3=B6gander?= , Thadeu Lima de Souza Cascardo , Pierre-Eric Pelloux-Prayer , Joel Fernandes , Al Viro , Neill Kapron , Michael Bommarito , Sam Day , Gabriel Prostitis Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, amd-gfx@lists.freedesktop.org, etnaviv@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, imagination@lists.freedesktop.org, lima@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, nouveau@lists.freedesktop.org, virtualization@lists.linux.dev, spice-devel@lists.freedesktop.org, intel-xe@lists.freedesktop.org, linux-tegra@vger.kernel.org, linux-iio@vger.kernel.org, linux-usb@vger.kernel.org Subject: [RFC PATCH 2/6] dma-buf: dma-fence: Add flag for using 64-bit seqnos Date: Thu, 29 Oct 2026 10:55:39 +0100 Message-ID: <20261029095542.1526750-5-phasta@kernel.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261029095542.1526750-3-phasta@kernel.org> References: <20261029095542.1526750-3-phasta@kernel.org> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Intel-xe" X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 dma_fence_init() now has its own flag field for user options. Use this field to enable 64-bit seqno support through a dedicated field. Signed-off-by: Philipp Stanner --- drivers/dma-buf/dma-fence.c | 8 +++++++- include/linux/dma-fence.h | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c index a640fb99f942..b11ee52a40d8 100644 --- a/drivers/dma-buf/dma-fence.c +++ b/drivers/dma-buf/dma-fence.c @@ -1114,7 +1114,13 @@ dma_fence_init(struct dma_fence *fence, const struct dma_fence_ops *ops, spinlock_t *lock, u64 context, u64 seqno, unsigned long init_flags) { - __dma_fence_init(fence, ops, lock, context, seqno, 0); + unsigned long fence_flag_bits = 0; + + /* Mapp the init_flags to the fence-internal flags. */ + if (test_bit(DMA_FENCE_INIT_FLAG_SEQNO64, &init_flags)) + set_bit(DMA_FENCE_FLAG_SEQNO64_BIT, &fence_flag_bits); + + __dma_fence_init(fence, ops, lock, context, seqno, fence_flag_bits); } EXPORT_SYMBOL(dma_fence_init); diff --git a/include/linux/dma-fence.h b/include/linux/dma-fence.h index 0cb425f7d5e9..6654bcc2441f 100644 --- a/include/linux/dma-fence.h +++ b/include/linux/dma-fence.h @@ -123,9 +123,11 @@ enum dma_fence_flag_bits { * * These flags can be passed in dma_fence_init(). * - * DMA_FENCE_FLAG_SEQNO64_BIT - use 64-bit sequence numbers + * @DMA_FENCE_INIT_FLAG_SEQNO64: Use 64-bit sequence numbers. */ enum dma_fence_init_flags { + DMA_FENCE_INIT_FLAG_SEQNO64, + /* Must always be last member. */ DMA_FENCE_INIT_FLAG_NR_OF_FLAGs, }; -- 2.56.0