drm/i915: Remove deadcode
authorDr. David Alan Gilbert <linux@treblig.org>
Fri, 27 Dec 2024 11:37:52 +0000 (11:37 +0000)
committerAndi Shyti <andi.shyti@kernel.org>
Mon, 30 Dec 2024 00:31:31 +0000 (01:31 +0100)
i915_active_acquire_for_context() was added in 2020 by
commit 5d9341370f57 ("drm/i915: Export a preallocate variant of
i915_active_acquire()") but has never been used.

The last use of __i915_gem_object_is_lmem() was removed in 2021 by
commit ff20afc4cee7 ("drm/i915: Update error capture code to avoid using
the current vma state")

Remove them.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: Tvrtko Ursulin <tursulin@igalia.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241227113754.25871-1-tursulin@igalia.com
drivers/gpu/drm/i915/gem/i915_gem_lmem.c
drivers/gpu/drm/i915/gem/i915_gem_lmem.h
drivers/gpu/drm/i915/i915_active.c
drivers/gpu/drm/i915/i915_active.h

index 3198b64ad7dbc3da80b3c33b52492f12dbea9579..388f90784d8aea1ae0d9a6378e09beceea573f8c 100644 (file)
@@ -52,29 +52,6 @@ bool i915_gem_object_is_lmem(struct drm_i915_gem_object *obj)
                      mr->type == INTEL_MEMORY_STOLEN_LOCAL);
 }
 
-/**
- * __i915_gem_object_is_lmem - Whether the object is resident in
- * lmem while in the fence signaling critical path.
- * @obj: The object to check.
- *
- * This function is intended to be called from within the fence signaling
- * path where the fence, or a pin, keeps the object from being migrated. For
- * example during gpu reset or similar.
- *
- * Return: Whether the object is resident in lmem.
- */
-bool __i915_gem_object_is_lmem(struct drm_i915_gem_object *obj)
-{
-       struct intel_memory_region *mr = READ_ONCE(obj->mm.region);
-
-#ifdef CONFIG_LOCKDEP
-       GEM_WARN_ON(dma_resv_test_signaled(obj->base.resv, DMA_RESV_USAGE_BOOKKEEP) &&
-                   i915_gem_object_evictable(obj));
-#endif
-       return mr && (mr->type == INTEL_MEMORY_LOCAL ||
-                     mr->type == INTEL_MEMORY_STOLEN_LOCAL);
-}
-
 /**
  * __i915_gem_object_create_lmem_with_ps - Create lmem object and force the
  * minimum page size for the backing pages.
index 5a7a14e85c3fc78bcabb67838d054710998e5bda..ecd8f1a633a1bb0717f4e02f0981479cf0fe6ba0 100644 (file)
@@ -19,8 +19,6 @@ i915_gem_object_lmem_io_map(struct drm_i915_gem_object *obj,
 
 bool i915_gem_object_is_lmem(struct drm_i915_gem_object *obj);
 
-bool __i915_gem_object_is_lmem(struct drm_i915_gem_object *obj);
-
 struct drm_i915_gem_object *
 i915_gem_object_create_lmem_from_data(struct drm_i915_private *i915,
                                      const void *data, size_t size);
index 5ec293011d99029f211301d2789272603f7f3dde..c04c26600aad480f1efadfb6fe0503e5f7ec569a 100644 (file)
@@ -527,24 +527,6 @@ int i915_active_acquire(struct i915_active *ref)
        return err;
 }
 
-int i915_active_acquire_for_context(struct i915_active *ref, u64 idx)
-{
-       struct i915_active_fence *active;
-       int err;
-
-       err = i915_active_acquire(ref);
-       if (err)
-               return err;
-
-       active = active_instance(ref, idx);
-       if (!active) {
-               i915_active_release(ref);
-               return -ENOMEM;
-       }
-
-       return 0; /* return with active ref */
-}
-
 void i915_active_release(struct i915_active *ref)
 {
        debug_active_assert(ref);
index 77c676ecc26335df63cbf1ee2416b65d69cec7dd..821f7c21ea9bb5bc22768c7ebb0c6260f90eabbc 100644 (file)
@@ -186,7 +186,6 @@ int i915_request_await_active(struct i915_request *rq,
 #define I915_ACTIVE_AWAIT_BARRIER BIT(2)
 
 int i915_active_acquire(struct i915_active *ref);
-int i915_active_acquire_for_context(struct i915_active *ref, u64 idx);
 bool i915_active_acquire_if_busy(struct i915_active *ref);
 
 void i915_active_release(struct i915_active *ref);