Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 117bbc0

Browse files
matt-auldChristianKoenigAMD
authored andcommitted
drm/buddy: stop using PAGE_SIZE
The drm_buddy minimum page-size requirements should be distinct from the CPU PAGE_SIZE. Only restriction is that the minimum page-size is at least 4K. Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com> Cc: Christian König <christian.koenig@amd.com> Cc: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Link: https://patchwork.freedesktop.org/patch/msgid/20240229105112.250077-3-matthew.auld@intel.com Signed-off-by: Christian König <christian.koenig@amd.com>
1 parent aed9a1a commit 117bbc0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

drivers/gpu/drm/drm_buddy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ int drm_buddy_init(struct drm_buddy *mm, u64 size, u64 chunk_size)
102102
if (size < chunk_size)
103103
return -EINVAL;
104104

105-
if (chunk_size < PAGE_SIZE)
105+
if (chunk_size < SZ_4K)
106106
return -EINVAL;
107107

108108
if (!is_power_of_2(chunk_size))

include/drm/drm_buddy.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ struct drm_buddy_block {
5353
struct list_head tmp_link;
5454
};
5555

56-
/* Order-zero must be at least PAGE_SIZE */
57-
#define DRM_BUDDY_MAX_ORDER (63 - PAGE_SHIFT)
56+
/* Order-zero must be at least SZ_4K */
57+
#define DRM_BUDDY_MAX_ORDER (63 - 12)
5858

5959
/*
6060
* Binary Buddy System.
@@ -82,7 +82,7 @@ struct drm_buddy {
8282
unsigned int n_roots;
8383
unsigned int max_order;
8484

85-
/* Must be at least PAGE_SIZE */
85+
/* Must be at least SZ_4K */
8686
u64 chunk_size;
8787
u64 size;
8888
u64 avail;

0 commit comments

Comments
 (0)