Re: [PATCH 52/55] drm/i915: Track active vma requests

Chris Wilson
2016-07-27T10:43:06Z

On Wed, Jul 27, 2016 at 12:47:46PM +0300, Joonas Lahtinen wrote:
> On ma, 2016-07-25 at 18:32 +0100, Chris Wilson wrote:
>
> > diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.h b/drivers/gpu/drm/i915/i915_gem_gtt.h
> > index 529fb483afc8..d2206f40f7b2 100644
> > --- a/drivers/gpu/drm/i915/i915_gem_gtt.h
> > +++ b/drivers/gpu/drm/i915/i915_gem_gtt.h
> >
> > +static inline bool i915_vma_is_active(const struct i915_vma *vma)
> > +{
> > + return vma->active;
> > +}
> > +
> > +static inline void i915_vma_set_active(struct i915_vma *vma,
> > +        unsigned int engine)
> > +{
> > + vma->active |= BIT(engine);
> > +}
> > +
> > +static inline void i915_vma_unset_active(struct i915_vma *vma,
> > +  unsigned int engine)
> > +{
> > + vma->active &= ~BIT(engine);
> > +}
> > +
> > +static inline bool i915_vma_has_active_engine(const struct i915_vma *vma,
> > +       unsigned int engine)
> > +{
> > + return vma->active & BIT(engine);
> > +}
> > +
>
> Are these going to grow more complex? Otherwise looks fine,

No. These were just because I was using similar inlines elsewhere and
wanted a bit of consistency when introducing manual bit operations for
READ_ONCE().
-Chris

--
Chris Wilson, Intel Open Source Technology Centre