On ke, 2016-07-27 at 12:14 +0100, Chris Wilson wrote: > +int __i915_vma_do_pin(struct i915_vma *vma, > + u64 size, u64 alignment, u64 flags); > +static inline int __must_check > +i915_vma_pin(struct i915_vma *vma, u64 size, u64 alignment, u64 flags) > +{ > + BUILD_BUG_ON(PIN_MBZ != I915_VMA_PIN_OVERFLOW); > + BUILD_BUG_ON(PIN_GLOBAL != I915_VMA_GLOBAL_BIND); > + BUILD_BUG_ON(PIN_USER != I915_VMA_LOCAL_BIND); > + > + /* Pin early to prevent the shrinker/eviction logic from destroying > + * our vma as we insert and bind. > + */ > + if (likely(((++vma->flags ^ flags) & I915_VMA_BIND_MASK) == 0)) > + return 0; GCC can't optimize a separate increment and flags equality test? The expression tries to be tad too smart (but nothing compared to the semaphore funcs). Apart from that, looks good, Reviewed-by: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx> Regards, Joonas -- Joonas Lahtinen Open Source Technology Center Intel Corporation _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx