drm/xe: Modify the cfb size to be page size aligned for FBC
authorVinod Govindapillai <vinod.govindapillai@intel.com>
Fri, 12 Jan 2024 09:28:03 +0000 (11:28 +0200)
committerMika Kahola <mika.kahola@intel.com>
Fri, 19 Jan 2024 11:39:45 +0000 (13:39 +0200)
drm_gem_private_object_init expect the object size be page size
aligned. The xe_bo create functions do not update the size for
any alignment requirements. So align cfb size to be page size
aligned in xe stolen memory handling.

Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240112092803.61664-2-vinod.govindapillai@intel.com
drivers/gpu/drm/xe/compat-i915-headers/i915_gem_stolen.h

index 888e7a87a92570f00c1bdac0f1e8f8d40b452f76..bd233007c1b74af4752c6be52494f97fea302b13 100644 (file)
@@ -19,6 +19,9 @@ static inline int i915_gem_stolen_insert_node_in_range(struct xe_device *xe,
        int err;
        u32 flags = XE_BO_CREATE_PINNED_BIT | XE_BO_CREATE_STOLEN_BIT;
 
+       if (align)
+               size = ALIGN(size, align);
+
        bo = xe_bo_create_locked_range(xe, xe_device_get_root_tile(xe),
                                       NULL, size, start, end,
                                       ttm_bo_type_kernel, flags);