Re: [PATCH 02/62] drm/i915/bdw: Handle forcewake for writes on gen8

Chris Wilson
2013-11-04T14:20:07Z

On Sat, Nov 02, 2013 at 09:07:00PM -0700, Ben Widawsky wrote:
> +static bool is_gen8_optimized(struct drm_i915_private *dev_priv, u32 reg)
> +{
> + int i;
> + for (i = 0; i < ARRAY_SIZE(gen8_optimized_regs); i++)
> + if (reg == gen8_optimized_regs[i])
> + return false;
> +
> + return true;
> +}

The sense of this function is reversed, it really should be
is_gen8_legacy_register()? I'd prefer this to be an explicit switch() in
ascending order -- the compiler should emit an efficient bsearch.
-Chris

--
Chris Wilson, Intel Open Source Technology Centre