[Intel-gfx] [PATCH 01/10] drm/i915: Make GEM object alloc/free and stolen created take dev_priv
Joonas Lahtinen
joonas.lahtinen at linux.intel.com
Wed Nov 30 12:19:32 UTC 2016
On ke, 2016-11-30 at 11:35 +0000, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
>
> Where it is more appropriate and also to be consistent with
> the direction of the driver.
>
> Also inline object alloc/free since they are just wrappers
> around kmem_cache_alloc/free.
>
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
<SNIP>
> @@ -2976,8 +2976,17 @@ void i915_gem_load_init_fences(struct drm_i915_private *dev_priv);
> int i915_gem_freeze(struct drm_i915_private *dev_priv);
> int i915_gem_freeze_late(struct drm_i915_private *dev_priv);
>
> -void *i915_gem_object_alloc(struct drm_device *dev);
> -void i915_gem_object_free(struct drm_i915_gem_object *obj);
> +static inline void *i915_gem_object_alloc(struct drm_i915_private *dev_priv)
> +{
> + return kmem_cache_zalloc(dev_priv->objects, GFP_KERNEL);
> +}
> +
> +static inline void i915_gem_object_free(struct drm_i915_gem_object *obj)
> +{
> + struct drm_i915_private *dev_priv = to_i915(obj->base.dev);
> + kmem_cache_free(dev_priv->objects, obj);
> +}
Split this change into a separate patch, and untangle enough to
relocate to i915_gem_object.h.
Rest of the functions should be moved too.
Just the dev_priv changes are;
Reviewed-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
Regards, Joonas
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
More information about the Intel-gfx
mailing list