Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: jani.nikula@intel.com, Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: [Intel-gfx] [PATCH v4 07/14] drm/i915: move i915_gem_vm_lookup() where it's used
Date: Thu, 10 Feb 2022 17:45:45 +0200	[thread overview]
Message-ID: <a080e401840a8b9d45946ff33fd63c7939a623ae.1644507885.git.jani.nikula@intel.com> (raw)
In-Reply-To: <cover.1644507885.git.jani.nikula@intel.com>

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>
---
 drivers/gpu/drm/i915/gem/i915_gem_context.c | 15 +++++++++++++++
 drivers/gpu/drm/i915/i915_drv.h             | 14 --------------
 2 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c b/drivers/gpu/drm/i915/gem/i915_gem_context.c
index ebbac2ea0833..fff09df0009e 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c
@@ -343,6 +343,21 @@ static int proto_context_register(struct drm_i915_file_private *fpriv,
 	return ret;
 }
 
+
+static struct i915_address_space *
+i915_gem_vm_lookup(struct drm_i915_file_private *file_priv, u32 id)
+{
+	struct i915_address_space *vm;
+
+	xa_lock(&file_priv->vm_xa);
+	vm = xa_load(&file_priv->vm_xa, id);
+	if (vm)
+		kref_get(&vm->ref);
+	xa_unlock(&file_priv->vm_xa);
+
+	return vm;
+}
+
 static int set_proto_ctx_vm(struct drm_i915_file_private *fpriv,
 			    struct i915_gem_proto_context *pc,
 			    const struct drm_i915_gem_context_param *args)
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 306bc87dadcc..bc51b2336e05 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1623,20 +1623,6 @@ void i915_gem_driver_release(struct drm_i915_private *dev_priv);
 
 int i915_gem_open(struct drm_i915_private *i915, struct drm_file *file);
 
-static inline struct i915_address_space *
-i915_gem_vm_lookup(struct drm_i915_file_private *file_priv, u32 id)
-{
-	struct i915_address_space *vm;
-
-	xa_lock(&file_priv->vm_xa);
-	vm = xa_load(&file_priv->vm_xa, id);
-	if (vm)
-		kref_get(&vm->ref);
-	xa_unlock(&file_priv->vm_xa);
-
-	return vm;
-}
-
 /* i915_gem_tiling.c */
 static inline bool i915_gem_object_needs_bit17_swizzle(struct drm_i915_gem_object *obj)
 {
-- 
2.30.2


  parent reply	other threads:[~2022-02-10 15:46 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-10 15:45 [Intel-gfx] [PATCH v4 00/14] drm/i915: drm_i915.h cleanup Jani Nikula
2022-02-10 15:45 ` [Intel-gfx] [PATCH v4 01/14] drm/i915: split out i915_gem_internal.h from i915_drv.h Jani Nikula
2022-02-10 15:45 ` [Intel-gfx] [PATCH v4 02/14] drm/i915: remove leftover i915_gem_pm.h declarations " Jani Nikula
2022-02-10 15:45 ` [Intel-gfx] [PATCH v4 03/14] drm/i915: split out gem/i915_gem_dmabuf.h " Jani Nikula
2022-02-10 15:45 ` [Intel-gfx] [PATCH v4 04/14] drm/i915: split out gem/i915_gem_create.h " Jani Nikula
2022-02-10 15:45 ` [Intel-gfx] [PATCH v4 05/14] drm/i915: split out gem/i915_gem_domain.h " Jani Nikula
2022-02-10 15:45 ` [Intel-gfx] [PATCH v4 06/14] drm/i915: move i915_cache_level_str() static in i915_debugfs.c Jani Nikula
2022-02-10 15:45 ` Jani Nikula [this message]
2022-02-10 15:45 ` [Intel-gfx] [PATCH v4 08/14] drm/i915: move i915_reset_count()/i915_reset_engine_count() out of i915_drv.h Jani Nikula
2022-02-10 15:45 ` [Intel-gfx] [PATCH v4 09/14] drm/i915: split out i915_file_private.h from i915_drv.h Jani Nikula
2022-02-10 15:45 ` [Intel-gfx] [PATCH v4 10/14] drm/i915: don't include drm_cache.h in i915_drv.h Jani Nikula
2022-02-10 15:45 ` [Intel-gfx] [PATCH v4 11/14] drm/i915: include shmem_fs.h only where needed Jani Nikula
2022-02-10 15:45 ` [Intel-gfx] [PATCH v4 12/14] drm/i915: include some drm headers " Jani Nikula
2022-02-10 15:45 ` [Intel-gfx] [PATCH v4 13/14] drm/i915: axe lots of unnecessary includes from i915_drv.h Jani Nikula
2022-02-10 15:45 ` [Intel-gfx] [PATCH v4 14/14] drm/i915: fix drm_i915.h include grouping and sorting Jani Nikula
2022-02-10 16:32 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: drm_i915.h cleanup Patchwork
2022-02-10 16:33 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-02-10 17:01 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-02-10 17:48 ` [Intel-gfx] [PATCH v4 00/14] " Tvrtko Ursulin
2022-02-14 12:20   ` Jani Nikula
2022-02-10 19:41 ` [Intel-gfx] ✓ Fi.CI.IGT: success for " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a080e401840a8b9d45946ff33fd63c7939a623ae.1644507885.git.jani.nikula@intel.com \
    --to=jani.nikula@intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox