]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/radeon: restore hardware polling in fence_is_signaled to fix performance regression
authorWang Jiang <jiangwang@kylinos.cn>
Wed, 29 Jul 2026 10:26:26 +0000 (18:26 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 6 Aug 2026 18:33:39 +0000 (14:33 -0400)
commit5f08eee9c3fb1a5a70966612e0ff249900f8e77b
treeac4588613129c2eb1b213b9adf38928fe97602d2
parentff209cd04845d819acc2fcc19b25904b4b7c3ea9
drm/radeon: restore hardware polling in fence_is_signaled to fix performance regression

Commit 527ba26e50ec ("drm/radeon: delete radeon_fence_process in
is_signaled, no deadlock") removed the hardware polling from
radeon_fence_is_signaled() to fix a self-deadlock caused by
wake_up_all(&rdev->fence_queue) being called with the fence queue
lock held.

However, removing the polling entirely causes significant performance
regression (e.g. glxgears FPS drop) because the fence signaled check
becomes purely passive — it only reads the cached last_seq without
probing the GPU, so completed GPU work is not detected in time,
causing unnecessary CPU stalls in sync-heavy workloads.

Fix this by calling radeon_fence_activity() directly instead of
radeon_fence_process(). radeon_fence_activity() reads the hardware
fence counter and updates last_seq via atomic ops without calling
wake_up_all(), thus avoiding the deadlock while restoring timely
fence detection.

Fixes: 527ba26e50ec ("drm/radeon: delete radeon_fence_process in is_signaled, no deadlock")
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Wang Jiang <jiangwang@kylinos.cn>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit f59ad4cca219c7fdf934f712c5860ec5f5900fd7)
Cc: stable@vger.kernel.org
drivers/gpu/drm/radeon/radeon_fence.c