mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
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>
This commit is contained in:
parent
aed9a1a4f7
commit
117bbc0e43
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user