Commit 44ebdab4 authored by Ville Syrjälä's avatar Ville Syrjälä
Browse files

drm/i915: Move the intel_dpt_offset() check into intel_plane_pin_fb()



Now that we handle all the other vma offset stuff in
intel_plane_pin_fb() it seems more proper to do the
dpt_vma offset check there as well.

Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250717171353.23090-4-ville.syrjala@linux.intel.com
parent bc0c7fd7
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -261,6 +261,7 @@ intel_plane_fb_vtd_guard(const struct intel_plane_state *plane_state)
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 intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
	const struct intel_framebuffer *fb =
		to_intel_framebuffer(plane_state->hw.fb);
@@ -299,6 +300,12 @@ 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, so
		 * the VMA's offset within the DPT is always 0.
		 */
		drm_WARN_ON(display->drm, intel_dpt_offset(plane_state->dpt_vma));
	}

	/*
+0 −6
Original line number Diff line number Diff line
@@ -1271,12 +1271,6 @@ static u32 skl_surf_address(const struct intel_plane_state *plane_state,
	u32 offset = plane_state->view.color_plane[color_plane].offset;

	if (intel_fb_uses_dpt(fb)) {
		/*
		 * The DPT object contains only one vma, so the VMA's offset
		 * within the DPT is always 0.
		 */
		drm_WARN_ON(display->drm, plane_state->dpt_vma &&
			    intel_dpt_offset(plane_state->dpt_vma));
		drm_WARN_ON(display->drm, offset & 0x1fffff);
		return offset >> 9;
	} else {