[Intel-gfx] [PATCH igt 1/2] lib: Refactor igt_wait() to use library timers
Chris Wilson
chris at chris-wilson.co.uk
Fri Jan 26 21:36:09 UTC 2018
Quoting Antonio Argenziano (2018-01-26 16:50:15)
>
>
> On 25/01/18 13:28, Chris Wilson wrote:
> > Use the timer routines for computing elapsed time from igt_core for
> > smaller code.
> >
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > ---
> > lib/igt_aux.h | 25 +++++++++++--------------
> > 1 file changed, 11 insertions(+), 14 deletions(-)
> >
> > diff --git a/lib/igt_aux.h b/lib/igt_aux.h
> > index 02e70126c..48ba7970f 100644
> > --- a/lib/igt_aux.h
> > +++ b/lib/igt_aux.h
> > @@ -29,6 +29,7 @@
> > #define IGT_AUX_H
> >
> > #include <intel_bufmgr.h>
> > +#include <inttypes.h>
> > #include <stdbool.h>
> > #include <stddef.h>
> > #include <sys/time.h>
> > @@ -251,28 +252,24 @@ void igt_unlock_mem(void);
> > * True of COND evaluated to true, false otherwise.
> > */
> > #define igt_wait(COND, timeout_ms, interval_ms) ({ \
> > - struct timeval start_, end_, diff_; \
> > - int elapsed_ms_; \
> > - bool ret_ = false; \
> > + struct timespec tv = {}; \
> > + bool ret_; \
> > \
> > - igt_assert(gettimeofday(&start_, NULL) == 0); \
> > do { \
> > + uint64_t elapsed = igt_nsec_elapsed(&tv) >> 20; \
>
> Maybe tv_ and elapsed_ just for consistency.
>
> Reviewed-by: Antonio Argenziano <antonio.argenziano at intel.com>
Corrected and pushed, thanks!
-Chris
More information about the Intel-gfx
mailing list