[PATCH v2 5/5] drm/xe: pass struct xe_device to xe_display_bo_fbdev_prefer_stolen()

Jani Nikula
2026-03-31T09:49:51Z

This is xe core code, use struct xe_device for simplicity.

Reviewed-by: Michał Grzelak <michal.grzelak@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/xe/display/xe_display_bo.c | 5 ++---
drivers/gpu/drm/xe/display/xe_display_bo.h | 4 ++--
drivers/gpu/drm/xe/display/xe_initial_plane.c | 2 +-
3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/xe/display/xe_display_bo.c b/drivers/gpu/drm/xe/display/xe_display_bo.c
index 6f372c73ab8e..f943150e4135 100644
--- a/drivers/gpu/drm/xe/display/xe_display_bo.c
+++ b/drivers/gpu/drm/xe/display/xe_display_bo.c
@@ -119,9 +119,8 @@ static u32 xe_display_bo_fbdev_pitch_align(u32 stride)
return ALIGN(stride, XE_PAGE_SIZE);
}

-bool xe_display_bo_fbdev_prefer_stolen(struct drm_device *drm, unsigned int size)
+bool xe_display_bo_fbdev_prefer_stolen(struct xe_device *xe, unsigned int size)
{
- struct xe_device *xe = to_xe_device(drm);
struct ttm_resource_manager *stolen;

stolen = ttm_manager_type(&xe->ttm, XE_PL_STOLEN);
@@ -149,7 +148,7 @@ static struct drm_gem_object *xe_display_bo_fbdev_create(struct drm_device *drm,

obj = ERR_PTR(-ENODEV);

- if (xe_display_bo_fbdev_prefer_stolen(drm, size)) {
+ if (xe_display_bo_fbdev_prefer_stolen(xe, size)) {
obj = xe_bo_create_pin_map_novm(xe, xe_device_get_root_tile(xe),
size,
ttm_bo_type_kernel,
diff --git a/drivers/gpu/drm/xe/display/xe_display_bo.h b/drivers/gpu/drm/xe/display/xe_display_bo.h
index 8980e6ecf54a..c72056884ff4 100644
--- a/drivers/gpu/drm/xe/display/xe_display_bo.h
+++ b/drivers/gpu/drm/xe/display/xe_display_bo.h
@@ -6,9 +6,9 @@

#include <linux/types.h>

-struct drm_device;
+struct xe_device;

-bool xe_display_bo_fbdev_prefer_stolen(struct drm_device *drm, unsigned int size);
+bool xe_display_bo_fbdev_prefer_stolen(struct xe_device *xe, unsigned int size);

extern const struct intel_display_bo_interface xe_display_bo_interface;

diff --git a/drivers/gpu/drm/xe/display/xe_initial_plane.c b/drivers/gpu/drm/xe/display/xe_initial_plane.c
index 73ae502bb2a5..1c7a4e8c390c 100644
--- a/drivers/gpu/drm/xe/display/xe_initial_plane.c
+++ b/drivers/gpu/drm/xe/display/xe_initial_plane.c
@@ -87,7 +87,7 @@ initial_plane_bo(struct xe_device *xe,

if (IS_ENABLED(CONFIG_FRAMEBUFFER_CONSOLE) &&
IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION) &&
- !xe_display_bo_fbdev_prefer_stolen(&xe->drm, plane_config->size)) {
+ !xe_display_bo_fbdev_prefer_stolen(xe, plane_config->size)) {
drm_info(&xe->drm, "Initial FB size exceeds half of stolen, discarding\n");
return NULL;
}
--
2.47.3