[Intel-gfx] [PATCH 01/12] drm/i915: Add wait_for_us

Chris Wilson chris at chris-wilson.co.uk
Tue Feb 2 15:43:42 UTC 2016


On Tue, Feb 02, 2016 at 02:04:55PM +0000, Tvrtko Ursulin wrote:
> 
> 
> On 02/02/16 11:57, Chris Wilson wrote:
> >On Tue, Feb 02, 2016 at 11:06:19AM +0000, Tvrtko Ursulin wrote:
> >>From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> >>
> >>This is for callers who want micro-second precision but are not
> >>waiting from the atomic context.
> >
> >linux/time.h provides us with USEC_PER_MSEC that would help to break up
> >these large numbers better for human consumption.
> >
> >2000 -> 2*USEC_PER_SEC
> >10 -> 10*USEC_PER_MSEC
> >
> >Maybe:
> >
> >#define wait_for_seconds(x) ((x)*USEC_PER_SEC)
> >#define wait_for_milliseconds(x) ((x)*USEC_PER_MSEC)
> >
> >if (_wait_for((I915_READ(pp_stat_reg) & mask) == value,
> >	      wait_for_seconds(5) /* timeout */,
> >	      wait_for_millseconds(10) /* interval */))
> 
> There are only two callers where it would be a bit interesting so it
> just feels like needless change to me at the moment. Better to keep
> the established conventions for these two macros.

I am a bit more concerned that there are any users of _wait_for()
outside of the header.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list