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

Daniel Vetter daniel at ffwll.ch
Thu Dec 10 00:35:44 PST 2015

On Tue, Dec 08, 2015 at 01:30:50PM +0000, Dave Gordon wrote:
> 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!

Iirc this is fallout from how we originally handled full ppgtt and
aliasing ppgtt. Old versions tried to transparently fall back to simpler
code, nowadays we just declare the gpu wedged. That's why there's no need
to look at dev any more. I think you can just remove that.

> 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.
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Daniel Vetter
Software Engineer, Intel Corporation

More information about the Intel-gfx mailing list