Reviewed-by: Arunpravin Paneer Selvam <arunpravin.paneersel...@amd.com>

On 2/29/2024 4:21 PM, Matthew Auld wrote:
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.a...@intel.com>
Cc: Arunpravin Paneer Selvam<arunpravin.paneersel...@amd.com>
Cc: Christian König<christian.koe...@amd.com>
Cc: Arnd Bergmann<a...@arndb.de>
---
  drivers/gpu/drm/drm_buddy.c | 2 +-
  include/drm/drm_buddy.h     | 6 +++---
  2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu/drm/drm_buddy.c
index 5ebdd6f8f36e..f999568d69c1 100644
--- a/drivers/gpu/drm/drm_buddy.c
+++ b/drivers/gpu/drm/drm_buddy.c
@@ -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))
diff --git a/include/drm/drm_buddy.h b/include/drm/drm_buddy.h
index a5b39fc01003..19ed661a32f3 100644
--- a/include/drm/drm_buddy.h
+++ b/include/drm/drm_buddy.h
@@ -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;

Reply via email to