Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 395a31ec authored by Francisco Jerez's avatar Francisco Jerez
Browse files

drm/nouveau: Spin for a bit in nouveau_fence_wait() before yielding the CPU.



Sleeping doesn't pay off for very short delays in comparison with the
minimum granularity of schedule_timeout().

Signed-off-by: default avatarFrancisco Jerez <currojerez@riseup.net>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent a3d487ea
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -218,6 +218,7 @@ int
__nouveau_fence_wait(void *sync_obj, void *sync_arg, bool lazy, bool intr)
{
	unsigned long timeout = jiffies + (3 * DRM_HZ);
	unsigned long sleep_time = jiffies + 1;
	int ret = 0;

	while (1) {
@@ -231,7 +232,7 @@ __nouveau_fence_wait(void *sync_obj, void *sync_arg, bool lazy, bool intr)

		__set_current_state(intr ? TASK_INTERRUPTIBLE
			: TASK_UNINTERRUPTIBLE);
		if (lazy)
		if (lazy && time_after_eq(jiffies, sleep_time))
			schedule_timeout(1);

		if (intr && signal_pending(current)) {