* [PATCH 0/4] drm/{i915, xe}: migrate stolen interface to parent interface, cleanups
@ 2025-12-04 17:24 Jani Nikula
2025-12-04 17:24 ` [PATCH 1/4] drm/i915/fbc: let to_intel_display() do its generic magic Jani Nikula
` (4 more replies)
0 siblings, 5 replies; 8+ messages in thread
From: Jani Nikula @ 2025-12-04 17:24 UTC (permalink / raw)
To: intel-xe, intel-gfx; +Cc: jani.nikula
Migrate the stolen memory interface to the parent interface.
Jani Nikula (4):
drm/i915/fbc: let to_intel_display() do its generic magic
drm/xe/stolen: unify interface with i915
drm/{i915,xe}/stolen: move stolen memory handling to display parent
interface
drm/{i915,xe}/stolen: make insert_node, area_address, area_size
optional
drivers/gpu/drm/i915/display/intel_fbc.c | 103 +++++++++---------
drivers/gpu/drm/i915/display/intel_parent.c | 76 +++++++++++++
drivers/gpu/drm/i915/display/intel_parent.h | 19 ++++
drivers/gpu/drm/i915/gem/i915_gem_stolen.c | 52 ++++++---
drivers/gpu/drm/i915/gem/i915_gem_stolen.h | 23 +---
drivers/gpu/drm/i915/i915_driver.c | 1 +
.../compat-i915-headers/gem/i915_gem_stolen.h | 40 -------
drivers/gpu/drm/xe/display/xe_display.c | 4 +-
drivers/gpu/drm/xe/display/xe_stolen.c | 62 +++++------
drivers/gpu/drm/xe/display/xe_stolen.h | 9 ++
include/drm/intel/display_parent_interface.h | 20 ++++
11 files changed, 242 insertions(+), 167 deletions(-)
delete mode 100644 drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_stolen.h
create mode 100644 drivers/gpu/drm/xe/display/xe_stolen.h
--
2.47.3
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/4] drm/i915/fbc: let to_intel_display() do its generic magic
2025-12-04 17:24 [PATCH 0/4] drm/{i915, xe}: migrate stolen interface to parent interface, cleanups Jani Nikula
@ 2025-12-04 17:24 ` Jani Nikula
2025-12-04 17:24 ` [PATCH 2/4] drm/xe/stolen: unify interface with i915 Jani Nikula
` (3 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Jani Nikula @ 2025-12-04 17:24 UTC (permalink / raw)
To: intel-xe, intel-gfx; +Cc: jani.nikula
to_intel_display() generics can handle struct intel_plane_state, struct
intel_atomic_state, and struct intel_crtc just fine. Pass them directly.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/display/intel_fbc.c | 34 ++++++++++++------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
index dd306e30d620..66d9674b4e47 100644
--- a/drivers/gpu/drm/i915/display/intel_fbc.c
+++ b/drivers/gpu/drm/i915/display/intel_fbc.c
@@ -215,7 +215,7 @@ static unsigned int _intel_fbc_cfb_stride(struct intel_display *display,
static unsigned int intel_fbc_cfb_stride(const struct intel_plane_state *plane_state)
{
- struct intel_display *display = to_intel_display(plane_state->uapi.plane->dev);
+ struct intel_display *display = to_intel_display(plane_state);
unsigned int stride = intel_fbc_plane_cfb_stride(plane_state);
unsigned int width = drm_rect_width(&plane_state->uapi.src) >> 16;
unsigned int cpp = intel_fbc_cfb_cpp(plane_state);
@@ -246,7 +246,7 @@ static unsigned int _intel_fbc_cfb_size(struct intel_display *display,
static unsigned int intel_fbc_cfb_size(const struct intel_plane_state *plane_state)
{
- struct intel_display *display = to_intel_display(plane_state->uapi.plane->dev);
+ struct intel_display *display = to_intel_display(plane_state);
unsigned int height = drm_rect_height(&plane_state->uapi.src) >> 16;
return _intel_fbc_cfb_size(display, height, intel_fbc_cfb_stride(plane_state));
@@ -254,7 +254,7 @@ static unsigned int intel_fbc_cfb_size(const struct intel_plane_state *plane_sta
static u16 intel_fbc_override_cfb_stride(const struct intel_plane_state *plane_state)
{
- struct intel_display *display = to_intel_display(plane_state->uapi.plane->dev);
+ struct intel_display *display = to_intel_display(plane_state);
unsigned int stride_aligned = intel_fbc_cfb_stride(plane_state);
unsigned int stride = intel_fbc_plane_cfb_stride(plane_state);
const struct drm_framebuffer *fb = plane_state->hw.fb;
@@ -1025,7 +1025,7 @@ static bool icl_fbc_stride_is_valid(const struct intel_plane_state *plane_state)
static bool stride_is_valid(const struct intel_plane_state *plane_state)
{
- struct intel_display *display = to_intel_display(plane_state->uapi.plane->dev);
+ struct intel_display *display = to_intel_display(plane_state);
if (DISPLAY_VER(display) >= 11)
return icl_fbc_stride_is_valid(plane_state);
@@ -1041,7 +1041,7 @@ static bool stride_is_valid(const struct intel_plane_state *plane_state)
static bool i8xx_fbc_pixel_format_is_valid(const struct intel_plane_state *plane_state)
{
- struct intel_display *display = to_intel_display(plane_state->uapi.plane->dev);
+ struct intel_display *display = to_intel_display(plane_state);
const struct drm_framebuffer *fb = plane_state->hw.fb;
switch (fb->format->format) {
@@ -1061,7 +1061,7 @@ static bool i8xx_fbc_pixel_format_is_valid(const struct intel_plane_state *plane
static bool g4x_fbc_pixel_format_is_valid(const struct intel_plane_state *plane_state)
{
- struct intel_display *display = to_intel_display(plane_state->uapi.plane->dev);
+ struct intel_display *display = to_intel_display(plane_state);
const struct drm_framebuffer *fb = plane_state->hw.fb;
switch (fb->format->format) {
@@ -1140,7 +1140,7 @@ intel_fbc_is_enable_pixel_normalizer(const struct intel_plane_state *plane_state
static bool pixel_format_is_valid(const struct intel_plane_state *plane_state)
{
- struct intel_display *display = to_intel_display(plane_state->uapi.plane->dev);
+ struct intel_display *display = to_intel_display(plane_state);
if (DISPLAY_VER(display) >= 35)
return xe3p_lpd_fbc_pixel_format_is_valid(plane_state);
@@ -1176,7 +1176,7 @@ static bool skl_fbc_rotation_is_valid(const struct intel_plane_state *plane_stat
static bool rotation_is_valid(const struct intel_plane_state *plane_state)
{
- struct intel_display *display = to_intel_display(plane_state->uapi.plane->dev);
+ struct intel_display *display = to_intel_display(plane_state);
if (DISPLAY_VER(display) >= 9)
return skl_fbc_rotation_is_valid(plane_state);
@@ -1215,7 +1215,7 @@ static void intel_fbc_max_surface_size(struct intel_display *display,
*/
static bool intel_fbc_surface_size_ok(const struct intel_plane_state *plane_state)
{
- struct intel_display *display = to_intel_display(plane_state->uapi.plane->dev);
+ struct intel_display *display = to_intel_display(plane_state);
unsigned int effective_w, effective_h, max_w, max_h;
intel_fbc_max_surface_size(display, &max_w, &max_h);
@@ -1248,7 +1248,7 @@ static void intel_fbc_max_plane_size(struct intel_display *display,
static bool intel_fbc_plane_size_valid(const struct intel_plane_state *plane_state)
{
- struct intel_display *display = to_intel_display(plane_state->uapi.plane->dev);
+ struct intel_display *display = to_intel_display(plane_state);
unsigned int w, h, max_w, max_h;
intel_fbc_max_plane_size(display, &max_w, &max_h);
@@ -1273,7 +1273,7 @@ static bool skl_fbc_tiling_valid(const struct intel_plane_state *plane_state)
static bool tiling_is_valid(const struct intel_plane_state *plane_state)
{
- struct intel_display *display = to_intel_display(plane_state->uapi.plane->dev);
+ struct intel_display *display = to_intel_display(plane_state);
if (DISPLAY_VER(display) >= 9)
return skl_fbc_tiling_valid(plane_state);
@@ -1353,7 +1353,7 @@ static void intel_fbc_update_state(struct intel_atomic_state *state,
struct intel_crtc *crtc,
struct intel_plane *plane)
{
- struct intel_display *display = to_intel_display(state->base.dev);
+ struct intel_display *display = to_intel_display(state);
const struct intel_crtc_state *crtc_state =
intel_atomic_get_new_crtc_state(state, crtc);
const struct intel_plane_state *plane_state =
@@ -1386,7 +1386,7 @@ static void intel_fbc_update_state(struct intel_atomic_state *state,
static bool intel_fbc_is_fence_ok(const struct intel_plane_state *plane_state)
{
- struct intel_display *display = to_intel_display(plane_state->uapi.plane->dev);
+ struct intel_display *display = to_intel_display(plane_state);
/*
* The use of a CPU fence is one of two ways to detect writes by the
@@ -1493,7 +1493,7 @@ static int _intel_fbc_min_cdclk(const struct intel_crtc_state *crtc_state)
static int intel_fbc_check_plane(struct intel_atomic_state *state,
struct intel_plane *plane)
{
- struct intel_display *display = to_intel_display(state->base.dev);
+ struct intel_display *display = to_intel_display(state);
struct intel_plane_state *plane_state =
intel_atomic_get_new_plane_state(state, plane);
const struct drm_framebuffer *fb = plane_state->hw.fb;
@@ -1720,7 +1720,7 @@ static bool __intel_fbc_pre_update(struct intel_atomic_state *state,
struct intel_crtc *crtc,
struct intel_plane *plane)
{
- struct intel_display *display = to_intel_display(state->base.dev);
+ struct intel_display *display = to_intel_display(state);
struct intel_fbc *fbc = plane->fbc;
bool need_vblank_wait = false;
@@ -1933,7 +1933,7 @@ static void __intel_fbc_enable(struct intel_atomic_state *state,
struct intel_crtc *crtc,
struct intel_plane *plane)
{
- struct intel_display *display = to_intel_display(state->base.dev);
+ struct intel_display *display = to_intel_display(state);
const struct intel_plane_state *plane_state =
intel_atomic_get_new_plane_state(state, plane);
struct intel_fbc *fbc = plane->fbc;
@@ -1995,7 +1995,7 @@ static void __intel_fbc_enable(struct intel_atomic_state *state,
*/
void intel_fbc_disable(struct intel_crtc *crtc)
{
- struct intel_display *display = to_intel_display(crtc->base.dev);
+ struct intel_display *display = to_intel_display(crtc);
struct intel_plane *plane;
for_each_intel_plane(display->drm, plane) {
--
2.47.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/4] drm/xe/stolen: unify interface with i915
2025-12-04 17:24 [PATCH 0/4] drm/{i915, xe}: migrate stolen interface to parent interface, cleanups Jani Nikula
2025-12-04 17:24 ` [PATCH 1/4] drm/i915/fbc: let to_intel_display() do its generic magic Jani Nikula
@ 2025-12-04 17:24 ` Jani Nikula
2025-12-04 17:24 ` [PATCH 3/4] drm/{i915, xe}/stolen: move stolen memory handling to display parent interface Jani Nikula
` (2 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Jani Nikula @ 2025-12-04 17:24 UTC (permalink / raw)
To: intel-xe, intel-gfx; +Cc: jani.nikula
Have i915_gem_stolen_node_offset() return u64, and pass const pointer to
them.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
| 4 ++--
drivers/gpu/drm/xe/display/xe_stolen.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
--git a/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_stolen.h b/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_stolen.h
index 48e3256ba37e..368045a470d1 100644
--- a/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_stolen.h
+++ b/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_stolen.h
@@ -23,13 +23,13 @@ bool i915_gem_stolen_initialized(struct drm_device *drm);
bool i915_gem_stolen_node_allocated(const struct intel_stolen_node *node);
-u32 i915_gem_stolen_node_offset(struct intel_stolen_node *node);
+u64 i915_gem_stolen_node_offset(const struct intel_stolen_node *node);
u64 i915_gem_stolen_area_address(struct drm_device *drm);
u64 i915_gem_stolen_area_size(struct drm_device *drm);
-u64 i915_gem_stolen_node_address(struct intel_stolen_node *node);
+u64 i915_gem_stolen_node_address(const struct intel_stolen_node *node);
u64 i915_gem_stolen_node_size(const struct intel_stolen_node *node);
diff --git a/drivers/gpu/drm/xe/display/xe_stolen.c b/drivers/gpu/drm/xe/display/xe_stolen.c
index 9f04ba36e930..387506586288 100644
--- a/drivers/gpu/drm/xe/display/xe_stolen.c
+++ b/drivers/gpu/drm/xe/display/xe_stolen.c
@@ -67,7 +67,7 @@ bool i915_gem_stolen_node_allocated(const struct intel_stolen_node *node)
return node->bo;
}
-u32 i915_gem_stolen_node_offset(struct intel_stolen_node *node)
+u64 i915_gem_stolen_node_offset(const struct intel_stolen_node *node)
{
struct xe_res_cursor res;
@@ -91,7 +91,7 @@ u64 i915_gem_stolen_area_size(struct drm_device *drm)
return 0;
}
-u64 i915_gem_stolen_node_address(struct intel_stolen_node *node)
+u64 i915_gem_stolen_node_address(const struct intel_stolen_node *node)
{
struct xe_device *xe = node->xe;
--
2.47.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/4] drm/{i915, xe}/stolen: move stolen memory handling to display parent interface
2025-12-04 17:24 [PATCH 0/4] drm/{i915, xe}: migrate stolen interface to parent interface, cleanups Jani Nikula
2025-12-04 17:24 ` [PATCH 1/4] drm/i915/fbc: let to_intel_display() do its generic magic Jani Nikula
2025-12-04 17:24 ` [PATCH 2/4] drm/xe/stolen: unify interface with i915 Jani Nikula
@ 2025-12-04 17:24 ` Jani Nikula
2025-12-05 4:44 ` kernel test robot
2025-12-05 5:28 ` kernel test robot
2025-12-04 17:24 ` [PATCH 4/4] drm/{i915, xe}/stolen: make insert_node, area_address, area_size optional Jani Nikula
2025-12-05 8:31 ` ✗ Fi.CI.BUILD: failure for drm/{i915, xe}: migrate stolen interface to parent interface, cleanups Patchwork
4 siblings, 2 replies; 8+ messages in thread
From: Jani Nikula @ 2025-12-04 17:24 UTC (permalink / raw)
To: intel-xe, intel-gfx; +Cc: jani.nikula
Call the stolen memory interface through the display parent interface.
This makes xe compat gem/i915_gem_stolen.h redundant, and it can be
removed.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/display/intel_fbc.c | 69 ++++++++++---------
drivers/gpu/drm/i915/display/intel_parent.c | 66 ++++++++++++++++++
drivers/gpu/drm/i915/display/intel_parent.h | 19 +++++
drivers/gpu/drm/i915/gem/i915_gem_stolen.c | 52 +++++++++-----
drivers/gpu/drm/i915/gem/i915_gem_stolen.h | 23 +------
drivers/gpu/drm/i915/i915_driver.c | 1 +
| 40 -----------
drivers/gpu/drm/xe/display/xe_display.c | 4 +-
drivers/gpu/drm/xe/display/xe_stolen.c | 47 +++++++++----
drivers/gpu/drm/xe/display/xe_stolen.h | 9 +++
include/drm/intel/display_parent_interface.h | 20 ++++++
11 files changed, 221 insertions(+), 129 deletions(-)
delete mode 100644 drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_stolen.h
create mode 100644 drivers/gpu/drm/xe/display/xe_stolen.h
diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
index 66d9674b4e47..3a85cf88b8d5 100644
--- a/drivers/gpu/drm/i915/display/intel_fbc.c
+++ b/drivers/gpu/drm/i915/display/intel_fbc.c
@@ -45,8 +45,6 @@
#include <drm/drm_fourcc.h>
#include <drm/drm_print.h>
-#include "gem/i915_gem_stolen.h"
-
#include "i915_vma.h"
#include "i9xx_plane_regs.h"
#include "intel_de.h"
@@ -391,17 +389,17 @@ static void i8xx_fbc_program_cfb(struct intel_fbc *fbc)
struct intel_display *display = fbc->display;
drm_WARN_ON(display->drm,
- range_end_overflows_t(u64, i915_gem_stolen_area_address(display->drm),
- i915_gem_stolen_node_offset(fbc->compressed_fb),
+ range_end_overflows_t(u64, intel_parent_stolen_area_address(display),
+ intel_parent_stolen_node_offset(display, fbc->compressed_fb),
U32_MAX));
drm_WARN_ON(display->drm,
- range_end_overflows_t(u64, i915_gem_stolen_area_address(display->drm),
- i915_gem_stolen_node_offset(fbc->compressed_llb),
+ range_end_overflows_t(u64, intel_parent_stolen_area_address(display),
+ intel_parent_stolen_node_offset(display, fbc->compressed_llb),
U32_MAX));
intel_de_write(display, FBC_CFB_BASE,
- i915_gem_stolen_node_address(fbc->compressed_fb));
+ intel_parent_stolen_node_address(display, fbc->compressed_fb));
intel_de_write(display, FBC_LL_BASE,
- i915_gem_stolen_node_address(fbc->compressed_llb));
+ intel_parent_stolen_node_address(display, fbc->compressed_llb));
}
static const struct intel_fbc_funcs i8xx_fbc_funcs = {
@@ -509,7 +507,7 @@ static void g4x_fbc_program_cfb(struct intel_fbc *fbc)
struct intel_display *display = fbc->display;
intel_de_write(display, DPFC_CB_BASE,
- i915_gem_stolen_node_offset(fbc->compressed_fb));
+ intel_parent_stolen_node_offset(display, fbc->compressed_fb));
}
static const struct intel_fbc_funcs g4x_fbc_funcs = {
@@ -578,7 +576,7 @@ static void ilk_fbc_program_cfb(struct intel_fbc *fbc)
struct intel_display *display = fbc->display;
intel_de_write(display, ILK_DPFC_CB_BASE(fbc->id),
- i915_gem_stolen_node_offset(fbc->compressed_fb));
+ intel_parent_stolen_node_offset(display, fbc->compressed_fb));
}
static const struct intel_fbc_funcs ilk_fbc_funcs = {
@@ -817,7 +815,7 @@ static u64 intel_fbc_stolen_end(struct intel_display *display)
* underruns, even if that range is not reserved by the BIOS. */
if (display->platform.broadwell ||
(DISPLAY_VER(display) == 9 && !display->platform.broxton))
- end = i915_gem_stolen_area_size(display->drm) - 8 * 1024 * 1024;
+ end = intel_parent_stolen_area_size(display) - 8 * 1024 * 1024;
else
end = U64_MAX;
@@ -852,14 +850,14 @@ static int find_compression_limit(struct intel_fbc *fbc,
size /= limit;
/* Try to over-allocate to reduce reallocations and fragmentation. */
- ret = i915_gem_stolen_insert_node_in_range(fbc->compressed_fb,
- size <<= 1, 4096, 0, end);
+ ret = intel_parent_stolen_insert_node_in_range(display, fbc->compressed_fb,
+ size <<= 1, 4096, 0, end);
if (ret == 0)
return limit;
for (; limit <= intel_fbc_max_limit(display); limit <<= 1) {
- ret = i915_gem_stolen_insert_node_in_range(fbc->compressed_fb,
- size >>= 1, 4096, 0, end);
+ ret = intel_parent_stolen_insert_node_in_range(display, fbc->compressed_fb,
+ size >>= 1, 4096, 0, end);
if (ret == 0)
return limit;
}
@@ -874,12 +872,12 @@ static int intel_fbc_alloc_cfb(struct intel_fbc *fbc,
int ret;
drm_WARN_ON(display->drm,
- i915_gem_stolen_node_allocated(fbc->compressed_fb));
+ intel_parent_stolen_node_allocated(display, fbc->compressed_fb));
drm_WARN_ON(display->drm,
- i915_gem_stolen_node_allocated(fbc->compressed_llb));
+ intel_parent_stolen_node_allocated(display, fbc->compressed_llb));
if (DISPLAY_VER(display) < 5 && !display->platform.g4x) {
- ret = i915_gem_stolen_insert_node(fbc->compressed_llb, 4096, 4096);
+ ret = intel_parent_stolen_insert_node(display, fbc->compressed_llb, 4096, 4096);
if (ret)
goto err;
}
@@ -895,14 +893,14 @@ static int intel_fbc_alloc_cfb(struct intel_fbc *fbc,
drm_dbg_kms(display->drm,
"reserved %llu bytes of contiguous stolen space for FBC, limit: %d\n",
- i915_gem_stolen_node_size(fbc->compressed_fb), fbc->limit);
+ intel_parent_stolen_node_size(display, fbc->compressed_fb), fbc->limit);
return 0;
err_llb:
- if (i915_gem_stolen_node_allocated(fbc->compressed_llb))
- i915_gem_stolen_remove_node(fbc->compressed_llb);
+ if (intel_parent_stolen_node_allocated(display, fbc->compressed_llb))
+ intel_parent_stolen_remove_node(display, fbc->compressed_llb);
err:
- if (i915_gem_stolen_initialized(display->drm))
+ if (intel_parent_stolen_initialized(display))
drm_info_once(display->drm,
"not enough stolen space for compressed buffer (need %d more bytes), disabling. Hint: you may be able to increase stolen memory size in the BIOS to avoid this.\n", size);
return -ENOSPC;
@@ -956,13 +954,15 @@ static void intel_fbc_program_workarounds(struct intel_fbc *fbc)
static void __intel_fbc_cleanup_cfb(struct intel_fbc *fbc)
{
+ struct intel_display *display = fbc->display;
+
if (WARN_ON(intel_fbc_hw_is_active(fbc)))
return;
- if (i915_gem_stolen_node_allocated(fbc->compressed_llb))
- i915_gem_stolen_remove_node(fbc->compressed_llb);
- if (i915_gem_stolen_node_allocated(fbc->compressed_fb))
- i915_gem_stolen_remove_node(fbc->compressed_fb);
+ if (intel_parent_stolen_node_allocated(display, fbc->compressed_llb))
+ intel_parent_stolen_remove_node(display, fbc->compressed_llb);
+ if (intel_parent_stolen_node_allocated(display, fbc->compressed_fb))
+ intel_parent_stolen_remove_node(display, fbc->compressed_fb);
}
void intel_fbc_cleanup(struct intel_display *display)
@@ -975,8 +975,8 @@ void intel_fbc_cleanup(struct intel_display *display)
__intel_fbc_cleanup_cfb(fbc);
mutex_unlock(&fbc->lock);
- i915_gem_stolen_node_free(fbc->compressed_fb);
- i915_gem_stolen_node_free(fbc->compressed_llb);
+ intel_parent_stolen_node_free(display, fbc->compressed_fb);
+ intel_parent_stolen_node_free(display, fbc->compressed_llb);
kfree(fbc);
}
@@ -1407,12 +1407,13 @@ static bool intel_fbc_is_fence_ok(const struct intel_plane_state *plane_state)
static bool intel_fbc_is_cfb_ok(const struct intel_plane_state *plane_state)
{
+ struct intel_display *display = to_intel_display(plane_state);
struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
struct intel_fbc *fbc = plane->fbc;
return intel_fbc_min_limit(plane_state) <= fbc->limit &&
intel_fbc_cfb_size(plane_state) <= fbc->limit *
- i915_gem_stolen_node_size(fbc->compressed_fb);
+ intel_parent_stolen_node_size(display, fbc->compressed_fb);
}
static bool intel_fbc_is_ok(const struct intel_plane_state *plane_state)
@@ -1504,7 +1505,7 @@ static int intel_fbc_check_plane(struct intel_atomic_state *state,
if (!fbc)
return 0;
- if (!i915_gem_stolen_initialized(display->drm)) {
+ if (!intel_parent_stolen_initialized(display)) {
plane_state->no_fbc_reason = "stolen memory not initialised";
return 0;
}
@@ -2205,10 +2206,10 @@ static struct intel_fbc *intel_fbc_create(struct intel_display *display,
if (!fbc)
return NULL;
- fbc->compressed_fb = i915_gem_stolen_node_alloc(display->drm);
+ fbc->compressed_fb = intel_parent_stolen_node_alloc(display);
if (!fbc->compressed_fb)
goto err;
- fbc->compressed_llb = i915_gem_stolen_node_alloc(display->drm);
+ fbc->compressed_llb = intel_parent_stolen_node_alloc(display);
if (!fbc->compressed_llb)
goto err;
@@ -2233,8 +2234,8 @@ static struct intel_fbc *intel_fbc_create(struct intel_display *display,
return fbc;
err:
- i915_gem_stolen_node_free(fbc->compressed_llb);
- i915_gem_stolen_node_free(fbc->compressed_fb);
+ intel_parent_stolen_node_free(display, fbc->compressed_llb);
+ intel_parent_stolen_node_free(display, fbc->compressed_fb);
kfree(fbc);
return NULL;
diff --git a/drivers/gpu/drm/i915/display/intel_parent.c b/drivers/gpu/drm/i915/display/intel_parent.c
index 2ea310cc3509..49cb64ca8c4c 100644
--- a/drivers/gpu/drm/i915/display/intel_parent.c
+++ b/drivers/gpu/drm/i915/display/intel_parent.c
@@ -79,6 +79,72 @@ void intel_parent_rps_ilk_irq_handler(struct intel_display *display)
display->parent->rps->ilk_irq_handler(display->drm);
}
+int intel_parent_stolen_insert_node_in_range(struct intel_display *display,
+ struct intel_stolen_node *node, u64 size,
+ unsigned int align, u64 start, u64 end)
+{
+ return display->parent->stolen->insert_node_in_range(node, size, align, start, end);
+}
+
+int intel_parent_stolen_insert_node(struct intel_display *display, struct intel_stolen_node *node, u64 size,
+ unsigned int align)
+{
+ return display->parent->stolen->insert_node(node, size, align);
+}
+
+void intel_parent_stolen_remove_node(struct intel_display *display,
+ struct intel_stolen_node *node)
+{
+ display->parent->stolen->remove_node(node);
+}
+
+bool intel_parent_stolen_initialized(struct intel_display *display)
+{
+ return display->parent->stolen->initialized(display->drm);
+}
+
+bool intel_parent_stolen_node_allocated(struct intel_display *display,
+ const struct intel_stolen_node *node)
+{
+ return display->parent->stolen->node_allocated(node);
+}
+
+u32 intel_parent_stolen_node_offset(struct intel_display *display, struct intel_stolen_node *node)
+{
+ return display->parent->stolen->node_offset(node);
+}
+
+u64 intel_parent_stolen_area_address(struct intel_display *display)
+{
+ return display->parent->stolen->area_address(display->drm);
+}
+
+u64 intel_parent_stolen_area_size(struct intel_display *display)
+{
+ return display->parent->stolen->area_size(display->drm);
+}
+
+u64 intel_parent_stolen_node_address(struct intel_display *display, struct intel_stolen_node *node)
+{
+ return display->parent->stolen->node_address(node);
+}
+
+u64 intel_parent_stolen_node_size(struct intel_display *display, const struct intel_stolen_node *node)
+{
+ return display->parent->stolen->node_size(node);
+}
+
+struct intel_stolen_node *intel_parent_stolen_node_alloc(struct intel_display *display)
+{
+ return display->parent->stolen->node_alloc(display->drm);
+}
+
+void intel_parent_stolen_node_free(struct intel_display *display, const struct intel_stolen_node *node)
+{
+ display->parent->stolen->node_free(node);
+}
+
+
bool intel_parent_vgpu_active(struct intel_display *display)
{
return display->parent->vgpu_active && display->parent->vgpu_active(display->drm);
diff --git a/drivers/gpu/drm/i915/display/intel_parent.h b/drivers/gpu/drm/i915/display/intel_parent.h
index 8f91a6f75c53..bc740dfad985 100644
--- a/drivers/gpu/drm/i915/display/intel_parent.h
+++ b/drivers/gpu/drm/i915/display/intel_parent.h
@@ -9,6 +9,7 @@
struct dma_fence;
struct intel_display;
struct intel_hdcp_gsc_context;
+struct intel_stolen_node;
ssize_t intel_parent_hdcp_gsc_msg_send(struct intel_display *display,
struct intel_hdcp_gsc_context *gsc_context,
@@ -27,6 +28,24 @@ void intel_parent_rps_boost_if_not_started(struct intel_display *display, struct
void intel_parent_rps_mark_interactive(struct intel_display *display, bool interactive);
void intel_parent_rps_ilk_irq_handler(struct intel_display *display);
+int intel_parent_stolen_insert_node_in_range(struct intel_display *display,
+ struct intel_stolen_node *node, u64 size,
+ unsigned int align, u64 start, u64 end);
+int intel_parent_stolen_insert_node(struct intel_display *display, struct intel_stolen_node *node, u64 size,
+ unsigned int align);
+void intel_parent_stolen_remove_node(struct intel_display *display,
+ struct intel_stolen_node *node);
+bool intel_parent_stolen_initialized(struct intel_display *display);
+bool intel_parent_stolen_node_allocated(struct intel_display *display,
+ const struct intel_stolen_node *node);
+u32 intel_parent_stolen_node_offset(struct intel_display *display, struct intel_stolen_node *node);
+u64 intel_parent_stolen_area_address(struct intel_display *display);
+u64 intel_parent_stolen_area_size(struct intel_display *display);
+u64 intel_parent_stolen_node_address(struct intel_display *display, struct intel_stolen_node *node);
+u64 intel_parent_stolen_node_size(struct intel_display *display, const struct intel_stolen_node *node);
+struct intel_stolen_node *intel_parent_stolen_node_alloc(struct intel_display *display);
+void intel_parent_stolen_node_free(struct intel_display *display, const struct intel_stolen_node *node);
+
bool intel_parent_vgpu_active(struct intel_display *display);
bool intel_parent_has_fenced_regions(struct intel_display *display);
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
index f859c99f969b..c3e0b8da485c 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
@@ -8,6 +8,7 @@
#include <drm/drm_mm.h>
#include <drm/drm_print.h>
+#include <drm/intel/display_parent_interface.h>
#include <drm/intel/i915_drm.h>
#include "gem/i915_gem_lmem.h"
@@ -64,8 +65,8 @@ static int __i915_gem_stolen_insert_node_in_range(struct drm_i915_private *i915,
return ret;
}
-int i915_gem_stolen_insert_node_in_range(struct intel_stolen_node *node, u64 size,
- unsigned int alignment, u64 start, u64 end)
+static int i915_gem_stolen_insert_node_in_range(struct intel_stolen_node *node, u64 size,
+ unsigned int alignment, u64 start, u64 end)
{
return __i915_gem_stolen_insert_node_in_range(node->i915, &node->node,
size, alignment,
@@ -82,8 +83,8 @@ static int __i915_gem_stolen_insert_node(struct drm_i915_private *i915,
U64_MAX);
}
-int i915_gem_stolen_insert_node(struct intel_stolen_node *node, u64 size,
- unsigned int alignment)
+static int i915_gem_stolen_insert_node(struct intel_stolen_node *node, u64 size,
+ unsigned int alignment)
{
return __i915_gem_stolen_insert_node(node->i915, &node->node, size, alignment);
}
@@ -96,7 +97,7 @@ static void __i915_gem_stolen_remove_node(struct drm_i915_private *i915,
mutex_unlock(&i915->mm.stolen_lock);
}
-void i915_gem_stolen_remove_node(struct intel_stolen_node *node)
+static void i915_gem_stolen_remove_node(struct intel_stolen_node *node)
{
__i915_gem_stolen_remove_node(node->i915, &node->node);
}
@@ -1025,50 +1026,50 @@ bool i915_gem_object_is_stolen(const struct drm_i915_gem_object *obj)
return obj->ops == &i915_gem_object_stolen_ops;
}
-bool i915_gem_stolen_initialized(struct drm_device *drm)
+static bool i915_gem_stolen_initialized(struct drm_device *drm)
{
struct drm_i915_private *i915 = to_i915(drm);
return drm_mm_initialized(&i915->mm.stolen);
}
-u64 i915_gem_stolen_area_address(struct drm_device *drm)
+static u64 i915_gem_stolen_area_address(struct drm_device *drm)
{
struct drm_i915_private *i915 = to_i915(drm);
return i915->dsm.stolen.start;
}
-u64 i915_gem_stolen_area_size(struct drm_device *drm)
+static u64 i915_gem_stolen_area_size(struct drm_device *drm)
{
struct drm_i915_private *i915 = to_i915(drm);
return resource_size(&i915->dsm.stolen);
}
-u64 i915_gem_stolen_node_address(const struct intel_stolen_node *node)
+static u64 i915_gem_stolen_node_offset(const struct intel_stolen_node *node)
+{
+ return node->node.start;
+}
+
+static u64 i915_gem_stolen_node_address(const struct intel_stolen_node *node)
{
struct drm_i915_private *i915 = node->i915;
return i915->dsm.stolen.start + i915_gem_stolen_node_offset(node);
}
-bool i915_gem_stolen_node_allocated(const struct intel_stolen_node *node)
+static bool i915_gem_stolen_node_allocated(const struct intel_stolen_node *node)
{
return drm_mm_node_allocated(&node->node);
}
-u64 i915_gem_stolen_node_offset(const struct intel_stolen_node *node)
-{
- return node->node.start;
-}
-
-u64 i915_gem_stolen_node_size(const struct intel_stolen_node *node)
+static u64 i915_gem_stolen_node_size(const struct intel_stolen_node *node)
{
return node->node.size;
}
-struct intel_stolen_node *i915_gem_stolen_node_alloc(struct drm_device *drm)
+static struct intel_stolen_node *i915_gem_stolen_node_alloc(struct drm_device *drm)
{
struct drm_i915_private *i915 = to_i915(drm);
struct intel_stolen_node *node;
@@ -1082,7 +1083,22 @@ struct intel_stolen_node *i915_gem_stolen_node_alloc(struct drm_device *drm)
return node;
}
-void i915_gem_stolen_node_free(const struct intel_stolen_node *node)
+static void i915_gem_stolen_node_free(const struct intel_stolen_node *node)
{
kfree(node);
}
+
+const struct intel_display_stolen_interface i915_display_stolen_interface = {
+ .insert_node_in_range = i915_gem_stolen_insert_node_in_range,
+ .insert_node = i915_gem_stolen_insert_node,
+ .remove_node = i915_gem_stolen_remove_node,
+ .initialized = i915_gem_stolen_initialized,
+ .node_allocated = i915_gem_stolen_node_allocated,
+ .node_offset = i915_gem_stolen_node_offset,
+ .area_address = i915_gem_stolen_area_address,
+ .area_size = i915_gem_stolen_area_size,
+ .node_address = i915_gem_stolen_node_address,
+ .node_size = i915_gem_stolen_node_size,
+ .node_alloc = i915_gem_stolen_node_alloc,
+ .node_free = i915_gem_stolen_node_free,
+};
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_stolen.h b/drivers/gpu/drm/i915/gem/i915_gem_stolen.h
index 7b0386002ed4..6db5262046a2 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_stolen.h
+++ b/drivers/gpu/drm/i915/gem/i915_gem_stolen.h
@@ -8,17 +8,9 @@
#include <linux/types.h>
-struct drm_device;
struct drm_i915_gem_object;
struct drm_i915_private;
-struct intel_stolen_node;
-
-int i915_gem_stolen_insert_node(struct intel_stolen_node *node, u64 size,
- unsigned alignment);
-int i915_gem_stolen_insert_node_in_range(struct intel_stolen_node *node, u64 size,
- unsigned alignment, u64 start,
- u64 end);
-void i915_gem_stolen_remove_node(struct intel_stolen_node *node);
+
struct intel_memory_region *
i915_gem_stolen_smem_setup(struct drm_i915_private *i915, u16 type,
u16 instance);
@@ -34,17 +26,6 @@ bool i915_gem_object_is_stolen(const struct drm_i915_gem_object *obj);
#define I915_GEM_STOLEN_BIAS SZ_128K
-bool i915_gem_stolen_initialized(struct drm_device *drm);
-u64 i915_gem_stolen_area_address(struct drm_device *drm);
-u64 i915_gem_stolen_area_size(struct drm_device *drm);
-
-u64 i915_gem_stolen_node_address(const struct intel_stolen_node *node);
-
-bool i915_gem_stolen_node_allocated(const struct intel_stolen_node *node);
-u64 i915_gem_stolen_node_offset(const struct intel_stolen_node *node);
-u64 i915_gem_stolen_node_size(const struct intel_stolen_node *node);
-
-struct intel_stolen_node *i915_gem_stolen_node_alloc(struct drm_device *drm);
-void i915_gem_stolen_node_free(const struct intel_stolen_node *node);
+extern const struct intel_display_stolen_interface i915_display_stolen_interface;
#endif /* __I915_GEM_STOLEN_H__ */
diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
index d98839427ef9..fe84df4eae8f 100644
--- a/drivers/gpu/drm/i915/i915_driver.c
+++ b/drivers/gpu/drm/i915/i915_driver.c
@@ -762,6 +762,7 @@ static const struct intel_display_parent_interface parent = {
.rpm = &i915_display_rpm_interface,
.irq = &i915_display_irq_interface,
.rps = &i915_display_rps_interface,
+ .stolen = &i915_display_stolen_interface,
.vgpu_active = vgpu_active,
.has_fenced_regions = has_fenced_regions,
.fence_priority_display = fence_priority_display,
diff --git a/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_stolen.h b/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_stolen.h
deleted file mode 100644
index 368045a470d1..000000000000
--- a/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_stolen.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* SPDX-License-Identifier: MIT */
-/*
- * Copyright © 2024 Intel Corporation
- */
-
-#ifndef _I915_GEM_STOLEN_H_
-#define _I915_GEM_STOLEN_H_
-
-#include <linux/types.h>
-
-struct drm_device;
-struct intel_stolen_node;
-
-int i915_gem_stolen_insert_node_in_range(struct intel_stolen_node *node, u64 size,
- unsigned int align, u64 start, u64 end);
-
-int i915_gem_stolen_insert_node(struct intel_stolen_node *node, u64 size,
- unsigned int align);
-
-void i915_gem_stolen_remove_node(struct intel_stolen_node *node);
-
-bool i915_gem_stolen_initialized(struct drm_device *drm);
-
-bool i915_gem_stolen_node_allocated(const struct intel_stolen_node *node);
-
-u64 i915_gem_stolen_node_offset(const struct intel_stolen_node *node);
-
-u64 i915_gem_stolen_area_address(struct drm_device *drm);
-
-u64 i915_gem_stolen_area_size(struct drm_device *drm);
-
-u64 i915_gem_stolen_node_address(const struct intel_stolen_node *node);
-
-u64 i915_gem_stolen_node_size(const struct intel_stolen_node *node);
-
-struct intel_stolen_node *i915_gem_stolen_node_alloc(struct drm_device *drm);
-
-void i915_gem_stolen_node_free(const struct intel_stolen_node *node);
-
-#endif
diff --git a/drivers/gpu/drm/xe/display/xe_display.c b/drivers/gpu/drm/xe/display/xe_display.c
index 9d2aa69ea428..9fb5c2f3ddd8 100644
--- a/drivers/gpu/drm/xe/display/xe_display.c
+++ b/drivers/gpu/drm/xe/display/xe_display.c
@@ -36,8 +36,9 @@
#include "intel_opregion.h"
#include "skl_watermark.h"
#include "xe_display_rpm.h"
-#include "xe_module.h"
#include "xe_hdcp_gsc.h"
+#include "xe_module.h"
+#include "xe_stolen.h"
/* Ensure drm and display members are placed properly. */
INTEL_DISPLAY_MEMBER_STATIC_ASSERT(struct xe_device, drm, display);
@@ -538,6 +539,7 @@ static const struct intel_display_parent_interface parent = {
.hdcp = &xe_display_hdcp_interface,
.rpm = &xe_display_rpm_interface,
.irq = &xe_display_irq_interface,
+ .stolen = &xe_display_stolen_interface,
};
/**
diff --git a/drivers/gpu/drm/xe/display/xe_stolen.c b/drivers/gpu/drm/xe/display/xe_stolen.c
index 387506586288..cc7aec7db76c 100644
--- a/drivers/gpu/drm/xe/display/xe_stolen.c
+++ b/drivers/gpu/drm/xe/display/xe_stolen.c
@@ -1,8 +1,10 @@
// SPDX-License-Identifier: MIT
/* Copyright © 2025 Intel Corporation */
-#include "gem/i915_gem_stolen.h"
+#include <drm/intel/display_parent_interface.h>
+
#include "xe_res_cursor.h"
+#include "xe_stolen.h"
#include "xe_ttm_stolen_mgr.h"
#include "xe_validation.h"
@@ -11,8 +13,8 @@ struct intel_stolen_node {
struct xe_bo *bo;
};
-int i915_gem_stolen_insert_node_in_range(struct intel_stolen_node *node, u64 size,
- unsigned int align, u64 start, u64 end)
+static int xe_stolen_insert_node_in_range(struct intel_stolen_node *node, u64 size,
+ unsigned int align, u64 start, u64 end)
{
struct xe_device *xe = node->xe;
@@ -41,7 +43,7 @@ int i915_gem_stolen_insert_node_in_range(struct intel_stolen_node *node, u64 siz
return err;
}
-int i915_gem_stolen_insert_node(struct intel_stolen_node *node, u64 size, unsigned int align)
+static int xe_stolen_insert_node(struct intel_stolen_node *node, u64 size, unsigned int align)
{
/* Not used on xe */
WARN_ON(1);
@@ -49,25 +51,25 @@ int i915_gem_stolen_insert_node(struct intel_stolen_node *node, u64 size, unsign
return -ENODEV;
}
-void i915_gem_stolen_remove_node(struct intel_stolen_node *node)
+static void xe_stolen_remove_node(struct intel_stolen_node *node)
{
xe_bo_unpin_map_no_vm(node->bo);
node->bo = NULL;
}
-bool i915_gem_stolen_initialized(struct drm_device *drm)
+static bool xe_stolen_initialized(struct drm_device *drm)
{
struct xe_device *xe = to_xe_device(drm);
return ttm_manager_type(&xe->ttm, XE_PL_STOLEN);
}
-bool i915_gem_stolen_node_allocated(const struct intel_stolen_node *node)
+static bool xe_stolen_node_allocated(const struct intel_stolen_node *node)
{
return node->bo;
}
-u64 i915_gem_stolen_node_offset(const struct intel_stolen_node *node)
+static u64 xe_stolen_node_offset(const struct intel_stolen_node *node)
{
struct xe_res_cursor res;
@@ -76,7 +78,7 @@ u64 i915_gem_stolen_node_offset(const struct intel_stolen_node *node)
}
/* Used for < gen4. These are not supported by Xe */
-u64 i915_gem_stolen_area_address(struct drm_device *drm)
+static u64 xe_stolen_area_address(struct drm_device *drm)
{
WARN_ON(1);
@@ -84,26 +86,26 @@ u64 i915_gem_stolen_area_address(struct drm_device *drm)
}
/* Used for gen9 specific WA. Gen9 is not supported by Xe */
-u64 i915_gem_stolen_area_size(struct drm_device *drm)
+static u64 xe_stolen_area_size(struct drm_device *drm)
{
WARN_ON(1);
return 0;
}
-u64 i915_gem_stolen_node_address(const struct intel_stolen_node *node)
+static u64 xe_stolen_node_address(const struct intel_stolen_node *node)
{
struct xe_device *xe = node->xe;
- return xe_ttm_stolen_gpu_offset(xe) + i915_gem_stolen_node_offset(node);
+ return xe_ttm_stolen_gpu_offset(xe) + xe_stolen_node_offset(node);
}
-u64 i915_gem_stolen_node_size(const struct intel_stolen_node *node)
+static u64 xe_stolen_node_size(const struct intel_stolen_node *node)
{
return node->bo->ttm.base.size;
}
-struct intel_stolen_node *i915_gem_stolen_node_alloc(struct drm_device *drm)
+static struct intel_stolen_node *xe_stolen_node_alloc(struct drm_device *drm)
{
struct xe_device *xe = to_xe_device(drm);
struct intel_stolen_node *node;
@@ -117,7 +119,22 @@ struct intel_stolen_node *i915_gem_stolen_node_alloc(struct drm_device *drm)
return node;
}
-void i915_gem_stolen_node_free(const struct intel_stolen_node *node)
+static void xe_stolen_node_free(const struct intel_stolen_node *node)
{
kfree(node);
}
+
+const struct intel_display_stolen_interface xe_display_stolen_interface = {
+ .insert_node_in_range = xe_stolen_insert_node_in_range,
+ .insert_node = xe_stolen_insert_node,
+ .remove_node = xe_stolen_remove_node,
+ .initialized = xe_stolen_initialized,
+ .node_allocated = xe_stolen_node_allocated,
+ .node_offset = xe_stolen_node_offset,
+ .area_address = xe_stolen_area_address,
+ .area_size = xe_stolen_area_size,
+ .node_address = xe_stolen_node_address,
+ .node_size = xe_stolen_node_size,
+ .node_alloc = xe_stolen_node_alloc,
+ .node_free = xe_stolen_node_free,
+};
diff --git a/drivers/gpu/drm/xe/display/xe_stolen.h b/drivers/gpu/drm/xe/display/xe_stolen.h
new file mode 100644
index 000000000000..db86b9e01242
--- /dev/null
+++ b/drivers/gpu/drm/xe/display/xe_stolen.h
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: MIT */
+/* Copyright © 2025 Intel Corporation */
+
+#ifndef __XE_STOLEN_H__
+#define __XE_STOLEN_H__
+
+extern const struct intel_display_stolen_interface xe_display_stolen_interface;
+
+#endif
diff --git a/include/drm/intel/display_parent_interface.h b/include/drm/intel/display_parent_interface.h
index 61d1b22adc83..f590e846464d 100644
--- a/include/drm/intel/display_parent_interface.h
+++ b/include/drm/intel/display_parent_interface.h
@@ -9,6 +9,7 @@
struct dma_fence;
struct drm_device;
struct intel_hdcp_gsc_context;
+struct intel_stolen_node;
struct ref_tracker;
struct intel_display_rpm_interface {
@@ -47,6 +48,22 @@ struct intel_display_rps_interface {
void (*ilk_irq_handler)(struct drm_device *drm);
};
+struct intel_display_stolen_interface {
+ int (*insert_node_in_range)(struct intel_stolen_node *node, u64 size,
+ unsigned int align, u64 start, u64 end);
+ int (*insert_node)(struct intel_stolen_node *node, u64 size, unsigned int align);
+ void (*remove_node)(struct intel_stolen_node *node);
+ bool (*initialized)(struct drm_device *drm);
+ bool (*node_allocated)(const struct intel_stolen_node *node);
+ u64 (*node_offset)(const struct intel_stolen_node *node);
+ u64 (*area_address)(struct drm_device *drm);
+ u64 (*area_size)(struct drm_device *drm);
+ u64 (*node_address)(const struct intel_stolen_node *node);
+ u64 (*node_size)(const struct intel_stolen_node *node);
+ struct intel_stolen_node *(*node_alloc)(struct drm_device *drm);
+ void (*node_free)(const struct intel_stolen_node *node);
+};
+
/**
* struct intel_display_parent_interface - services parent driver provides to display
*
@@ -72,6 +89,9 @@ struct intel_display_parent_interface {
/** @rpm: RPS interface. Optional. */
const struct intel_display_rps_interface *rps;
+ /** @stolen: Stolen memory. */
+ const struct intel_display_stolen_interface *stolen;
+
/** @vgpu_active: Is vGPU active? Optional. */
bool (*vgpu_active)(struct drm_device *drm);
--
2.47.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 4/4] drm/{i915, xe}/stolen: make insert_node, area_address, area_size optional
2025-12-04 17:24 [PATCH 0/4] drm/{i915, xe}: migrate stolen interface to parent interface, cleanups Jani Nikula
` (2 preceding siblings ...)
2025-12-04 17:24 ` [PATCH 3/4] drm/{i915, xe}/stolen: move stolen memory handling to display parent interface Jani Nikula
@ 2025-12-04 17:24 ` Jani Nikula
2025-12-05 8:31 ` ✗ Fi.CI.BUILD: failure for drm/{i915, xe}: migrate stolen interface to parent interface, cleanups Patchwork
4 siblings, 0 replies; 8+ messages in thread
From: Jani Nikula @ 2025-12-04 17:24 UTC (permalink / raw)
To: intel-xe, intel-gfx; +Cc: jani.nikula
Since the stolen memory hooks are function pointers, make some of them
optional instead of having to define them for xe.
insert_node, area_address, and area_size are only needed on platforms
not supported by xe.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/display/intel_parent.c | 10 ++++++++
drivers/gpu/drm/xe/display/xe_stolen.c | 27 --------------------
include/drm/intel/display_parent_interface.h | 6 ++---
3 files changed, 13 insertions(+), 30 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_parent.c b/drivers/gpu/drm/i915/display/intel_parent.c
index 49cb64ca8c4c..d16163007545 100644
--- a/drivers/gpu/drm/i915/display/intel_parent.c
+++ b/drivers/gpu/drm/i915/display/intel_parent.c
@@ -17,6 +17,7 @@
* function pointer interface.
*/
+#include <drm/drm_print.h>
#include <drm/intel/display_parent_interface.h>
#include "intel_display_core.h"
@@ -89,6 +90,9 @@ int intel_parent_stolen_insert_node_in_range(struct intel_display *display,
int intel_parent_stolen_insert_node(struct intel_display *display, struct intel_stolen_node *node, u64 size,
unsigned int align)
{
+ if (drm_WARN_ON_ONCE(display->drm, !display->parent->stolen->insert_node))
+ return -ENODEV;
+
return display->parent->stolen->insert_node(node, size, align);
}
@@ -116,11 +120,17 @@ u32 intel_parent_stolen_node_offset(struct intel_display *display, struct intel_
u64 intel_parent_stolen_area_address(struct intel_display *display)
{
+ if (drm_WARN_ON_ONCE(display->drm, !display->parent->stolen->area_address))
+ return 0;
+
return display->parent->stolen->area_address(display->drm);
}
u64 intel_parent_stolen_area_size(struct intel_display *display)
{
+ if (drm_WARN_ON_ONCE(display->drm, !display->parent->stolen->area_size))
+ return 0;
+
return display->parent->stolen->area_size(display->drm);
}
diff --git a/drivers/gpu/drm/xe/display/xe_stolen.c b/drivers/gpu/drm/xe/display/xe_stolen.c
index cc7aec7db76c..12771709183a 100644
--- a/drivers/gpu/drm/xe/display/xe_stolen.c
+++ b/drivers/gpu/drm/xe/display/xe_stolen.c
@@ -43,14 +43,6 @@ static int xe_stolen_insert_node_in_range(struct intel_stolen_node *node, u64 si
return err;
}
-static int xe_stolen_insert_node(struct intel_stolen_node *node, u64 size, unsigned int align)
-{
- /* Not used on xe */
- WARN_ON(1);
-
- return -ENODEV;
-}
-
static void xe_stolen_remove_node(struct intel_stolen_node *node)
{
xe_bo_unpin_map_no_vm(node->bo);
@@ -77,22 +69,6 @@ static u64 xe_stolen_node_offset(const struct intel_stolen_node *node)
return res.start;
}
-/* Used for < gen4. These are not supported by Xe */
-static u64 xe_stolen_area_address(struct drm_device *drm)
-{
- WARN_ON(1);
-
- return 0;
-}
-
-/* Used for gen9 specific WA. Gen9 is not supported by Xe */
-static u64 xe_stolen_area_size(struct drm_device *drm)
-{
- WARN_ON(1);
-
- return 0;
-}
-
static u64 xe_stolen_node_address(const struct intel_stolen_node *node)
{
struct xe_device *xe = node->xe;
@@ -126,13 +102,10 @@ static void xe_stolen_node_free(const struct intel_stolen_node *node)
const struct intel_display_stolen_interface xe_display_stolen_interface = {
.insert_node_in_range = xe_stolen_insert_node_in_range,
- .insert_node = xe_stolen_insert_node,
.remove_node = xe_stolen_remove_node,
.initialized = xe_stolen_initialized,
.node_allocated = xe_stolen_node_allocated,
.node_offset = xe_stolen_node_offset,
- .area_address = xe_stolen_area_address,
- .area_size = xe_stolen_area_size,
.node_address = xe_stolen_node_address,
.node_size = xe_stolen_node_size,
.node_alloc = xe_stolen_node_alloc,
diff --git a/include/drm/intel/display_parent_interface.h b/include/drm/intel/display_parent_interface.h
index f590e846464d..cc13b2ce1324 100644
--- a/include/drm/intel/display_parent_interface.h
+++ b/include/drm/intel/display_parent_interface.h
@@ -51,13 +51,13 @@ struct intel_display_rps_interface {
struct intel_display_stolen_interface {
int (*insert_node_in_range)(struct intel_stolen_node *node, u64 size,
unsigned int align, u64 start, u64 end);
- int (*insert_node)(struct intel_stolen_node *node, u64 size, unsigned int align);
+ int (*insert_node)(struct intel_stolen_node *node, u64 size, unsigned int align); /* Optional */
void (*remove_node)(struct intel_stolen_node *node);
bool (*initialized)(struct drm_device *drm);
bool (*node_allocated)(const struct intel_stolen_node *node);
u64 (*node_offset)(const struct intel_stolen_node *node);
- u64 (*area_address)(struct drm_device *drm);
- u64 (*area_size)(struct drm_device *drm);
+ u64 (*area_address)(struct drm_device *drm); /* Optional */
+ u64 (*area_size)(struct drm_device *drm); /* Optional */
u64 (*node_address)(const struct intel_stolen_node *node);
u64 (*node_size)(const struct intel_stolen_node *node);
struct intel_stolen_node *(*node_alloc)(struct drm_device *drm);
--
2.47.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 3/4] drm/{i915, xe}/stolen: move stolen memory handling to display parent interface
2025-12-04 17:24 ` [PATCH 3/4] drm/{i915, xe}/stolen: move stolen memory handling to display parent interface Jani Nikula
@ 2025-12-05 4:44 ` kernel test robot
2025-12-05 5:28 ` kernel test robot
1 sibling, 0 replies; 8+ messages in thread
From: kernel test robot @ 2025-12-05 4:44 UTC (permalink / raw)
To: Jani Nikula, intel-xe, intel-gfx; +Cc: llvm, oe-kbuild-all, jani.nikula
Hi Jani,
kernel test robot noticed the following build errors:
[auto build test ERROR on drm-tip/drm-tip]
[cannot apply to drm-i915/for-linux-next drm-i915/for-linux-next-fixes drm-xe/drm-xe-next linus/master v6.18 next-20251204]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Jani-Nikula/drm-i915-fbc-let-to_intel_display-do-its-generic-magic/20251205-012659
base: https://gitlab.freedesktop.org/drm/tip.git drm-tip
patch link: https://lore.kernel.org/r/cc2125f57b98401ea47746ad4784bb4bc6b198c2.1764868989.git.jani.nikula%40intel.com
patch subject: [PATCH 3/4] drm/{i915, xe}/stolen: move stolen memory handling to display parent interface
config: x86_64-rhel-9.4-rust (https://download.01.org/0day-ci/archive/20251205/202512051220.m3NhvHcT-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
rustc: rustc 1.88.0 (6b00bc388 2025-06-23)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251205/202512051220.m3NhvHcT-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512051220.m3NhvHcT-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/gpu/drm/i915/display/intel_fbc.c:1011:11: error: call to undeclared function 'i915_gem_stolen_node_offset'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
1011 | offset = i915_gem_stolen_node_offset(fbc->compressed_fb) / (4 * 1024);
| ^
drivers/gpu/drm/i915/display/intel_fbc.c:1011:11: note: did you mean 'intel_parent_stolen_node_offset'?
drivers/gpu/drm/i915/display/intel_parent.h:41:5: note: 'intel_parent_stolen_node_offset' declared here
41 | u32 intel_parent_stolen_node_offset(struct intel_display *display, struct intel_stolen_node *node);
| ^
1 error generated.
vim +/i915_gem_stolen_node_offset +1011 drivers/gpu/drm/i915/display/intel_fbc.c
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 998
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 999 static void fbc_sys_cache_enable(const struct intel_fbc *fbc)
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1000 {
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1001 struct intel_display *display = fbc->display;
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1002 struct sys_cache_cfg *sys_cache = &display->fbc.sys_cache;
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1003 int range, offset;
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1004 u32 cfg;
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1005
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1006 if (!HAS_FBC_SYS_CACHE(display))
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1007 return;
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1008
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1009 range = fbc_sys_cache_limit(display) / (64 * 1024);
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1010
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 @1011 offset = i915_gem_stolen_node_offset(fbc->compressed_fb) / (4 * 1024);
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1012
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1013 cfg = FBC_SYS_CACHE_TAG_USE_RES_SPACE | FBC_SYS_CACHEABLE_RANGE(range) |
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1014 FBC_SYS_CACHE_START_BASE(offset);
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1015
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1016 mutex_lock(&sys_cache->lock);
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1017 /* update sys cache config only if sys cache is unassigned */
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1018 if (sys_cache->id == FBC_SYS_CACHE_ID_NONE)
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1019 fbc_sys_cache_update_config(display, cfg, fbc->id);
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1020 mutex_unlock(&sys_cache->lock);
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1021 }
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1022
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 3/4] drm/{i915, xe}/stolen: move stolen memory handling to display parent interface
2025-12-04 17:24 ` [PATCH 3/4] drm/{i915, xe}/stolen: move stolen memory handling to display parent interface Jani Nikula
2025-12-05 4:44 ` kernel test robot
@ 2025-12-05 5:28 ` kernel test robot
1 sibling, 0 replies; 8+ messages in thread
From: kernel test robot @ 2025-12-05 5:28 UTC (permalink / raw)
To: Jani Nikula, intel-xe, intel-gfx; +Cc: oe-kbuild-all, jani.nikula
Hi Jani,
kernel test robot noticed the following build errors:
[auto build test ERROR on drm-tip/drm-tip]
[cannot apply to drm-i915/for-linux-next drm-i915/for-linux-next-fixes drm-xe/drm-xe-next linus/master v6.18 next-20251204]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Jani-Nikula/drm-i915-fbc-let-to_intel_display-do-its-generic-magic/20251205-012659
base: https://gitlab.freedesktop.org/drm/tip.git drm-tip
patch link: https://lore.kernel.org/r/cc2125f57b98401ea47746ad4784bb4bc6b198c2.1764868989.git.jani.nikula%40intel.com
patch subject: [PATCH 3/4] drm/{i915, xe}/stolen: move stolen memory handling to display parent interface
config: i386-buildonly-randconfig-005-20251205 (https://download.01.org/0day-ci/archive/20251205/202512051314.oZYc0VKc-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251205/202512051314.oZYc0VKc-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512051314.oZYc0VKc-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/gpu/drm/i915/display/intel_fbc.c: In function 'fbc_sys_cache_enable':
>> drivers/gpu/drm/i915/display/intel_fbc.c:1011:18: error: implicit declaration of function 'i915_gem_stolen_node_offset'; did you mean 'intel_parent_stolen_node_offset'? [-Wimplicit-function-declaration]
1011 | offset = i915_gem_stolen_node_offset(fbc->compressed_fb) / (4 * 1024);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| intel_parent_stolen_node_offset
vim +1011 drivers/gpu/drm/i915/display/intel_fbc.c
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 998
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 999 static void fbc_sys_cache_enable(const struct intel_fbc *fbc)
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1000 {
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1001 struct intel_display *display = fbc->display;
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1002 struct sys_cache_cfg *sys_cache = &display->fbc.sys_cache;
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1003 int range, offset;
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1004 u32 cfg;
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1005
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1006 if (!HAS_FBC_SYS_CACHE(display))
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1007 return;
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1008
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1009 range = fbc_sys_cache_limit(display) / (64 * 1024);
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1010
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 @1011 offset = i915_gem_stolen_node_offset(fbc->compressed_fb) / (4 * 1024);
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1012
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1013 cfg = FBC_SYS_CACHE_TAG_USE_RES_SPACE | FBC_SYS_CACHEABLE_RANGE(range) |
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1014 FBC_SYS_CACHE_START_BASE(offset);
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1015
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1016 mutex_lock(&sys_cache->lock);
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1017 /* update sys cache config only if sys cache is unassigned */
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1018 if (sys_cache->id == FBC_SYS_CACHE_ID_NONE)
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1019 fbc_sys_cache_update_config(display, cfg, fbc->id);
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1020 mutex_unlock(&sys_cache->lock);
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1021 }
0b806d62fd5f59 Vinod Govindapillai 2025-11-28 1022
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 8+ messages in thread
* ✗ Fi.CI.BUILD: failure for drm/{i915, xe}: migrate stolen interface to parent interface, cleanups
2025-12-04 17:24 [PATCH 0/4] drm/{i915, xe}: migrate stolen interface to parent interface, cleanups Jani Nikula
` (3 preceding siblings ...)
2025-12-04 17:24 ` [PATCH 4/4] drm/{i915, xe}/stolen: make insert_node, area_address, area_size optional Jani Nikula
@ 2025-12-05 8:31 ` Patchwork
4 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2025-12-05 8:31 UTC (permalink / raw)
To: Jani Nikula; +Cc: intel-gfx
== Series Details ==
Series: drm/{i915, xe}: migrate stolen interface to parent interface, cleanups
URL : https://patchwork.freedesktop.org/series/158509/
State : failure
== Summary ==
Error: make failed
CALL scripts/checksyscalls.sh
DESCEND objtool
INSTALL libsubcmd_headers
CC [M] drivers/gpu/drm/i915/display/intel_fbc.o
drivers/gpu/drm/i915/display/intel_fbc.c: In function ‘fbc_sys_cache_enable’:
drivers/gpu/drm/i915/display/intel_fbc.c:1011:18: error: implicit declaration of function ‘i915_gem_stolen_node_offset’; did you mean ‘intel_parent_stolen_node_offset’? [-Werror=implicit-function-declaration]
1011 | offset = i915_gem_stolen_node_offset(fbc->compressed_fb) / (4 * 1024);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| intel_parent_stolen_node_offset
cc1: all warnings being treated as errors
make[6]: *** [scripts/Makefile.build:287: drivers/gpu/drm/i915/display/intel_fbc.o] Error 1
make[5]: *** [scripts/Makefile.build:556: drivers/gpu/drm/i915] Error 2
make[4]: *** [scripts/Makefile.build:556: drivers/gpu/drm] Error 2
make[3]: *** [scripts/Makefile.build:556: drivers/gpu] Error 2
make[2]: *** [scripts/Makefile.build:556: drivers] Error 2
make[1]: *** [/home/kbuild2/kernel/Makefile:2010: .] Error 2
make: *** [Makefile:248: __sub-make] Error 2
Build failed, no error log produced
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-12-05 8:31 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-04 17:24 [PATCH 0/4] drm/{i915, xe}: migrate stolen interface to parent interface, cleanups Jani Nikula
2025-12-04 17:24 ` [PATCH 1/4] drm/i915/fbc: let to_intel_display() do its generic magic Jani Nikula
2025-12-04 17:24 ` [PATCH 2/4] drm/xe/stolen: unify interface with i915 Jani Nikula
2025-12-04 17:24 ` [PATCH 3/4] drm/{i915, xe}/stolen: move stolen memory handling to display parent interface Jani Nikula
2025-12-05 4:44 ` kernel test robot
2025-12-05 5:28 ` kernel test robot
2025-12-04 17:24 ` [PATCH 4/4] drm/{i915, xe}/stolen: make insert_node, area_address, area_size optional Jani Nikula
2025-12-05 8:31 ` ✗ Fi.CI.BUILD: failure for drm/{i915, xe}: migrate stolen interface to parent interface, cleanups Patchwork
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).