Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915: Use i915_vma_offset() in intel_dpt_offset()

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.

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250717171353.23090-5-ville.syrjala@linux.intel.com

+3 -3
+1 -1
drivers/gpu/drm/i915/display/intel_dpt.c
··· 322 322 323 323 u64 intel_dpt_offset(struct i915_vma *dpt_vma) 324 324 { 325 - return dpt_vma->node.start; 325 + return i915_vma_offset(dpt_vma); 326 326 }
+2 -2
drivers/gpu/drm/i915/display/intel_fb_pin.c
··· 302 302 WARN_ON(plane_state->ggtt_vma == plane_state->dpt_vma); 303 303 304 304 /* 305 - * The DPT object contains only one vma, so 306 - * the VMA's offset within the DPT is always 0. 305 + * The DPT object contains only one vma, and there is no VT-d 306 + * guard, so the VMA's offset within the DPT is always 0. 307 307 */ 308 308 drm_WARN_ON(display->drm, intel_dpt_offset(plane_state->dpt_vma)); 309 309 }