[Intel-gfx] [PATCH 17/22] drm/i915: Use atomics to manipulate obj->frontbuffer_bits

Joonas Lahtinen joonas.lahtinen at linux.intel.com
Thu Jul 28 10:51:29 UTC 2016


On to, 2016-07-28 at 11:10 +0100, Chris Wilson wrote:
> On Thu, Jul 28, 2016 at 12:49:31PM +0300, Joonas Lahtinen wrote:
> > 
> > On ke, 2016-07-27 at 12:14 +0100, Chris Wilson wrote:
> > > 
> > >  static int i915_gem_object_list_info(struct seq_file *m, void *data)
> > > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> > > index a24d31e3e014..b6b9a1f78238 100644
> > > --- a/drivers/gpu/drm/i915/i915_drv.h
> > > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > > @@ -2127,8 +2127,6 @@ struct drm_i915_gem_object_ops {
> > >   */
> > >  #define INTEL_MAX_SPRITE_BITS_PER_PIPE 5
> > >  #define INTEL_FRONTBUFFER_BITS_PER_PIPE 8
> > > -#define INTEL_FRONTBUFFER_BITS \
> > > -	(INTEL_FRONTBUFFER_BITS_PER_PIPE * I915_MAX_PIPES)
> > Should we have a BUILD_BUG_ON to make sure we have a fit?
> > 
> > > 
> > > @@ -4549,16 +4549,20 @@ void i915_gem_track_fb(struct drm_i915_gem_object *old,
> > >  		       struct drm_i915_gem_object *new,
> > >  		       unsigned frontbuffer_bits)
> > >  {
> > > +	/* Control of individual bits within the bitfield are guarded by
> > 'bitfield' refers to specific C construct, so not the appropriate term
> > here now that it is removed. In this commit it is readable, but for
> > future I think just confusing.
> When I wrote the comment it was still a bitfield! s/bitfield/mask/
> 
> BUILD_BUG_ON(INTEL_FRONTBUFFER_BITS_PER_PIPE * I915_MAX_PIPES > sizeof(atomic_t) * BITS_PER_BYTE);

Maybe split the line still, but yep.

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


More information about the Intel-gfx mailing list