]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amdgpu: move internal vram_mgr function into the C file
authorChristian König <christian.koenig@amd.com>
Tue, 10 May 2022 11:26:46 +0000 (13:26 +0200)
committerChristian König <christian.koenig@amd.com>
Wed, 11 May 2022 08:02:32 +0000 (10:02 +0200)
No need to have those in the header.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220510113649.879821-2-christian.koenig@amd.com
drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.h

index 51d9d3a4456c6d7342316bccf6f9bfeda1bd9368..7a5e8a7b4a1b4b2c5e25c9106358684c845db0a2 100644 (file)
@@ -50,6 +50,35 @@ to_amdgpu_device(struct amdgpu_vram_mgr *mgr)
        return container_of(mgr, struct amdgpu_device, mman.vram_mgr);
 }
 
+static inline struct drm_buddy_block *
+amdgpu_vram_mgr_first_block(struct list_head *list)
+{
+       return list_first_entry_or_null(list, struct drm_buddy_block, link);
+}
+
+static inline bool amdgpu_is_vram_mgr_blocks_contiguous(struct list_head *head)
+{
+       struct drm_buddy_block *block;
+       u64 start, size;
+
+       block = amdgpu_vram_mgr_first_block(head);
+       if (!block)
+               return false;
+
+       while (head != block->link.next) {
+               start = amdgpu_vram_mgr_block_start(block);
+               size = amdgpu_vram_mgr_block_size(block);
+
+               block = list_entry(block->link.next, struct drm_buddy_block, link);
+               if (start + size != amdgpu_vram_mgr_block_start(block))
+                       return false;
+       }
+
+       return true;
+}
+
+
+
 /**
  * DOC: mem_info_vram_total
  *
index 9a2db87186c75bcc75b4238575408e3ee7052772..4b267bf1c5db44f368bc1e31159dd12e74f17171 100644 (file)
@@ -53,33 +53,6 @@ static inline u64 amdgpu_vram_mgr_block_size(struct drm_buddy_block *block)
        return PAGE_SIZE << drm_buddy_block_order(block);
 }
 
-static inline struct drm_buddy_block *
-amdgpu_vram_mgr_first_block(struct list_head *list)
-{
-       return list_first_entry_or_null(list, struct drm_buddy_block, link);
-}
-
-static inline bool amdgpu_is_vram_mgr_blocks_contiguous(struct list_head *head)
-{
-       struct drm_buddy_block *block;
-       u64 start, size;
-
-       block = amdgpu_vram_mgr_first_block(head);
-       if (!block)
-               return false;
-
-       while (head != block->link.next) {
-               start = amdgpu_vram_mgr_block_start(block);
-               size = amdgpu_vram_mgr_block_size(block);
-
-               block = list_entry(block->link.next, struct drm_buddy_block, link);
-               if (start + size != amdgpu_vram_mgr_block_start(block))
-                       return false;
-       }
-
-       return true;
-}
-
 static inline struct amdgpu_vram_mgr_resource *
 to_amdgpu_vram_mgr_resource(struct ttm_resource *res)
 {