drm/i915: Rename i915_gem_context_get_vm_rcu to i915_gem_context_get_eb_vm
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 2 Sep 2021 14:20:51 +0000 (16:20 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 6 Sep 2021 08:46:04 +0000 (10:46 +0200)
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: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Daniel 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
drivers/gpu/drm/i915/gem/i915_gem_context.h
drivers/gpu/drm/i915/gem/selftests/huge_pages.c
drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
drivers/gpu/drm/i915/gt/selftest_execlists.c
drivers/gpu/drm/i915/gt/selftest_hangcheck.c
drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
drivers/gpu/drm/i915/selftests/i915_vma.c

index 1806053..da6e8b5 100644 (file)
@@ -155,7 +155,7 @@ i915_gem_context_vm(struct i915_gem_context *ctx)
 }
 
 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;
 
index a094f3c..6c68fe2 100644 (file)
@@ -1456,7 +1456,7 @@ static int igt_tmpfs_fallback(void *arg)
        struct i915_gem_context *ctx = arg;
        struct drm_i915_private *i915 = ctx->i915;
        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 i915_vma *vma;
        u32 *vaddr;
@@ -1512,7 +1512,7 @@ static int igt_shrink_thp(void *arg)
 {
        struct i915_gem_context *ctx = arg;
        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 i915_gem_engines_iter it;
        struct intel_context *ce;
index 4d27587..fc7fb33 100644 (file)
@@ -1528,7 +1528,7 @@ static int write_to_scratch(struct i915_gem_context *ctx,
 
        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);
        if (IS_ERR(vma)) {
                err = PTR_ERR(vma);
@@ -1607,7 +1607,7 @@ static int read_from_scratch(struct i915_gem_context *ctx,
        if (GRAPHICS_VER(i915) >= 8) {
                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);
                if (IS_ERR(vma)) {
                        err = PTR_ERR(vma);
index f12ffe7..b3863ab 100644 (file)
@@ -3493,7 +3493,7 @@ static int smoke_submit(struct preempt_smoke *smoke,
        if (batch) {
                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);
                i915_vm_put(vm);
                if (IS_ERR(vma))
index 2c1ed32..8be23e0 100644 (file)
@@ -117,7 +117,7 @@ static struct i915_request *
 hang_create_request(struct hang *h, struct intel_engine_cs *engine)
 {
        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 i915_request *rq = NULL;
        struct i915_vma *hws, *vma;
index f843a50..2d60a5a 100644 (file)
@@ -1300,7 +1300,7 @@ static int exercise_mock(struct drm_i915_private *i915,
        if (!ctx)
                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);
        i915_vm_put(vm);
 
@@ -1848,7 +1848,7 @@ static int igt_cs_tlb(void *arg)
                goto out_unlock;
        }
 
-       vm = i915_gem_context_get_vm_rcu(ctx);
+       vm = i915_gem_context_get_eb_vm(ctx);
        if (i915_is_ggtt(vm))
                goto out_vm;
 
index dd06072..79ba72d 100644 (file)
@@ -118,7 +118,7 @@ static int create_vmas(struct drm_i915_private *i915,
                                struct i915_vma *vma;
                                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);
                                i915_vm_put(vm);
                                if (IS_ERR(vma))