Re: [PATCH 03/16] drm/i915: Move the i915_dpt_offset()==0 assert

Jani Nikula
2026-04-24T09:19:43Z

On Thu, 23 Apr 2026, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Move the i915_dpt_offset() check into the lower level
> intel_fb_pin_to_dpt() function. Clears out some of the unnecessary
> junk from the higher level code, making it easier to introduce
> the new fb_pin parent interface.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

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

> ---
> drivers/gpu/drm/i915/i915_fb_pin.c | 13 ++++++-------
> 1 file changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_fb_pin.c b/drivers/gpu/drm/i915/i915_fb_pin.c
> index b800b55530a5..400ad8768c11 100644
> --- a/drivers/gpu/drm/i915/i915_fb_pin.c
> +++ b/drivers/gpu/drm/i915/i915_fb_pin.c
> @@ -101,6 +101,12 @@ intel_fb_pin_to_dpt(struct drm_gem_object *_obj, struct intel_dpt *dpt,
> i915_gem_object_flush_if_display(obj);
>
> i915_vma_get(vma);
> +
> + /*
> + * 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(&i915->drm, i915_dpt_offset(vma));
> err:
> atomic_dec(&i915->pending_fb_pin);
>
> @@ -255,7 +261,6 @@ int intel_plane_pin_fb(struct intel_plane_state *plane_state,
> const struct intel_plane_state *old_plane_state)
> {
> struct intel_display *display = to_intel_display(plane_state);
> - struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->dev);
> struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
> const struct intel_framebuffer *fb =
> to_intel_framebuffer(plane_state->hw.fb);
> @@ -304,12 +309,6 @@ int intel_plane_pin_fb(struct intel_plane_state *plane_state,
> plane_state->dpt_vma = vma;
>
> WARN_ON(plane_state->ggtt_vma == plane_state->dpt_vma);
> -
> - /*
> - * 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(&i915->drm, i915_dpt_offset(plane_state->dpt_vma));
> }
>
> /*

--
Jani Nikula, Intel