diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-11-28 04:29:55 -0500 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2014-12-05 08:24:45 -0500 |
commit | 9cca30688043eb1b6569f794041dfeec218dffa5 (patch) | |
tree | 608360dc1b0cf66ba2c07013ff2d4c1f4b17abf8 /drivers/gpu | |
parent | 7bd0e226e313547add65c7e4b0ecf65cb981a3c6 (diff) |
drm/i915: Handle inaccurate time conversion issues
So apparently jiffies<->nsec<->ktime isn't accurate or something. At
elast if we timeout there's occasionally still a few hundred us left
(in a 2 second timeout).
Stuff I've tried and thrown out again:
- Sampling the before timestamp before jiffies. Doesn't improve test
path rate at all.
- Using jiffies. Way to inaccurate, which means way too much drift
with signals plus automatic ioctl restarting in userspace. In
hindsight we should have used an absolute timeout, but hey we need
something for v3 of the i915 gem wait interfaces ;-)
- Trying to figure out where accuracy gets lost. gl testcase really
don't care all that much about this (as long as isn't not massively
off), it's just that the testcase gets a bit upset if it receives an
EITME with timeout > 0.
So as long as we're in the ballbark it's good enough. So patch
everything up if we're at most one jiffies off. I get's me a solid
test again.
This regression is probably introduced in
commit 5ed0bdf21a85d78e04f89f15ccf227562177cbd9
Author: Thomas Gleixner <tglx@linutronix.de>
Date: Wed Jul 16 21:05:06 2014 +0000
drm: i915: Use nsec based interfaces
Use ktime_get_raw_ns() and get rid of the back and forth timespec
conversions.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Probably because I'm too lazy to confirm myself and still waiting for
QA ;-)
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: John Stultz <john.stultz@linaro.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82749
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 820bc984082e..4a9faea626db 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -1304,6 +1304,16 @@ int __i915_wait_seqno(struct intel_engine_cs *ring, u32 seqno, | |||
1304 | s64 tres = *timeout - (now - before); | 1304 | s64 tres = *timeout - (now - before); |
1305 | 1305 | ||
1306 | *timeout = tres < 0 ? 0 : tres; | 1306 | *timeout = tres < 0 ? 0 : tres; |
1307 | |||
1308 | /* | ||
1309 | * Apparently ktime isn't accurate enough and occasionally has a | ||
1310 | * bit of mismatch in the jiffies<->nsecs<->ktime loop. So patch | ||
1311 | * things up to make the test happy. We allow up to 1 jiffy. | ||
1312 | * | ||
1313 | * This is a regrssion from the timespec->ktime conversion. | ||
1314 | */ | ||
1315 | if (ret == -ETIME && *timeout < jiffies_to_usecs(1)*1000) | ||
1316 | *timeout = 0; | ||
1307 | } | 1317 | } |
1308 | 1318 | ||
1309 | return ret; | 1319 | return ret; |