Commit 117bbc0e authored by Matthew Auld's avatar Matthew Auld Committed by Christian König

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: default avatarMatthew 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: default avatarArunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20240229105112.250077-3-matthew.auld@intel.comSigned-off-by: default avatarChristian König <christian.koenig@amd.com>
parent aed9a1a4
......@@ -102,7 +102,7 @@ int drm_buddy_init(struct drm_buddy *mm, u64 size, u64 chunk_size)
if (size < chunk_size)
return -EINVAL;
if (chunk_size < PAGE_SIZE)
if (chunk_size < SZ_4K)
return -EINVAL;
if (!is_power_of_2(chunk_size))
......
......@@ -53,8 +53,8 @@ struct drm_buddy_block {
struct list_head tmp_link;
};
/* Order-zero must be at least PAGE_SIZE */
#define DRM_BUDDY_MAX_ORDER (63 - PAGE_SHIFT)
/* Order-zero must be at least SZ_4K */
#define DRM_BUDDY_MAX_ORDER (63 - 12)
/*
* Binary Buddy System.
......@@ -82,7 +82,7 @@ struct drm_buddy {
unsigned int n_roots;
unsigned int max_order;
/* Must be at least PAGE_SIZE */
/* Must be at least SZ_4K */
u64 chunk_size;
u64 size;
u64 avail;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment