Re: [Intel-gfx] [PATCH 19/22] drm/i915: Move obj->active:5 to obj->flags

2016-07-29 Thread Joonas Lahtinen
On pe, 2016-07-29 at 09:10 +0100, Chris Wilson wrote: > On Fri, Jul 29, 2016 at 09:04:48AM +0100, Chris Wilson wrote: > > > > On Fri, Jul 29, 2016 at 10:40:09AM +0300, Joonas Lahtinen wrote: > > > > > > _is_active() does not really fit to be assigned to _mask. maybe have > > > object_active_mask(

Re: [Intel-gfx] [PATCH 19/22] drm/i915: Move obj->active:5 to obj->flags

2016-07-29 Thread Chris Wilson
On Fri, Jul 29, 2016 at 09:04:48AM +0100, Chris Wilson wrote: > On Fri, Jul 29, 2016 at 10:40:09AM +0300, Joonas Lahtinen wrote: > > _is_active() does not really fit to be assigned to _mask. maybe have > > object_active_mask() and then > > > > _is_idle/inactive/whatever() { return !object_active_m

Re: [Intel-gfx] [PATCH 19/22] drm/i915: Move obj->active:5 to obj->flags

2016-07-29 Thread Chris Wilson
On Fri, Jul 29, 2016 at 10:40:09AM +0300, Joonas Lahtinen wrote: > On ke, 2016-07-27 at 12:14 +0100, Chris Wilson wrote: > > +static inline void > > +i915_gem_object_set_active(struct drm_i915_gem_object *obj, int engine) > > +{ > > + obj->flags |= 1 << (engine + I915_BO_ACTIVE_SHIFT); > > BIT(e

Re: [Intel-gfx] [PATCH 19/22] drm/i915: Move obj->active:5 to obj->flags

2016-07-29 Thread Joonas Lahtinen
On ke, 2016-07-27 at 12:14 +0100, Chris Wilson wrote: > +static inline void > +i915_gem_object_set_active(struct drm_i915_gem_object *obj, int engine) > +{ > + obj->flags |= 1 << (engine + I915_BO_ACTIVE_SHIFT); BIT(engine) << I915_BO_ACTIVE_SHIFT would be more readable to my taste, but I gues

[Intel-gfx] [PATCH 19/22] drm/i915: Move obj->active:5 to obj->flags

2016-07-27 Thread Chris Wilson
We are motivated to avoid using a bitfield for obj->active for a couple of reasons. Firstly, we wish to document our lockless read of obj->active using READ_ONCE inside i915_gem_busy_ioctl() and that requires an integral type (i.e. not a bitfield). Secondly, gcc produces abysmal code when presented