[Intel-gfx] [PATCH v2 1/3] drm/i915: Use i915_vm_to_ppgtt instead of manual container_of
Chris Wilson
chris at chris-wilson.co.uk
Fri Apr 1 07:12:53 UTC 2016
On Fri, Apr 01, 2016 at 10:05:03AM +0300, Joonas Lahtinen wrote:
> Looks much better without container_of everywhere.
>
> v2:
> - In i915_gem_restore_gtt_mappings too (Chris)
> @@ -3294,9 +3282,7 @@ void i915_gem_restore_gtt_mappings(struct drm_device *dev)
> list_for_each_entry(vm, &dev_priv->vm_list, global_link) {
> /* TODO: Perhaps it shouldn't be gen6 specific */
>
> - struct i915_hw_ppgtt *ppgtt =
> - container_of(vm, struct i915_hw_ppgtt,
> - base);
> + struct i915_hw_ppgtt *ppgtt = i915_vm_to_ppgtt(vm);
>
> if (i915_is_ggtt(vm))
> ppgtt = dev_priv->mm.aliasing_ppgtt;
Sadly, WARN.
struct i915_hw_ppgtt *ppgtt;
if (i915_is_ggtt(vm))
ppgtt = dev_priv->mm.aliasing_ppgtt;
else
ppgtt = i915_vm_to_ppgtt(vm);
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
More information about the Intel-gfx
mailing list