[Intel-gfx] [PATCH v2 1/2] drm/i915/gtt: Do not initialize drm_mm twice.
Chris Wilson
chris at chris-wilson.co.uk
Tue Sep 15 13:07:04 PDT 2015
On Tue, Sep 15, 2015 at 08:01:14PM +0200, MichaĆ Winiarski wrote:
> +void i915_address_space_init(struct drm_device *dev,
> + struct i915_address_space *vm)
> +{
> + struct drm_i915_private *dev_priv = dev->dev_private;
> +
> + drm_mm_init(&vm->mm, vm->start, vm->total);
> + vm->dev = dev;
> + INIT_LIST_HEAD(&vm->active_list);
> + INIT_LIST_HEAD(&vm->inactive_list);
> + INIT_LIST_HEAD(&vm->global_link);
> + list_add_tail(&vm->global_link, &dev_priv->vm_list);
> +}
Having done all that work, it can now be static. It is an internal
function so pass around drm_i915_private, and if we follow our oop then
the object (struct i915_address_space) should be the first parameter.
Also on my hit list is s/vm->dev/vm->i915/ so we can drop lots of
pointless pointer dancing.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
More information about the Intel-gfx
mailing list