[Intel-gfx] [PATCH 2/3] drm/i915: Simplify for_each_fw_domain iterators
Chris Wilson
chris at chris-wilson.co.uk
Mon Apr 4 19:00:01 UTC 2016
On Mon, Apr 04, 2016 at 05:51:10PM +0100, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
>
> As the vast majority of users does not use the domain id variable,
> we can eliminate it from the iterator and also change the latter
> using the same principle as was recently done for for_each_engine.
>
> For a couple of callers which do need the domain id, or the domain
> mask, store the later in the domain itself at init time and use
> both through it.
>
> Result is clearer code and smaller generated binary, especially
> in the tight fw get/put loops. Also, relationship between domain
> id and mask is no longer assumed in the macro.
>
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Hah, I made exactly (admittedly I didn't think of adding BUILD_BUG_ON)
the same patch just as you went off on holiday and weren't around to
comment!
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
More information about the Intel-gfx
mailing list