[Intel-gfx] [PATCH 1/2] drm/i915: clear GFX_MODE on IVB at init time

Chris Wilson chris at chris-wilson.co.uk
Sat Aug 13 00:56:27 CEST 2011


On Fri, 12 Aug 2011 15:28:32 -0700, Jesse Barnes <jbarnes at virtuousgeek.org> wrote:
>  		I915_WRITE(MI_MODE, mode);
> +		if (IS_GEN7(dev))
> +			I915_WRITE(GFX_MODE_GEN7, ((GFX_TLB_INVALIDATE_ALWAYS |
> +						    GFX_REPLAY_MODE) << 16) |
> +				   GFX_REPLAY_MODE);

That's maximally confusing indentation ;-)
Also it reads like that is a chicken bit, as in order to invalidate always
on flush we need to clear it? Can we play around with the name to avoid
confusion in the code and confusion with the spec?

#define ENABLE(x) ((x) << 16 | (x))
#define DISABLE(x) ((x) << 16 | 0)

Granted finding good names for those is hard. Perhaps ENABLE_16(x),
DISABLE_16(x) to indicate the mask size.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre



More information about the Intel-gfx mailing list