]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/i915: Move the i915_dpt_offset()==0 assert
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 8 May 2026 14:34:13 +0000 (17:34 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 11 May 2026 14:43:24 +0000 (17:43 +0300)
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.

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20260508143426.26504-4-ville.syrjala@linux.intel.com
drivers/gpu/drm/i915/i915_fb_pin.c

index b800b55530a5ec7293fd7da7471d9f957339fa18..400ad8768c1151e5a63b249aac5822e79144ca13 100644 (file)
@@ -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));
        }
 
        /*