[Intel-gfx] [PATCH] drm/i915: Broadwell expands ACTHD to 64bit

Chris Wilson chris at chris-wilson.co.uk
Thu Mar 27 08:45:28 CET 2014


On Wed, Mar 26, 2014 at 05:09:53PM -0700, Ben Widawsky wrote:
> On Fri, Mar 21, 2014 at 12:41:53PM +0000, Chris Wilson wrote:
> > +#define I915_READ64_2x32(lower_reg, upper_reg) ({			\
> > +		u32 upper = I915_READ(upper_reg);			\
> > +		u32 lower = I915_READ(lower_reg);			\
> > +		u32 tmp = I915_READ(upper_reg);				\
> > +		if (upper != tmp) {					\
> > +			upper = tmp;					\
> > +			lower = I915_READ(lower_reg);			\
> > +			WARN_ON(I915_READ(upper_reg) != upper);		\
> > +		}							\
> > +		(u64)upper << 32 | lower; })
> > +
> 
> 
> May as well get the most recent value of upper:
> 		WARN_ON((tmp = I915_READ(upper_reg)) != upper);
> 	}
> 	return (u64)tmp << 32 | lower;

Bleh, I thought if the WARN ever fires, the result is so unstable that
it really doesn't matter what we return, or we go full-loop.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre



More information about the Intel-gfx mailing list