From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EB86DD1D493 for ; Thu, 8 Jan 2026 20:25:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A2C3310E7CB; Thu, 8 Jan 2026 20:25:39 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=lankhorst.se header.i=@lankhorst.se header.b="WsSpIU78"; dkim-atps=neutral Received: from lankhorst.se (lankhorst.se [141.105.120.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id E2E5B10E7CA for ; Thu, 8 Jan 2026 20:25:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lankhorst.se; s=default; t=1767903937; bh=FLpLmAicEeA/j546lvLHwDyorACZC9qdNDFFQaucEGE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=WsSpIU78sjzq7juJPEf0bymjMPLdJ1WTKRKRWZ1QyT5rhahMbOVPXp2iqC/vF+quV OPkxsv5NWn4WlKVgPpaf5BX1Kh6npngVV3T7Xou2ckNWlH99w7TRI1yH81JeVd3rzk cptp812t4R3hlWt0yhDPemtEwadc4nINU3/kesfaDSB1Pe3D/MIWCUI4zfZV559/Er +oMnOsL8SehqUhjX2Kv5L0JM2PWRMYjhriuL9wzi/yzbMIi5rj+xyUKYfl+Yn6zztK sT9tMvwKMvj5kVMWjRKwIZRg7uUHwCHvwom+c10TQn5WX66fBiLWnBHQ1wHu9MQZL4 7XPr4TANInI1w== From: Maarten Lankhorst To: intel-xe@lists.freedesktop.org Subject: [FOR-CI-DO-NOT-REVIEW 04/12] drm/xe/display: Avoid dereferencing xe_ggtt_node Date: Thu, 8 Jan 2026 21:25:22 +0100 Message-ID: <20260108202531.671690-5-dev@lankhorst.se> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260108202531.671690-1-dev@lankhorst.se> References: <20260108202531.671690-1-dev@lankhorst.se> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" 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 Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/xe/compat-i915-headers/i915_vma.h | 4 ++-- drivers/gpu/drm/xe/display/xe_fb_pin.c | 4 ++-- drivers/gpu/drm/xe/display/xe_stolen.c | 2 +- 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 b17e3bab23d58..c4b5adaaa99a3 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 -#include "xe_ggtt_types.h" +#include "xe_ggtt.h" #include @@ -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 a1cd42001f442..d2c4e94180fa3 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 12771709183ad..8dc2f86ec6023 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) -- 2.51.0