Fix returned timeout in wait_seqno: remaining time, not time slept.
This commit is contained in:
parent
a82af3b335
commit
b3c8e40fbd
18
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c
vendored
18
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c
vendored
@ -1441,8 +1441,22 @@ __wait_seqno(struct intel_ring_buffer *ring, u32 seqno, unsigned reset_counter,
|
||||
|
||||
if (!irq_test_in_progress)
|
||||
ring->irq_put(ring);
|
||||
if (timeout)
|
||||
timespecsub(&after, &before, timeout);
|
||||
if (timeout) {
|
||||
struct timespec slept;
|
||||
|
||||
/* Compute slept = after - before. */
|
||||
timespecsub(&after, &before, &slept);
|
||||
|
||||
/*
|
||||
* Return the time remaining, timeout - slept, if we
|
||||
* slept for less time than the timeout; or zero if we
|
||||
* timed out.
|
||||
*/
|
||||
if (timespeccmp(&slept, timeout, <))
|
||||
timespecsub(timeout, &slept, timeout);
|
||||
else
|
||||
timespecclear(timeout);
|
||||
}
|
||||
return MAX(ret, 0); /* ignore remaining ticks */
|
||||
}
|
||||
#else
|
||||
|
Loading…
Reference in New Issue
Block a user