[Intel-gfx] [PATCH 0/1] drm/i915: eliminate 'temp' in gen8_for_each_{pdd, pdpe, pml4e}

Dave Gordon david.s.gordon at intel.com
Tue Dec 8 05:30:50 PST 2015


Way back at the beginning of October, Chris Wilson suggested that cleaning
up these macros by removing the redundant 'temp' might be worthwhile. So
here's the patch.

There's one more thing that might be cleaned up here (but for which
I don't have a patch yet), which is that gen8_for_each_pdpe() still
references a non-parameter value named 'dev'. Bizarrely, this apparent
nonlocal reference is only used as the parameter to another macro -- which
then doesn't actually use it! Suggestions on how to tidy this up welcome!

One possibility was to define a common iterator (__gen8_for_each())
and then use it to create all the three level-specific macros, which
meant that the loop bounds were passed in rather than being part of the
iterator. But the common macro needed a LOT of parameters, and didn't
really look like an improvement. So I've gone with this simple rewrite
for now.




More information about the Intel-gfx mailing list