Skip to content

Commit a7ae083

Browse files
author
Maarten Lankhorst
committed
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
1 parent c818b26 commit a7ae083

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

drivers/gpu/drm/xe/compat-i915-headers/i915_vma.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include <uapi/drm/i915_drm.h>
1010

11-
#include "xe_ggtt_types.h"
11+
#include "xe_ggtt.h"
1212

1313
#include <linux/refcount.h>
1414

@@ -30,7 +30,7 @@ struct i915_vma {
3030

3131
static inline u32 i915_ggtt_offset(const struct i915_vma *vma)
3232
{
33-
return vma->node->base.start;
33+
return xe_ggtt_node_addr(vma->node);
3434
}
3535

3636
#endif

drivers/gpu/drm/xe/display/xe_fb_pin.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ static void write_ggtt_rotated_node(struct xe_ggtt *ggtt, struct xe_ggtt_node *n
206206
struct fb_rotate_args *args = data;
207207
struct xe_bo *bo = args->bo;
208208
const struct intel_rotation_info *rot_info = &args->view->rotated;
209-
u32 ggtt_ofs = node->base.start;
209+
u32 ggtt_ofs = xe_ggtt_node_addr(node);
210210

211211
for (u32 i = 0; i < ARRAY_SIZE(rot_info->plane); i++)
212212
write_ggtt_rotated(ggtt, &ggtt_ofs, pte_flags, write_pte,
@@ -353,7 +353,7 @@ static void __xe_unpin_fb_vma(struct i915_vma *vma)
353353
if (vma->dpt)
354354
xe_bo_unpin_map_no_vm(vma->dpt);
355355
else if (!xe_ggtt_node_allocated(vma->bo->ggtt_node[tile_id]) ||
356-
vma->bo->ggtt_node[tile_id]->base.start != vma->node->base.start)
356+
vma->bo->ggtt_node[tile_id] != vma->node)
357357
xe_ggtt_node_remove(vma->node, false);
358358

359359
ttm_bo_reserve(&vma->bo->ttm, false, false, NULL);

drivers/gpu/drm/xe/display/xe_stolen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static u64 xe_stolen_node_address(const struct intel_stolen_node *node)
7878

7979
static u64 xe_stolen_node_size(const struct intel_stolen_node *node)
8080
{
81-
return node->bo->ttm.base.size;
81+
return xe_bo_size(node->bo);
8282
}
8383

8484
static struct intel_stolen_node *xe_stolen_node_alloc(struct drm_device *drm)

0 commit comments

Comments
 (0)