diff options
| author | Dave Airlie <airlied@redhat.com> | 2024-04-17 15:40:32 +1000 |
|---|---|---|
| committer | Danilo Krummrich <dakr@redhat.com> | 2024-06-17 17:05:29 +0200 |
| commit | d45bb9c5f7a6f7b6e47939856b28cb1da0cdc119 (patch) | |
| tree | 34a6e22f8c4a09251236112eb4ddb34b7d22de1f /drivers/gpu/drm/nouveau/nouveau_fence.c | |
| parent | d2e02153f565b1bd8a4ee3a8ae0039dc108f54af (diff) | |
nouveau: rip out busy fence waits
I'm pretty sure this optimisation is actually not a great idea,
and is racy with other things waiting for fences.
Just nuke it, there should be no need to do fence waits in a
busy CPU loop.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Ben Skeggs <bskeggs@nvidia.com>
Signed-off-by: Danilo Krummrich <dakr@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240417054032.3145721-1-airlied@gmail.com
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_fence.c')
| -rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_fence.c | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c b/drivers/gpu/drm/nouveau/nouveau_fence.c index 93f08f9479d8..ba469767a20f 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fence.c +++ b/drivers/gpu/drm/nouveau/nouveau_fence.c @@ -311,39 +311,11 @@ nouveau_fence_wait_legacy(struct dma_fence *f, bool intr, long wait) return timeout - t; } -static int -nouveau_fence_wait_busy(struct nouveau_fence *fence, bool intr) -{ - int ret = 0; - - while (!nouveau_fence_done(fence)) { - if (time_after_eq(jiffies, fence->timeout)) { - ret = -EBUSY; - break; - } - - __set_current_state(intr ? - TASK_INTERRUPTIBLE : - TASK_UNINTERRUPTIBLE); - - if (intr && signal_pending(current)) { - ret = -ERESTARTSYS; - break; - } - } - - __set_current_state(TASK_RUNNING); - return ret; -} - int -nouveau_fence_wait(struct nouveau_fence *fence, bool lazy, bool intr) +nouveau_fence_wait(struct nouveau_fence *fence, bool intr) { long ret; - if (!lazy) - return nouveau_fence_wait_busy(fence, intr); - ret = dma_fence_wait_timeout(&fence->base, intr, 15 * HZ); if (ret < 0) return ret; |
