[PATCH 07/11] drm/i915: Introduce pin_params.needs_physical

Ville Syrjala
2026-04-16T17:45:31Z

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Add a new flag pin_params.needs_physical to inform the pinning
code that the display needs a physical address and not GGTT
address.

This isn't strictly necessary as the current phys_alignment!=0
check is enough in practice. But theoretically one could have
needs_physical==true without any alignment requirements. And
having an explicit flag feels a bit less magical.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/display/intel_fb_pin.h | 1 +
drivers/gpu/drm/i915/i915_fb_pin.c | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_fb_pin.h b/drivers/gpu/drm/i915/display/intel_fb_pin.h
index cf54a96569de..3e37e9874f50 100644
--- a/drivers/gpu/drm/i915/display/intel_fb_pin.h
+++ b/drivers/gpu/drm/i915/display/intel_fb_pin.h
@@ -21,6 +21,7 @@ struct intel_fb_pin_params {
unsigned int vtd_guard;
bool needs_cpu_lmem_access;
bool needs_low_address;
+ bool needs_physical;
};

struct i915_vma *
diff --git a/drivers/gpu/drm/i915/i915_fb_pin.c b/drivers/gpu/drm/i915/i915_fb_pin.c
index 97e4cdfd2447..bfe9a5342e13 100644
--- a/drivers/gpu/drm/i915/i915_fb_pin.c
+++ b/drivers/gpu/drm/i915/i915_fb_pin.c
@@ -148,7 +148,7 @@ intel_fb_pin_to_ggtt(const struct drm_framebuffer *fb,
i915_gem_ww_ctx_init(&ww, true);
retry:
ret = i915_gem_object_lock(obj, &ww);
- if (!ret && pin_params->phys_alignment)
+ if (!ret && pin_params->needs_physical)
ret = i915_gem_object_attach_phys(obj, pin_params->phys_alignment);
else if (!ret && HAS_LMEM(i915))
ret = i915_gem_object_migrate(obj, &ww, INTEL_REGION_LMEM_0);
@@ -271,6 +271,7 @@ int intel_plane_pin_fb(struct intel_plane_state *plane_state,
.vtd_guard = intel_plane_fb_vtd_guard(plane_state),
.needs_cpu_lmem_access = intel_fb_needs_cpu_access(&fb->base),
.needs_low_address = intel_plane_needs_low_address(display),
+ .needs_physical = intel_plane_needs_physical(plane),
};
int fence_id = -1;

--
2.52.0