]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/ttm: remove node usage in our naming
authorMatthew Auld <matthew.auld@intel.com>
Wed, 16 Jun 2021 15:24:59 +0000 (16:24 +0100)
committerMatthew Auld <matthew.auld@intel.com>
Wed, 16 Jun 2021 15:48:02 +0000 (16:48 +0100)
Now that ttm_resource_manager just returns a generic ttm_resource we
don't need to reference the mm_node stuff anymore which mostly only
makes sense for drm_mm_node. In the next few patches we want switch over
to the ttm_buddy_man which is just another type of ttm_resource so
reflect that in the naming.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210616152501.394518-5-matthew.auld@intel.com
drivers/gpu/drm/i915/gem/i915_gem_object_types.h
drivers/gpu/drm/i915/gem/i915_gem_ttm.c
drivers/gpu/drm/i915/intel_region_ttm.c
drivers/gpu/drm/i915/intel_region_ttm.h
drivers/gpu/drm/i915/selftests/mock_region.c

index 2a23b77424b3ee14d4eff10cb7d471c9e7c9aa00..3a2d9ecf8e03a8ff579a15273fbc04a69aeb9fe7 100644 (file)
@@ -265,9 +265,10 @@ struct drm_i915_gem_object {
                struct intel_memory_region *region;
 
                /**
-                * Memory manager node allocated for this object.
+                * Memory manager resource allocated for this object. Only
+                * needed for the mock region.
                 */
-               void *st_mm_node;
+               struct ttm_resource *res;
 
                /**
                 * Element within memory_region->objects or region->purgeable
index 90d342e3df24f7b5bdc9b29f7a73b643f616a66c..20119ea9c4185f8f3a70b0a1f9fabd629cd93bb5 100644 (file)
@@ -327,7 +327,7 @@ i915_ttm_resource_get_st(struct drm_i915_gem_object *obj,
        if (man->use_tt)
                return i915_ttm_tt_get_st(bo->ttm);
 
-       return intel_region_ttm_node_to_st(obj->mm.region, res);
+       return intel_region_ttm_resource_to_st(obj->mm.region, res);
 }
 
 static int i915_ttm_move(struct ttm_buffer_object *bo, bool evict,
index 5a664f6cc93f4794d77e0cf52aa33446b1a131d8..f9d616544728f6e5f50bdd67aabc88e6e08bf202 100644 (file)
@@ -68,7 +68,7 @@ int intel_region_to_ttm_type(const struct intel_memory_region *mem)
 }
 
 static struct ttm_resource *
-intel_region_ttm_node_reserve(struct intel_memory_region *mem,
+intel_region_ttm_resource_reserve(struct intel_memory_region *mem,
                              resource_size_t offset,
                              resource_size_t size)
 {
@@ -100,12 +100,12 @@ intel_region_ttm_node_reserve(struct intel_memory_region *mem,
 }
 
 /**
- * intel_region_ttm_node_free - Free a node allocated from a resource manager
- * @mem: The region the node was allocated from.
- * @node: The opaque node representing an allocation.
+ * intel_region_ttm_resource_free - Free a resource allocated from a resource manager
+ * @mem: The region the resource was allocated from.
+ * @res: The opaque resource representing an allocation.
  */
-void intel_region_ttm_node_free(struct intel_memory_region *mem,
-                               struct ttm_resource *res)
+void intel_region_ttm_resource_free(struct intel_memory_region *mem,
+                                   struct ttm_resource *res)
 {
        struct ttm_resource_manager *man = mem->region_private;
 
@@ -113,8 +113,8 @@ void intel_region_ttm_node_free(struct intel_memory_region *mem,
 }
 
 static const struct intel_memory_region_private_ops priv_ops = {
-       .reserve = intel_region_ttm_node_reserve,
-       .free = intel_region_ttm_node_free,
+       .reserve = intel_region_ttm_resource_reserve,
+       .free = intel_region_ttm_resource_free,
 };
 
 int intel_region_ttm_init(struct intel_memory_region *mem)
@@ -157,10 +157,10 @@ void intel_region_ttm_fini(struct intel_memory_region *mem)
 }
 
 /**
- * intel_region_ttm_node_to_st - Convert an opaque TTM resource manager node
+ * intel_region_ttm_resource_to_st - Convert an opaque TTM resource manager resource
  * to an sg_table.
  * @mem: The memory region.
- * @node: The resource manager node obtained from the TTM resource manager.
+ * @res: The resource manager resource obtained from the TTM resource manager.
  *
  * The gem backends typically use sg-tables for operations on the underlying
  * io_memory. So provide a way for the backends to translate the
@@ -168,8 +168,8 @@ void intel_region_ttm_fini(struct intel_memory_region *mem)
  *
  * Return: A malloced sg_table on success, an error pointer on failure.
  */
-struct sg_table *intel_region_ttm_node_to_st(struct intel_memory_region *mem,
-                                            struct ttm_resource *res)
+struct sg_table *intel_region_ttm_resource_to_st(struct intel_memory_region *mem,
+                                                struct ttm_resource *res)
 {
        struct ttm_range_mgr_node *range_node =
                container_of(res, typeof(*range_node), base);
@@ -196,9 +196,9 @@ struct sg_table *intel_region_ttm_node_to_st(struct intel_memory_region *mem,
  * Return: A valid pointer on success, an error pointer on failure.
  */
 struct ttm_resource *
-intel_region_ttm_node_alloc(struct intel_memory_region *mem,
-                           resource_size_t size,
-                           unsigned int flags)
+intel_region_ttm_resource_alloc(struct intel_memory_region *mem,
+                               resource_size_t size,
+                               unsigned int flags)
 {
        struct ttm_resource_manager *man = mem->region_private;
        struct ttm_place place = {};
index 649491844e79b7987211522f82271e0304e5c8cd..6f44075920f2de559e5863099746bd17eb58728f 100644 (file)
@@ -22,11 +22,11 @@ int intel_region_ttm_init(struct intel_memory_region *mem);
 
 void intel_region_ttm_fini(struct intel_memory_region *mem);
 
-struct sg_table *intel_region_ttm_node_to_st(struct intel_memory_region *mem,
-                                            struct ttm_resource *res);
+struct sg_table *intel_region_ttm_resource_to_st(struct intel_memory_region *mem,
+                                                struct ttm_resource *res);
 
-void intel_region_ttm_node_free(struct intel_memory_region *mem,
-                               struct ttm_resource *node);
+void intel_region_ttm_resource_free(struct intel_memory_region *mem,
+                                   struct ttm_resource *res);
 
 int intel_region_to_ttm_type(const struct intel_memory_region *mem);
 
@@ -34,8 +34,8 @@ struct ttm_device_funcs *i915_ttm_driver(void);
 
 #ifdef CONFIG_DRM_I915_SELFTEST
 struct ttm_resource *
-intel_region_ttm_node_alloc(struct intel_memory_region *mem,
-                           resource_size_t size,
-                           unsigned int flags);
+intel_region_ttm_resource_alloc(struct intel_memory_region *mem,
+                               resource_size_t size,
+                               unsigned int flags);
 #endif
 #endif /* _INTEL_REGION_TTM_H_ */
index eafc5a04975cfc485b0a5416dc1d085cb7e4e189..6120d43fe504349caa83c21b1e6ad9043a9d9ba5 100644 (file)
@@ -16,7 +16,7 @@
 static void mock_region_put_pages(struct drm_i915_gem_object *obj,
                                  struct sg_table *pages)
 {
-       intel_region_ttm_node_free(obj->mm.region, obj->mm.st_mm_node);
+       intel_region_ttm_resource_free(obj->mm.region, obj->mm.res);
        sg_free_table(pages);
        kfree(pages);
 }
@@ -30,15 +30,15 @@ static int mock_region_get_pages(struct drm_i915_gem_object *obj)
        if (obj->flags & I915_BO_ALLOC_CONTIGUOUS)
                flags |= I915_ALLOC_CONTIGUOUS;
 
-       obj->mm.st_mm_node = intel_region_ttm_node_alloc(obj->mm.region,
-                                                        obj->base.size,
-                                                        flags);
-       if (IS_ERR(obj->mm.st_mm_node))
-               return PTR_ERR(obj->mm.st_mm_node);
+       obj->mm.res = intel_region_ttm_resource_alloc(obj->mm.region,
+                                                     obj->base.size,
+                                                     flags);
+       if (IS_ERR(obj->mm.res))
+               return PTR_ERR(obj->mm.res);
 
-       pages = intel_region_ttm_node_to_st(obj->mm.region, obj->mm.st_mm_node);
+       pages = intel_region_ttm_resource_to_st(obj->mm.region, obj->mm.res);
        if (IS_ERR(pages)) {
-               intel_region_ttm_node_free(obj->mm.region, obj->mm.st_mm_node);
+               intel_region_ttm_resource_free(obj->mm.region, obj->mm.res);
                return PTR_ERR(pages);
        }