Move compat i915_vma.h to xe_display_vma.h, and remove all extra
cruft. Drop the i915_ggtt_offset() wrapper in favour of using
xe_ggtt_node_addr() directly.

The usefulness of the I915_TILING_X and I915_TILING_Y undef/define is
unclear, since uapi/drm/i915_drm.h is included in other paths as well.

The naming of struct i915_vma is a bit unfortunate in xe, but (at least
for now) a necessity for maintaining type safety on the opaque type.

Signed-off-by: Jani Nikula <[email protected]>
---
 .../gpu/drm/xe/compat-i915-headers/i915_vma.h | 34 -------------------
 drivers/gpu/drm/xe/display/xe_display_vma.h   | 18 ++++++++++
 drivers/gpu/drm/xe/display/xe_fb_pin.c        |  6 ++--
 drivers/gpu/drm/xe/display/xe_initial_plane.c |  4 +--
 4 files changed, 23 insertions(+), 39 deletions(-)
 delete mode 100644 drivers/gpu/drm/xe/compat-i915-headers/i915_vma.h
 create mode 100644 drivers/gpu/drm/xe/display/xe_display_vma.h

diff --git a/drivers/gpu/drm/xe/compat-i915-headers/i915_vma.h 
b/drivers/gpu/drm/xe/compat-i915-headers/i915_vma.h
deleted file mode 100644
index da1d97b48fee..000000000000
--- a/drivers/gpu/drm/xe/compat-i915-headers/i915_vma.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* SPDX-License-Identifier: MIT */
-/*
- * Copyright © 2023 Intel Corporation
- */
-
-#ifndef I915_VMA_H
-#define I915_VMA_H
-
-#include <uapi/drm/i915_drm.h>
-
-#include "xe_ggtt.h"
-
-#include <linux/refcount.h>
-
-/* We don't want these from i915_drm.h in case of Xe */
-#undef I915_TILING_X
-#undef I915_TILING_Y
-#define I915_TILING_X 0
-#define I915_TILING_Y 0
-
-struct xe_bo;
-
-struct i915_vma {
-       refcount_t ref;
-       struct xe_bo *bo, *dpt;
-       struct xe_ggtt_node *node;
-};
-
-static inline u32 i915_ggtt_offset(const struct i915_vma *vma)
-{
-       return xe_ggtt_node_addr(vma->node);
-}
-
-#endif
diff --git a/drivers/gpu/drm/xe/display/xe_display_vma.h 
b/drivers/gpu/drm/xe/display/xe_display_vma.h
new file mode 100644
index 000000000000..28267be61ae0
--- /dev/null
+++ b/drivers/gpu/drm/xe/display/xe_display_vma.h
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: MIT */
+/* Copyright © 2026 Intel Corporation */
+
+#ifndef _XE_DISPLAY_VMA_H_
+#define _XE_DISPLAY_VMA_H_
+
+#include <linux/refcount.h>
+
+struct xe_bo;
+struct xe_ggtt_node;
+
+struct i915_vma {
+       refcount_t ref;
+       struct xe_bo *bo, *dpt;
+       struct xe_ggtt_node *node;
+};
+
+#endif
diff --git a/drivers/gpu/drm/xe/display/xe_fb_pin.c 
b/drivers/gpu/drm/xe/display/xe_fb_pin.c
index f0c89f144563..dbbc61032b7f 100644
--- a/drivers/gpu/drm/xe/display/xe_fb_pin.c
+++ b/drivers/gpu/drm/xe/display/xe_fb_pin.c
@@ -5,7 +5,6 @@
 
 #include <drm/ttm/ttm_bo.h>
 
-#include "i915_vma.h"
 #include "intel_display_core.h"
 #include "intel_display_types.h"
 #include "intel_fb.h"
@@ -13,6 +12,7 @@
 #include "intel_fbdev.h"
 #include "xe_bo.h"
 #include "xe_device.h"
+#include "xe_display_vma.h"
 #include "xe_ggtt.h"
 #include "xe_pm.h"
 #include "xe_vram_types.h"
@@ -408,7 +408,7 @@ static bool reuse_vma(struct intel_plane_state 
*new_plane_state,
        refcount_inc(&vma->ref);
        new_plane_state->ggtt_vma = vma;
 
-       new_plane_state->surf = i915_ggtt_offset(new_plane_state->ggtt_vma) +
+       new_plane_state->surf = 
xe_ggtt_node_addr(new_plane_state->ggtt_vma->node) +
                plane->surf_offset(new_plane_state);
 
        return true;
@@ -438,7 +438,7 @@ int intel_plane_pin_fb(struct intel_plane_state 
*new_plane_state,
 
        new_plane_state->ggtt_vma = vma;
 
-       new_plane_state->surf = i915_ggtt_offset(new_plane_state->ggtt_vma) +
+       new_plane_state->surf = 
xe_ggtt_node_addr(new_plane_state->ggtt_vma->node) +
                plane->surf_offset(new_plane_state);
 
        return 0;
diff --git a/drivers/gpu/drm/xe/display/xe_initial_plane.c 
b/drivers/gpu/drm/xe/display/xe_initial_plane.c
index c46e9d8115bd..4be0cfb6d0c1 100644
--- a/drivers/gpu/drm/xe/display/xe_initial_plane.c
+++ b/drivers/gpu/drm/xe/display/xe_initial_plane.c
@@ -12,7 +12,6 @@
 #include "xe_ggtt.h"
 #include "xe_mmio.h"
 
-#include "i915_vma.h"
 #include "intel_crtc.h"
 #include "intel_display_regs.h"
 #include "intel_display_types.h"
@@ -20,6 +19,7 @@
 #include "intel_fbdev_fb.h"
 #include "intel_fb_pin.h"
 #include "xe_bo.h"
+#include "xe_display_vma.h"
 #include "xe_vram_types.h"
 #include "xe_wa.h"
 
@@ -165,7 +165,7 @@ xe_initial_plane_setup(struct drm_plane_state *_plane_state,
 
        plane_state->ggtt_vma = vma;
 
-       plane_state->surf = i915_ggtt_offset(plane_state->ggtt_vma);
+       plane_state->surf = xe_ggtt_node_addr(plane_state->ggtt_vma->node);
 
        plane_config->vma = vma;
 
-- 
2.47.3

Reply via email to