drm/i915/userptr: Convert to drm_i915_private
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 19 May 2016 15:17:16 +0000 (16:17 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 19 May 2016 16:57:08 +0000 (17:57 +0100)
userptr directly only uses drm_device in a single interface where it
meant to use drm_i915_private (everywhere else we have to derive it from
the drm_i915_gem_object and so require going from drm_device).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1463671036-3235-1-git-send-email-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/i915_gem_userptr.c

index ea35a432bb68ba477a395c3ea806502b03ff1a83..6894d8e0a4d28f893c07503ed820f818b0816d21 100644 (file)
@@ -2961,7 +2961,7 @@ int i915_gem_set_tiling(struct drm_device *dev, void *data,
                        struct drm_file *file_priv);
 int i915_gem_get_tiling(struct drm_device *dev, void *data,
                        struct drm_file *file_priv);
-int i915_gem_init_userptr(struct drm_device *dev);
+void i915_gem_init_userptr(struct drm_i915_private *dev_priv);
 int i915_gem_userptr_ioctl(struct drm_device *dev, void *data,
                           struct drm_file *file);
 int i915_gem_get_aperture_ioctl(struct drm_device *dev, void *data,
index aff386eea8ce192e0d56b8c84a0c5f87cb7d2058..afb6862b42e0db926f23f18546135d4f583361cc 100644 (file)
@@ -4913,10 +4913,7 @@ int i915_gem_init(struct drm_device *dev)
         */
        intel_uncore_forcewake_get(dev_priv, FORCEWAKE_ALL);
 
-       ret = i915_gem_init_userptr(dev);
-       if (ret)
-               goto out_unlock;
-
+       i915_gem_init_userptr(dev_priv);
        i915_gem_init_ggtt(dev);
 
        ret = i915_gem_context_init(dev);
index 32d9726e38b11878915ceef5c9f556fac1910459..a84625b712267bd8b07e39f0777e83dd267bb289 100644 (file)
@@ -855,11 +855,8 @@ i915_gem_userptr_ioctl(struct drm_device *dev, void *data, struct drm_file *file
        return 0;
 }
 
-int
-i915_gem_init_userptr(struct drm_device *dev)
+void i915_gem_init_userptr(struct drm_i915_private *dev_priv)
 {
-       struct drm_i915_private *dev_priv = to_i915(dev);
        mutex_init(&dev_priv->mm_lock);
        hash_init(dev_priv->mm_structs);
-       return 0;
 }