Re: [PATCH v2 1/3] drm/i915: Use i915_vm_to_ppgtt instead of manual container_of

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux