From ff14819b96257c10a51574a6d16b740b5243a31a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fran=C3=A7ois=20Tigeot?= Date: Sun, 13 May 2018 09:13:59 +0200 Subject: [PATCH] drm/linux: Add cond_resched() --- sys/dev/drm/i915/intel_uncore.c | 4 ++-- sys/dev/drm/include/linux/sched.h | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/sys/dev/drm/i915/intel_uncore.c b/sys/dev/drm/i915/intel_uncore.c index 5cdc28e5bd..4f1dfe6168 100644 --- a/sys/dev/drm/i915/intel_uncore.c +++ b/sys/dev/drm/i915/intel_uncore.c @@ -25,6 +25,8 @@ #include "intel_drv.h" #include "i915_vgpu.h" +#include + #define FORCEWAKE_ACK_TIMEOUT_MS 50 #define __raw_posting_read(dev_priv__, reg__) (void)__raw_i915_read32((dev_priv__), (reg__)) @@ -284,9 +286,7 @@ void intel_uncore_forcewake_reset(struct drm_device *dev, bool restore) } spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags); -#if 0 cond_resched(); -#endif } WARN_ON(active_domains); diff --git a/sys/dev/drm/include/linux/sched.h b/sys/dev/drm/include/linux/sched.h index 69946277f0..334150fc07 100644 --- a/sys/dev/drm/include/linux/sched.h +++ b/sys/dev/drm/include/linux/sched.h @@ -124,4 +124,12 @@ signal_pending_state(long state, struct lwp *lp) return SIGISMEMBER(pending_set, SIGKILL); } +/* Explicit rescheduling in order to reduce latency */ +static inline int +cond_resched(void) +{ + lwkt_yield(); + return 0; +} + #endif /* _LINUX_SCHED_H_ */ -- 2.11.4.GIT