freedreno/drm: Avoid lock in fd_pipe_del()

If we aren't dropping the last refcnt we don't need the lock.  This
avoids contention between retire-queue against others.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18111>
This commit is contained in:
Rob Clark 2022-08-08 14:52:07 -07:00 committed by Marge Bot
parent 93fa687808
commit 2d0d867935

View file

@ -108,11 +108,22 @@ fd_pipe_ref_locked(struct fd_pipe *pipe)
return pipe;
}
static void
pipe_del_locked(struct fd_pipe *pipe)
{
fd_bo_del_locked(pipe->control_mem);
fd_device_del_locked(pipe->dev);
pipe->funcs->destroy(pipe);
}
void
fd_pipe_del(struct fd_pipe *pipe)
{
if (!p_atomic_dec_zero(&pipe->refcnt))
return;
simple_mtx_lock(&table_lock);
fd_pipe_del_locked(pipe);
pipe_del_locked(pipe);
simple_mtx_unlock(&table_lock);
}
@ -122,9 +133,7 @@ fd_pipe_del_locked(struct fd_pipe *pipe)
simple_mtx_assert_locked(&table_lock);
if (!p_atomic_dec_zero(&pipe->refcnt))
return;
fd_bo_del_locked(pipe->control_mem);
fd_device_del_locked(pipe->dev);
pipe->funcs->destroy(pipe);
pipe_del_locked(pipe);
}
/**