[Intel-gfx] [PATCH 7/9] drm/i915: intel_wait_for_register_fw to uncore

Chris Wilson chris at chris-wilson.co.uk
Mon Mar 25 22:09:27 UTC 2019


Quoting Daniele Ceraolo Spurio (2019-03-25 21:49:38)
> +static inline void intel_uncore_rmw_or_fw(struct intel_uncore *uncore,
> +                                         i915_reg_t reg, u32 or_val)
> +{
> +       intel_uncore_write_fw(uncore, reg,
> +                             intel_uncore_read_fw(uncore, reg) | or_val);
> +}

Considering how frequently this could be used (display code, I'm looking
at you), I'd make this out-of-line and do a full rmw.


intel_uncore_rmw(uncore, reg, u32 mask, u32 or)
{
	u32 val;

	val = intel_uncore_read(uncore, reg);
	val &= mask;
	val |= or;
	intel_uncore_write(uncore, reg, val);
}

Ok, now I see that you did the _fw variant. Yeah, that could probably
start off inline :)
-Chris


More information about the Intel-gfx mailing list