Commit c6d04e48 authored by Daniel Vetter's avatar Daniel Vetter

drm/i915: Rename i915_gem_context_get_vm_rcu to i915_gem_context_get_eb_vm

The important part isn't so much that this does an rcu lookup - that's
more an implementation detail, which will also be removed.

The thing that makes this different from other functions is that it's
gettting you the vm that batchbuffers will run in for that gem
context, which is either a full ppgtt stored in gem->ctx, or the ggtt.

We'll make more use of this function later on.
Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
Cc: Jon Bloomfield <jon.bloomfield@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Jason Ekstrand <jason@jlekstrand.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20210902142057.929669-5-daniel.vetter@ffwll.ch
parent e1068a9e
...@@ -155,7 +155,7 @@ i915_gem_context_vm(struct i915_gem_context *ctx) ...@@ -155,7 +155,7 @@ i915_gem_context_vm(struct i915_gem_context *ctx)
} }
static inline struct i915_address_space * static inline struct i915_address_space *
i915_gem_context_get_vm_rcu(struct i915_gem_context *ctx) i915_gem_context_get_eb_vm(struct i915_gem_context *ctx)
{ {
struct i915_address_space *vm; struct i915_address_space *vm;
......
...@@ -1456,7 +1456,7 @@ static int igt_tmpfs_fallback(void *arg) ...@@ -1456,7 +1456,7 @@ static int igt_tmpfs_fallback(void *arg)
struct i915_gem_context *ctx = arg; struct i915_gem_context *ctx = arg;
struct drm_i915_private *i915 = ctx->i915; struct drm_i915_private *i915 = ctx->i915;
struct vfsmount *gemfs = i915->mm.gemfs; struct vfsmount *gemfs = i915->mm.gemfs;
struct i915_address_space *vm = i915_gem_context_get_vm_rcu(ctx); struct i915_address_space *vm = i915_gem_context_get_eb_vm(ctx);
struct drm_i915_gem_object *obj; struct drm_i915_gem_object *obj;
struct i915_vma *vma; struct i915_vma *vma;
u32 *vaddr; u32 *vaddr;
...@@ -1512,7 +1512,7 @@ static int igt_shrink_thp(void *arg) ...@@ -1512,7 +1512,7 @@ static int igt_shrink_thp(void *arg)
{ {
struct i915_gem_context *ctx = arg; struct i915_gem_context *ctx = arg;
struct drm_i915_private *i915 = ctx->i915; struct drm_i915_private *i915 = ctx->i915;
struct i915_address_space *vm = i915_gem_context_get_vm_rcu(ctx); struct i915_address_space *vm = i915_gem_context_get_eb_vm(ctx);
struct drm_i915_gem_object *obj; struct drm_i915_gem_object *obj;
struct i915_gem_engines_iter it; struct i915_gem_engines_iter it;
struct intel_context *ce; struct intel_context *ce;
......
...@@ -1528,7 +1528,7 @@ static int write_to_scratch(struct i915_gem_context *ctx, ...@@ -1528,7 +1528,7 @@ static int write_to_scratch(struct i915_gem_context *ctx,
intel_gt_chipset_flush(engine->gt); intel_gt_chipset_flush(engine->gt);
vm = i915_gem_context_get_vm_rcu(ctx); vm = i915_gem_context_get_eb_vm(ctx);
vma = i915_vma_instance(obj, vm, NULL); vma = i915_vma_instance(obj, vm, NULL);
if (IS_ERR(vma)) { if (IS_ERR(vma)) {
err = PTR_ERR(vma); err = PTR_ERR(vma);
...@@ -1607,7 +1607,7 @@ static int read_from_scratch(struct i915_gem_context *ctx, ...@@ -1607,7 +1607,7 @@ static int read_from_scratch(struct i915_gem_context *ctx,
if (GRAPHICS_VER(i915) >= 8) { if (GRAPHICS_VER(i915) >= 8) {
const u32 GPR0 = engine->mmio_base + 0x600; const u32 GPR0 = engine->mmio_base + 0x600;
vm = i915_gem_context_get_vm_rcu(ctx); vm = i915_gem_context_get_eb_vm(ctx);
vma = i915_vma_instance(obj, vm, NULL); vma = i915_vma_instance(obj, vm, NULL);
if (IS_ERR(vma)) { if (IS_ERR(vma)) {
err = PTR_ERR(vma); err = PTR_ERR(vma);
......
...@@ -3493,7 +3493,7 @@ static int smoke_submit(struct preempt_smoke *smoke, ...@@ -3493,7 +3493,7 @@ static int smoke_submit(struct preempt_smoke *smoke,
if (batch) { if (batch) {
struct i915_address_space *vm; struct i915_address_space *vm;
vm = i915_gem_context_get_vm_rcu(ctx); vm = i915_gem_context_get_eb_vm(ctx);
vma = i915_vma_instance(batch, vm, NULL); vma = i915_vma_instance(batch, vm, NULL);
i915_vm_put(vm); i915_vm_put(vm);
if (IS_ERR(vma)) if (IS_ERR(vma))
......
...@@ -117,7 +117,7 @@ static struct i915_request * ...@@ -117,7 +117,7 @@ static struct i915_request *
hang_create_request(struct hang *h, struct intel_engine_cs *engine) hang_create_request(struct hang *h, struct intel_engine_cs *engine)
{ {
struct intel_gt *gt = h->gt; struct intel_gt *gt = h->gt;
struct i915_address_space *vm = i915_gem_context_get_vm_rcu(h->ctx); struct i915_address_space *vm = i915_gem_context_get_eb_vm(h->ctx);
struct drm_i915_gem_object *obj; struct drm_i915_gem_object *obj;
struct i915_request *rq = NULL; struct i915_request *rq = NULL;
struct i915_vma *hws, *vma; struct i915_vma *hws, *vma;
......
...@@ -1300,7 +1300,7 @@ static int exercise_mock(struct drm_i915_private *i915, ...@@ -1300,7 +1300,7 @@ static int exercise_mock(struct drm_i915_private *i915,
if (!ctx) if (!ctx)
return -ENOMEM; return -ENOMEM;
vm = i915_gem_context_get_vm_rcu(ctx); vm = i915_gem_context_get_eb_vm(ctx);
err = func(vm, 0, min(vm->total, limit), end_time); err = func(vm, 0, min(vm->total, limit), end_time);
i915_vm_put(vm); i915_vm_put(vm);
...@@ -1848,7 +1848,7 @@ static int igt_cs_tlb(void *arg) ...@@ -1848,7 +1848,7 @@ static int igt_cs_tlb(void *arg)
goto out_unlock; goto out_unlock;
} }
vm = i915_gem_context_get_vm_rcu(ctx); vm = i915_gem_context_get_eb_vm(ctx);
if (i915_is_ggtt(vm)) if (i915_is_ggtt(vm))
goto out_vm; goto out_vm;
......
...@@ -118,7 +118,7 @@ static int create_vmas(struct drm_i915_private *i915, ...@@ -118,7 +118,7 @@ static int create_vmas(struct drm_i915_private *i915,
struct i915_vma *vma; struct i915_vma *vma;
int err; int err;
vm = i915_gem_context_get_vm_rcu(ctx); vm = i915_gem_context_get_eb_vm(ctx);
vma = checked_vma_instance(obj, vm, NULL); vma = checked_vma_instance(obj, vm, NULL);
i915_vm_put(vm); i915_vm_put(vm);
if (IS_ERR(vma)) if (IS_ERR(vma))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment