Re: [PATCH v2 1/2] drm/i915/gtt: Do not initialize drm_mm twice.

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

 



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
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://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