From: Matthew Brost <matthew.brost@intel.com>
To: Maarten Lankhorst <dev@lankhorst.se>
Cc: <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH v7 04/12] drm/xe/display: Avoid dereferencing xe_ggtt_node
Date: Wed, 15 Oct 2025 14:53:09 -0700 [thread overview]
Message-ID: <aPAXxYOKf7d32SvG@lstrano-desk.jf.intel.com> (raw)
In-Reply-To: <20251015074708.1654014-18-dev@lankhorst.se>
On Wed, Oct 15, 2025 at 09:47:13AM +0200, Maarten Lankhorst wrote:
> 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.
>
> Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
> ---
> 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 4465c40f81341..1c599963169a0 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>
>
> @@ -32,7 +32,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 d2e4903de0977..784d2db5fd0db 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,
> @@ -351,7 +351,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 9f04ba36e930b..ef5ef5aa8d847 100644
> --- a/drivers/gpu/drm/xe/display/xe_stolen.c
> +++ b/drivers/gpu/drm/xe/display/xe_stolen.c
> @@ -100,7 +100,7 @@ u64 i915_gem_stolen_node_address(struct intel_stolen_node *node)
>
> u64 i915_gem_stolen_node_size(const struct intel_stolen_node *node)
> {
> - return node->bo->ttm.base.size;
> + return xe_bo_size(node->bo);
> }
>
> struct intel_stolen_node *i915_gem_stolen_node_alloc(struct drm_device *drm)
> --
> 2.51.0
>
next prev parent reply other threads:[~2025-10-15 21:53 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-15 7:47 [PATCH v7 00/12] drm/xe: Make all xe_ggtt structs private Maarten Lankhorst
2025-10-15 7:47 ` [PATCH v7 01/12] drm/xe: Start using ggtt->start in preparation of balloon removal Maarten Lankhorst
2025-10-15 7:47 ` [PATCH v7 02/12] drm/xe: Convert xe_fb_pin to use a callback for insertion into GGTT Maarten Lankhorst
2025-10-15 7:47 ` [PATCH v7 03/12] drm/xe: Add xe_ggtt_node_addr() to avoid dereferencing xe_ggtt_node Maarten Lankhorst
2025-10-15 21:49 ` Matthew Brost
2025-10-16 6:13 ` Maarten Lankhorst
2025-10-17 20:53 ` Matthew Brost
2025-10-15 7:47 ` [PATCH v7 04/12] drm/xe/display: Avoid " Maarten Lankhorst
2025-10-15 21:53 ` Matthew Brost [this message]
2025-10-15 7:47 ` [PATCH v7 05/12] drm/xe: Do not dereference ggtt_node in xe_bo.c Maarten Lankhorst
2025-10-15 21:58 ` Matthew Brost
2025-10-16 6:33 ` Maarten Lankhorst
2025-10-17 20:54 ` Matthew Brost
2025-10-15 7:47 ` [PATCH v7 06/12] drm/xe: Improve xe_gt_sriov_pf_config GGTT handling Maarten Lankhorst
2025-10-15 22:04 ` Matthew Brost
2025-10-16 8:50 ` Michal Wajdeczko
2025-10-16 13:46 ` Maarten Lankhorst
2025-10-16 13:58 ` Michal Wajdeczko
2025-10-15 7:47 ` [PATCH v7 07/12] drm/xe: Privatize xe_ggtt_node Maarten Lankhorst
2025-10-15 22:05 ` Matthew Brost
2025-10-15 7:47 ` [PATCH v7 08/12] drm/xe: Make xe_ggtt_node offset relative to starting offset Maarten Lankhorst
2025-10-15 22:38 ` Matthew Brost
2025-10-16 6:40 ` Maarten Lankhorst
2025-10-15 7:47 ` [PATCH v7 09/12] drm/xe: Rewrite GGTT VF initialisation Maarten Lankhorst
2025-10-16 0:30 ` Matthew Brost
2025-10-15 7:47 ` [PATCH v7 10/12] drm/xe: Move struct xe_ggtt to xe_ggtt.c Maarten Lankhorst
2025-10-15 7:47 ` [PATCH v7 11/12] drm/xe: Make xe_ggtt_node_insert return a node Maarten Lankhorst
2025-10-15 22:44 ` Matthew Brost
2025-10-15 7:47 ` [PATCH v7 12/12] drm/xe: Remove xe_ggtt_node_allocated Maarten Lankhorst
2025-10-15 22:41 ` Matthew Brost
2025-10-15 9:47 ` ✗ CI.checkpatch: warning for drm/xe: Make all xe_ggtt structs private. (rev2) Patchwork
2025-10-15 9:49 ` ✓ CI.KUnit: success " Patchwork
2025-10-15 11:03 ` ✓ Xe.CI.BAT: " Patchwork
2025-10-15 19:55 ` ✗ Xe.CI.Full: failure " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aPAXxYOKf7d32SvG@lstrano-desk.jf.intel.com \
--to=matthew.brost@intel.com \
--cc=dev@lankhorst.se \
--cc=intel-xe@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox