summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorMaarten Lankhorst <dev@lankhorst.se>2026-01-08 11:10:19 +0100
committerMaarten Lankhorst <dev@lankhorst.se>2026-01-12 16:28:34 +0100
commita7ae0836917ca617434c416f9c61dc6024d04949 (patch)
treee2c2fe92b576931b44495c0735392838042d6bd5 /drivers/gpu
parentc818b2651573b2ab3e5dc71dcbfe89b5e0fe9c13 (diff)
drm/xe/display: Avoid dereferencing xe_ggtt_node
Start using xe_ggtt_node_addr, and avoid comparing the base offset as vma->node is dynamically allocated. Also sneak in a xe_bo_size() for stolen, too small to put as separate commit. Reviewed-by: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Maarten Lankhorst <dev@lankhorst.se> Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patch.msgid.link/20260108101014.579906-13-dev@lankhorst.se
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/xe/compat-i915-headers/i915_vma.h4
-rw-r--r--drivers/gpu/drm/xe/display/xe_fb_pin.c4
-rw-r--r--drivers/gpu/drm/xe/display/xe_stolen.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/drm/xe/compat-i915-headers/i915_vma.h b/drivers/gpu/drm/xe/compat-i915-headers/i915_vma.h
index b17e3bab23d5..c4b5adaaa99a 100644
--- a/drivers/gpu/drm/xe/compat-i915-headers/i915_vma.h
+++ b/drivers/gpu/drm/xe/compat-i915-headers/i915_vma.h
@@ -8,7 +8,7 @@
#include <uapi/drm/i915_drm.h>
-#include "xe_ggtt_types.h"
+#include "xe_ggtt.h"
#include <linux/refcount.h>
@@ -30,7 +30,7 @@ struct i915_vma {
static inline u32 i915_ggtt_offset(const struct i915_vma *vma)
{
- return vma->node->base.start;
+ return xe_ggtt_node_addr(vma->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 c7c9c2e9c233..77b05b556ba6 100644
--- a/drivers/gpu/drm/xe/display/xe_fb_pin.c
+++ b/drivers/gpu/drm/xe/display/xe_fb_pin.c
@@ -206,7 +206,7 @@ static void write_ggtt_rotated_node(struct xe_ggtt *ggtt, struct xe_ggtt_node *n
struct fb_rotate_args *args = data;
struct xe_bo *bo = args->bo;
const struct intel_rotation_info *rot_info = &args->view->rotated;
- u32 ggtt_ofs = node->base.start;
+ u32 ggtt_ofs = xe_ggtt_node_addr(node);
for (u32 i = 0; i < ARRAY_SIZE(rot_info->plane); i++)
write_ggtt_rotated(ggtt, &ggtt_ofs, pte_flags, write_pte,
@@ -353,7 +353,7 @@ static void __xe_unpin_fb_vma(struct i915_vma *vma)
if (vma->dpt)
xe_bo_unpin_map_no_vm(vma->dpt);
else if (!xe_ggtt_node_allocated(vma->bo->ggtt_node[tile_id]) ||
- vma->bo->ggtt_node[tile_id]->base.start != vma->node->base.start)
+ vma->bo->ggtt_node[tile_id] != vma->node)
xe_ggtt_node_remove(vma->node, false);
ttm_bo_reserve(&vma->bo->ttm, false, false, NULL);
diff --git a/drivers/gpu/drm/xe/display/xe_stolen.c b/drivers/gpu/drm/xe/display/xe_stolen.c
index 12771709183a..8dc2f86ec602 100644
--- a/drivers/gpu/drm/xe/display/xe_stolen.c
+++ b/drivers/gpu/drm/xe/display/xe_stolen.c
@@ -78,7 +78,7 @@ static u64 xe_stolen_node_address(const struct intel_stolen_node *node)
static u64 xe_stolen_node_size(const struct intel_stolen_node *node)
{
- return node->bo->ttm.base.size;
+ return xe_bo_size(node->bo);
}
static struct intel_stolen_node *xe_stolen_node_alloc(struct drm_device *drm)