Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: use hrtimer in wait for vblank
@ 2014-03-24  8:13 Arun R Murthy
  2014-03-24  8:51 ` Chris Wilson
  0 siblings, 1 reply; 10+ messages in thread
From: Arun R Murthy @ 2014-03-24  8:13 UTC (permalink / raw)
  To: daniel.vetter, jani.nikula, intel-gfx, airlied; +Cc: Arun R Murthy

In wait for vblank use usleep_range, which will use hrtimers instead of
msleep. Using msleep(1~20) there are more chances of sleeping for 20ms.
Using usleep_range uses hrtimers and hence are precise, worst case will
trigger an interrupt at the higher/max timeout.

Signed-off-by: Arun R Murthy <arun.r.murthy@intel.com>
---
 drivers/gpu/drm/i915/intel_drv.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 44067bc..079280a 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -52,7 +52,7 @@
 			break;						\
 		}							\
 		if (W && drm_can_sleep())  {				\
-			msleep(W);					\
+			usleep_range(W * 1000, W * 2 * 1000);		\
 		} else {						\
 			cpu_relax();					\
 		}							\
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-03-24 10:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-24  8:13 [PATCH] drm/i915: use hrtimer in wait for vblank Arun R Murthy
2014-03-24  8:51 ` Chris Wilson
2014-03-24  9:22   ` Murthy, Arun R
2014-03-24  9:23   ` Jani Nikula
2014-03-24  9:34     ` Murthy, Arun R
2014-03-24  9:48       ` Chris Wilson
2014-03-24  9:55         ` Daniel Vetter
2014-03-24  9:59           ` Murthy, Arun R
2014-03-24 10:00       ` Daniel Vetter
2014-03-24 10:14         ` Murthy, Arun R

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox