Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915: move i915_gem_vm_lookup() where it's used

Move the function next to the only user. Arguably it's perhaps not the
best place, but it's much better than having a static inline in a
header.

Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Acked-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/a080e401840a8b9d45946ff33fd63c7939a623ae.1644507885.git.jani.nikula@intel.com

+14 -14
+14
drivers/gpu/drm/i915/gem/i915_gem_context.c
··· 343 343 return ret; 344 344 } 345 345 346 + static struct i915_address_space * 347 + i915_gem_vm_lookup(struct drm_i915_file_private *file_priv, u32 id) 348 + { 349 + struct i915_address_space *vm; 350 + 351 + xa_lock(&file_priv->vm_xa); 352 + vm = xa_load(&file_priv->vm_xa, id); 353 + if (vm) 354 + kref_get(&vm->ref); 355 + xa_unlock(&file_priv->vm_xa); 356 + 357 + return vm; 358 + } 359 + 346 360 static int set_proto_ctx_vm(struct drm_i915_file_private *fpriv, 347 361 struct i915_gem_proto_context *pc, 348 362 const struct drm_i915_gem_context_param *args)
-14
drivers/gpu/drm/i915/i915_drv.h
··· 1618 1618 1619 1619 int i915_gem_open(struct drm_i915_private *i915, struct drm_file *file); 1620 1620 1621 - static inline struct i915_address_space * 1622 - i915_gem_vm_lookup(struct drm_i915_file_private *file_priv, u32 id) 1623 - { 1624 - struct i915_address_space *vm; 1625 - 1626 - xa_lock(&file_priv->vm_xa); 1627 - vm = xa_load(&file_priv->vm_xa, id); 1628 - if (vm) 1629 - kref_get(&vm->ref); 1630 - xa_unlock(&file_priv->vm_xa); 1631 - 1632 - return vm; 1633 - } 1634 - 1635 1621 /* i915_gem_tiling.c */ 1636 1622 static inline bool i915_gem_object_needs_bit17_swizzle(struct drm_i915_gem_object *obj) 1637 1623 {