From nobody Sun Feb 8 02:34:52 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D890F1E505; Thu, 24 Apr 2025 13:03:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745499786; cv=none; b=sVQ377itSXFxGg+0voldfpLaxKbGXBKjIH4GEUl5YUHBiUkRcmuz+YsjIZw6D67TmyyxNauHmrmHb/JxuLb8uhru+/i3eNG6LM68LmjBhAYANcWwLHvB1vhvp7DvXB/a0+GKE+d1GoqUGvwJ64NLkbHmd7ZUxsaClvxXT0qdwb8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745499786; c=relaxed/simple; bh=gPWCxoadIqVtSMMGHWG/UCPRWgUQVOp3Fj5VLuUySs4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gcKcK5q394OtGcvIGdLqd3qJNfvJkamEgb9dp2MUmroBFBh0sA/YUcQZq2p793zVg0aU5nfARHTdowvrbkPa7g+MXRvmFVhryKrE6aE5Qm3ubnz+mF13x6D0SzO4l0e1EQvB2ZUPEOruE9hws/+57fkiaXLwclmOvtIBNxVB1KM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OuIAF3o8; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OuIAF3o8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D8AEC4CEE8; Thu, 24 Apr 2025 13:03:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1745499786; bh=gPWCxoadIqVtSMMGHWG/UCPRWgUQVOp3Fj5VLuUySs4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OuIAF3o8gBJCPobsasDKKhnTUEZfbjrmskGmB99m8DrSD3D3mDxOO133zbPYAujnv 7lDiC+PmVM6stYqKnxsL8B2Z8CzsLaHd5inZ9D104dNrvETcyq9vITA1iYTckqDgfJ 2ehreIVEznOqxcGGvGkmmJO0CVPtTQ4kfV6mJdo+LA39qk0a6tyPVO/+GYX9jro44i v+Z1chUrxKuroO7aPafFB1nlbNR/2khHG+Lt4KJdmlOafwlw53mgwqkhekQw/sn8Ec gPJ9/fMSuQvLMF9Om0QSTusCXUku+RGU1fHSGazJMEaLmKbsRYX3RQ6V1gB6GfRAKE ZYnuI+zVNC5Ow== From: Philipp Stanner To: Lyude Paul , Danilo Krummrich , David Airlie , Simona Vetter , Sumit Semwal , =?UTF-8?q?Christian=20K=C3=B6nig?= Cc: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, Philipp Stanner Subject: [PATCH 1/4] drm/nouveau: nouveau_fence: Standardize list iterations Date: Thu, 24 Apr 2025 15:02:51 +0200 Message-ID: <20250424130254.42046-3-phasta@kernel.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250424130254.42046-2-phasta@kernel.org> References: <20250424130254.42046-2-phasta@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" nouveau_fence.c iterates over lists in a non-canonical way. Since the operations done are just basic for-each-loops and list-empty checks, they should be written in the standard form. Use standard list operations. Signed-off-by: Philipp Stanner --- drivers/gpu/drm/nouveau/nouveau_fence.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c b/drivers/gpu/drm/nouv= eau/nouveau_fence.c index 6ded8c2b6d3b..761c174cb286 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fence.c +++ b/drivers/gpu/drm/nouveau/nouveau_fence.c @@ -83,13 +83,11 @@ nouveau_local_fence(struct dma_fence *fence, struct nou= veau_drm *drm) void nouveau_fence_context_kill(struct nouveau_fence_chan *fctx, int error) { - struct nouveau_fence *fence; + struct nouveau_fence *fence, *tmp; unsigned long flags; =20 spin_lock_irqsave(&fctx->lock, flags); - while (!list_empty(&fctx->pending)) { - fence =3D list_entry(fctx->pending.next, typeof(*fence), head); - + list_for_each_entry_safe(fence, tmp, &fctx->pending, head) { if (error && !dma_fence_is_signaled_locked(&fence->base)) dma_fence_set_error(&fence->base, error); =20 @@ -130,13 +128,11 @@ nouveau_fence_context_free(struct nouveau_fence_chan = *fctx) static int nouveau_fence_update(struct nouveau_channel *chan, struct nouveau_fence_ch= an *fctx) { - struct nouveau_fence *fence; + struct nouveau_fence *fence, *tmp; int drop =3D 0; u32 seq =3D fctx->read(chan); =20 - while (!list_empty(&fctx->pending)) { - fence =3D list_entry(fctx->pending.next, typeof(*fence), head); - + list_for_each_entry_safe(fence, tmp, &fctx->pending, head) { if ((int)(seq - fence->base.seqno) < 0) break; =20 @@ -151,15 +147,14 @@ nouveau_fence_uevent_work(struct work_struct *work) { struct nouveau_fence_chan *fctx =3D container_of(work, struct nouveau_fen= ce_chan, uevent_work); + struct nouveau_channel *chan; + struct nouveau_fence *fence; unsigned long flags; int drop =3D 0; =20 spin_lock_irqsave(&fctx->lock, flags); - if (!list_empty(&fctx->pending)) { - struct nouveau_fence *fence; - struct nouveau_channel *chan; - - fence =3D list_entry(fctx->pending.next, typeof(*fence), head); + fence =3D list_first_entry_or_null(&fctx->pending, typeof(*fence), head); + if (fence) { chan =3D rcu_dereference_protected(fence->channel, lockdep_is_held(&fctx= ->lock)); if (nouveau_fence_update(chan, fctx)) drop =3D 1; --=20 2.48.1 From nobody Sun Feb 8 02:34:52 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B7E2328135F; Thu, 24 Apr 2025 13:03:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745499789; cv=none; b=OaLzRNea5z9oobWQAxZYrgsuxP1z2AuC9yQ7SlRwLuwDXZUOvbOqRwBtDpg0EHJOOAlO5PjNK7xmz3qQZDEnRHSYWISEzmIpoOFp5cWyUZuLrLi9eMfMpMFzlZ0GdfawCcBvTrtIdbNjBzG1VYW6DHG5RNjUIf97lvtT3LNu48o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745499789; c=relaxed/simple; bh=7HKtlHM65HuEx4XWBvP6kV1rjNjQ+ivJbYPYEkVX5fQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SrolIhka9SeRWVXT5DFJ/4S3EfUtMxPe7iHSdlE4bzQfHj6s1OTuon3RztarAVIDfS1oD2ykoJptrJDDz/ogUGfpKc34rK8Kz9PGzWHR/S9GscZmVVVIZKE9Iu5VxmJGpSs1LDy9ed3qpG2xcmGDJ2Kje8UPFfMm89NDGSr0P4Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=M8OaBxMw; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="M8OaBxMw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1130C4CEE3; Thu, 24 Apr 2025 13:03:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1745499789; bh=7HKtlHM65HuEx4XWBvP6kV1rjNjQ+ivJbYPYEkVX5fQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M8OaBxMwa5+pwS9Z9fqr7blGKVdU4MvbySsUzbZ3oIq/VUy6/gNEfW9mqIGPqcPpv szTiQwGU4sNbanmGK4oVx9F71hyBgmy3VCX0gDfteossxz4wikzfyeXyofvuz8zI1Q t4yJ0otnFaGQ3CY3mibzOvwABhU2P3jWvjbkLHnpIHhBEPujr5daB1tPwgVuzGDGY9 WUOIq+UPUkStsajJL2qrPONxq3E/UdkBflUy9OWGE1FUKI6aY4U9Y6gzSqeTVYvTOI phFs8CiNMFxFrlVL2hSTTlbD5ag+ecB72/aC6Fw4a8Jcs0IxSrcwsVXHQK5ERIIxij Lh98iaybaaHlQ== From: Philipp Stanner To: Lyude Paul , Danilo Krummrich , David Airlie , Simona Vetter , Sumit Semwal , =?UTF-8?q?Christian=20K=C3=B6nig?= Cc: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, Philipp Stanner Subject: [PATCH 2/4] drm/nouveau: Simplify calls to nvif_event_block() Date: Thu, 24 Apr 2025 15:02:52 +0200 Message-ID: <20250424130254.42046-4-phasta@kernel.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250424130254.42046-2-phasta@kernel.org> References: <20250424130254.42046-2-phasta@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" nouveau_fence_signal() returns a de-facto boolean to indicate when nvif_event_block() shall be called. The code can be made more compact and readable by calling nvif_event_block() in nouveau_fence_update() directly. Make those calls in nouveau_fence.c more canonical. Signed-off-by: Philipp Stanner --- drivers/gpu/drm/nouveau/nouveau_fence.c | 31 +++++++++++-------------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c b/drivers/gpu/drm/nouv= eau/nouveau_fence.c index 761c174cb286..2b79bcb7da16 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fence.c +++ b/drivers/gpu/drm/nouveau/nouveau_fence.c @@ -50,10 +50,10 @@ nouveau_fctx(struct nouveau_fence *fence) return container_of(fence->base.lock, struct nouveau_fence_chan, lock); } =20 -static int +static bool nouveau_fence_signal(struct nouveau_fence *fence) { - int drop =3D 0; + bool drop =3D false; =20 dma_fence_signal_locked(&fence->base); list_del(&fence->head); @@ -63,7 +63,7 @@ nouveau_fence_signal(struct nouveau_fence *fence) struct nouveau_fence_chan *fctx =3D nouveau_fctx(fence); =20 if (!--fctx->notify_ref) - drop =3D 1; + drop =3D true; } =20 dma_fence_put(&fence->base); @@ -125,21 +125,23 @@ nouveau_fence_context_free(struct nouveau_fence_chan = *fctx) kref_put(&fctx->fence_ref, nouveau_fence_context_put); } =20 -static int +static void nouveau_fence_update(struct nouveau_channel *chan, struct nouveau_fence_ch= an *fctx) { struct nouveau_fence *fence, *tmp; - int drop =3D 0; + bool drop =3D false; u32 seq =3D fctx->read(chan); =20 list_for_each_entry_safe(fence, tmp, &fctx->pending, head) { if ((int)(seq - fence->base.seqno) < 0) break; =20 - drop |=3D nouveau_fence_signal(fence); + if (nouveau_fence_signal(fence)) + drop =3D true; } =20 - return drop; + if (drop) + nvif_event_block(&fctx->event); } =20 static void @@ -150,18 +152,13 @@ nouveau_fence_uevent_work(struct work_struct *work) struct nouveau_channel *chan; struct nouveau_fence *fence; unsigned long flags; - int drop =3D 0; =20 spin_lock_irqsave(&fctx->lock, flags); fence =3D list_first_entry_or_null(&fctx->pending, typeof(*fence), head); if (fence) { chan =3D rcu_dereference_protected(fence->channel, lockdep_is_held(&fctx= ->lock)); - if (nouveau_fence_update(chan, fctx)) - drop =3D 1; + nouveau_fence_update(chan, fctx); } - if (drop) - nvif_event_block(&fctx->event); - spin_unlock_irqrestore(&fctx->lock, flags); } =20 @@ -241,9 +238,7 @@ nouveau_fence_emit(struct nouveau_fence *fence) return -ENODEV; } =20 - if (nouveau_fence_update(chan, fctx)) - nvif_event_block(&fctx->event); - + nouveau_fence_update(chan, fctx); list_add_tail(&fence->head, &fctx->pending); spin_unlock_irq(&fctx->lock); } @@ -265,8 +260,8 @@ nouveau_fence_done(struct nouveau_fence *fence) =20 spin_lock_irqsave(&fctx->lock, flags); chan =3D rcu_dereference_protected(fence->channel, lockdep_is_held(&fctx= ->lock)); - if (chan && nouveau_fence_update(chan, fctx)) - nvif_event_block(&fctx->event); + if (chan) + nouveau_fence_update(chan, fctx); spin_unlock_irqrestore(&fctx->lock, flags); } return dma_fence_is_signaled(&fence->base); --=20 2.48.1 From nobody Sun Feb 8 02:34:52 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F9F927CCCD; Thu, 24 Apr 2025 13:03:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745499793; cv=none; b=VPiutb4bhJo2ksUw0qhOEvX6r2uAgcn1vlfBU/Rtmhov6bz3zDjmd7sf3X/5YLo7GKR4fVekrKl0Inhc8Mrtx4T4tbIEICLrTtLbGABLSUTKpnqWH+KQw4AXtsQZf84NxgCChQZlFRivvkqy419BEq1nmrJ+STGt2UBYHuglvUY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745499793; c=relaxed/simple; bh=aWijLvZAk3fD5Xw7QJX+kfKWe8iN4WqFGm8B7OBvTTU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Cyljh/COHKrgfZxHRwo65D8JemmE8f97FgvakehRqX1Q15+9XBbuH3QiRlhIPEg4cEsxf7kAXgd4/8ZT8kZu7PoCcubRh82OQVfhBH6FYHWT41VmswaPxzcuDZTaAA4vPxwHDdaI3vVOzzwWxEVOdbSnJ3cGUKkFJ9x3H8cL1Ag= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=B2Lh/mpy; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="B2Lh/mpy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28138C4CEE3; Thu, 24 Apr 2025 13:03:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1745499793; bh=aWijLvZAk3fD5Xw7QJX+kfKWe8iN4WqFGm8B7OBvTTU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B2Lh/mpyg6zo+cLFVviRJDnFZi/nBDGg4DimbXpvlTQPFJiblEFLaBttf30J/tfsL qAiIkN7UqUdvtJ3oviCRcQdw+aZPD74DZjw1mW7wMFZeu4cq332zYeolBw3Ni+Ts13 zYDMuWsBQ4oEKZ3+BCah67nZ1Pne1kWE5F9lFI0dMvRArtuDx/NHh0Eb80YYCRWoIy 9ntNY7IX/zvmeALASoFEz25PO3JJrgeIrAMiuNuGEIXNruZ/Mj4TiveYn5Dec5Mb7y 7+acEDob32ANTDERpLbBHcbgALkO2RVmCXYrih2oGEbtUOB+4SIEn4xNytpBX+rXBk mEkgiMFZMc4Jg== From: Philipp Stanner To: Lyude Paul , Danilo Krummrich , David Airlie , Simona Vetter , Sumit Semwal , =?UTF-8?q?Christian=20K=C3=B6nig?= Cc: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, Philipp Stanner Subject: [PATCH 3/4] drm/nouveau: Simplify nouveau_fence_done() Date: Thu, 24 Apr 2025 15:02:53 +0200 Message-ID: <20250424130254.42046-5-phasta@kernel.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250424130254.42046-2-phasta@kernel.org> References: <20250424130254.42046-2-phasta@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" nouveau_fence_done() contains an if branch that checks whether a nouveau_fence has either of the two existing nouveau_fence backend ops, which will always evaluate to true. Remove the surplus check. Signed-off-by: Philipp Stanner Reviewed-by: Christian K=C3=B6nig --- drivers/gpu/drm/nouveau/nouveau_fence.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c b/drivers/gpu/drm/nouv= eau/nouveau_fence.c index 2b79bcb7da16..fb9811938c82 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fence.c +++ b/drivers/gpu/drm/nouveau/nouveau_fence.c @@ -249,21 +249,19 @@ nouveau_fence_emit(struct nouveau_fence *fence) bool nouveau_fence_done(struct nouveau_fence *fence) { - if (fence->base.ops =3D=3D &nouveau_fence_ops_legacy || - fence->base.ops =3D=3D &nouveau_fence_ops_uevent) { - struct nouveau_fence_chan *fctx =3D nouveau_fctx(fence); - struct nouveau_channel *chan; - unsigned long flags; + struct nouveau_fence_chan *fctx =3D nouveau_fctx(fence); + struct nouveau_channel *chan; + unsigned long flags; =20 - if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->base.flags)) - return true; + if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->base.flags)) + return true; + + spin_lock_irqsave(&fctx->lock, flags); + chan =3D rcu_dereference_protected(fence->channel, lockdep_is_held(&fctx-= >lock)); + if (chan) + nouveau_fence_update(chan, fctx); + spin_unlock_irqrestore(&fctx->lock, flags); =20 - spin_lock_irqsave(&fctx->lock, flags); - chan =3D rcu_dereference_protected(fence->channel, lockdep_is_held(&fctx= ->lock)); - if (chan) - nouveau_fence_update(chan, fctx); - spin_unlock_irqrestore(&fctx->lock, flags); - } return dma_fence_is_signaled(&fence->base); } =20 --=20 2.48.1 From nobody Sun Feb 8 02:34:52 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E0F4B27D79C; Thu, 24 Apr 2025 13:03:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745499797; cv=none; b=rpMcOYZPg6hLLGrOJMxBEVn9pwK92bcQ+Sgu7scx/7YBVt40TvDVM6q9RY8dDmCH7Z0n9Q/audGmk04efbM0FzszsF/qa/Z1rxV65DJJ338jBvFzBtT5fD399jkpdyq0T/NU8gPZmKfGlWZYtXmIZD1/uR8HVwLbvU8jcy62QZ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745499797; c=relaxed/simple; bh=USBXckrnH4EXDRA/UJxzzOnVtw+ramkDN3MksP0nTXQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=p4Ulqn6uSwaX/e7eCROkm+kP82HSk7zhPPqd3Qi5Z+54I8QNX7oha7tEVNyMgIdKixgIjI7BVQLRyOxcF2NcQ35G41MGGOqxI7S/fGox5rzH+zgXZVeyEfR/yBl88sbOMKWPli090OhdBHNLs/Ee+Yrawbs8qdlTbiL0xVsSqms= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=D80R/pEx; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="D80R/pEx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 860FEC4CEEB; Thu, 24 Apr 2025 13:03:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1745499796; bh=USBXckrnH4EXDRA/UJxzzOnVtw+ramkDN3MksP0nTXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D80R/pExgLSr8RGT1pxOAbZY1lIfYUMaR5c2H3A3/A3AXn3+K50MfkS4OtV/N3V6z GOXn0ZIAVZ5N/DYBNY3FkUbsM6zO810QMgBXenSp3drHLhEnZdY/kg3ct+lfG6LbaX MmZRQ8XlOrkXRMJgkQtQob3wlo1wRG1Nnf1q1ztBNCY3EIqs7WXZq3QcPgfAp7YJL7 5Wvy8mPE/hsMkQJxJNWKkKSa7fIhgp7L8FnQ9D+eifbeVvxWl1FJlc5PQjsFfuVxaA K8tY5jhApZru9r/6JFU9ru3qUbSPw2JjHpwABtqdj7dt8EQtRypHdglTJFtwVVoq82 24i857xMrskmg== From: Philipp Stanner To: Lyude Paul , Danilo Krummrich , David Airlie , Simona Vetter , Sumit Semwal , =?UTF-8?q?Christian=20K=C3=B6nig?= Cc: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, Philipp Stanner Subject: [PATCH 4/4] drm/nouveau: Check dma_fence in canonical way Date: Thu, 24 Apr 2025 15:02:54 +0200 Message-ID: <20250424130254.42046-6-phasta@kernel.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250424130254.42046-2-phasta@kernel.org> References: <20250424130254.42046-2-phasta@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In nouveau_fence_done(), a fence is checked for being signaled by manually evaluating the base fence's bits. This can be done in a canonical manner through dma_fence_is_signaled(). Replace the bit-check with dma_fence_is_signaled(). Signed-off-by: Philipp Stanner --- drivers/gpu/drm/nouveau/nouveau_fence.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c b/drivers/gpu/drm/nouv= eau/nouveau_fence.c index fb9811938c82..d5654e26d5bc 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fence.c +++ b/drivers/gpu/drm/nouveau/nouveau_fence.c @@ -253,7 +253,7 @@ nouveau_fence_done(struct nouveau_fence *fence) struct nouveau_channel *chan; unsigned long flags; =20 - if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->base.flags)) + if (dma_fence_is_signaled(&fence->base)) return true; =20 spin_lock_irqsave(&fctx->lock, flags); --=20 2.48.1