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

Joonas Lahtinen joonas.lahtinen at linux.intel.com
Fri Jul 29 09:34:53 UTC 2016


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() and then
> > > 
> > > _is_idle/inactive/whatever() { return !object_active_mask() }
> > > 
> > > Because the negation is used lot more.
> > 10 i915_gem_object_is_active(), 1 !i915_gem_object_is_active(). Of which
> > 4 use the mask and the rest as a boolean.
> Plus another 5 using the READ_ONCE() variant who only look at the active
> mask.

Being used more does not make it less ugly, quite the contrary...

_is_() returns boolean, _get_() might be mask if you insist

Regards, Joonas

> -Chris
> 
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation


More information about the Intel-gfx mailing list