2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2025-01-10 14:43:54 +08:00

drm/i915/userptr: Convert to drm_i915_private

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
This commit is contained in:
Chris Wilson 2016-05-19 16:17:16 +01:00
parent d55dbd06bb
commit 72778cb266
3 changed files with 3 additions and 9 deletions

View File

@ -2961,7 +2961,7 @@ int i915_gem_set_tiling(struct drm_device *dev, void *data,
struct drm_file *file_priv); struct drm_file *file_priv);
int i915_gem_get_tiling(struct drm_device *dev, void *data, int i915_gem_get_tiling(struct drm_device *dev, void *data,
struct drm_file *file_priv); 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, int i915_gem_userptr_ioctl(struct drm_device *dev, void *data,
struct drm_file *file); struct drm_file *file);
int i915_gem_get_aperture_ioctl(struct drm_device *dev, void *data, int i915_gem_get_aperture_ioctl(struct drm_device *dev, void *data,

View File

@ -4913,10 +4913,7 @@ int i915_gem_init(struct drm_device *dev)
*/ */
intel_uncore_forcewake_get(dev_priv, FORCEWAKE_ALL); intel_uncore_forcewake_get(dev_priv, FORCEWAKE_ALL);
ret = i915_gem_init_userptr(dev); i915_gem_init_userptr(dev_priv);
if (ret)
goto out_unlock;
i915_gem_init_ggtt(dev); i915_gem_init_ggtt(dev);
ret = i915_gem_context_init(dev); ret = i915_gem_context_init(dev);

View File

@ -855,11 +855,8 @@ i915_gem_userptr_ioctl(struct drm_device *dev, void *data, struct drm_file *file
return 0; return 0;
} }
int void i915_gem_init_userptr(struct drm_i915_private *dev_priv)
i915_gem_init_userptr(struct drm_device *dev)
{ {
struct drm_i915_private *dev_priv = to_i915(dev);
mutex_init(&dev_priv->mm_lock); mutex_init(&dev_priv->mm_lock);
hash_init(dev_priv->mm_structs); hash_init(dev_priv->mm_structs);
return 0;
} }