[PATCH v2 4/6] drm/i915: Use i915_vma_offset() in intel_dpt_offset()

Jani Nikula jani.nikula at linux.intel.com
Thu Apr 10 08:52:24 UTC 2025


On Wed, 02 Apr 2025, Ville Syrjala <ville.syrjala at linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
>
> Replace the open coded vma mm node stuff in intel_dpt_offset()
> with i915_vma_offset(). This will also include the VT-d guard
> in the result. Granted that should always be 0 for DPT, but
> it seems prudent to include that in our DPT vma offset check
> anyway.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

Reviewed-by: Jani Nikula <jani.nikula at intel.com>


> ---
>  drivers/gpu/drm/i915/display/intel_dpt.c    | 2 +-
>  drivers/gpu/drm/i915/display/intel_fb_pin.c | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dpt.c b/drivers/gpu/drm/i915/display/intel_dpt.c
> index 43bd97e4f589..2bf4ad6a0fdf 100644
> --- a/drivers/gpu/drm/i915/display/intel_dpt.c
> +++ b/drivers/gpu/drm/i915/display/intel_dpt.c
> @@ -321,5 +321,5 @@ void intel_dpt_destroy(struct i915_address_space *vm)
>  
>  u64 intel_dpt_offset(struct i915_vma *dpt_vma)
>  {
> -	return dpt_vma->node.start;
> +	return i915_vma_offset(dpt_vma);
>  }
> diff --git a/drivers/gpu/drm/i915/display/intel_fb_pin.c b/drivers/gpu/drm/i915/display/intel_fb_pin.c
> index a5b9d87b2255..d40e3d96b14a 100644
> --- a/drivers/gpu/drm/i915/display/intel_fb_pin.c
> +++ b/drivers/gpu/drm/i915/display/intel_fb_pin.c
> @@ -300,8 +300,8 @@ int intel_plane_pin_fb(struct intel_plane_state *plane_state,
>  		WARN_ON(plane_state->ggtt_vma == plane_state->dpt_vma);
>  
>  		/*
> -		 * The DPT object contains only one vma, so
> -		 * the VMA's offset within the DPT is always 0.
> +		 * The DPT object contains only one vma, and there is no VT-d
> +		 * guard, so the VMA's offset within the DPT is always 0.
>  		 */
>  		drm_WARN_ON(display->drm, intel_dpt_offset(plane_state->dpt_vma));
>  	}

-- 
Jani Nikula, Intel


More information about the Intel-xe mailing list