[PATCH 06/12] drm/xe: Use fb cached min alignment

Rodrigo Vivi rodrigo.vivi at intel.com
Fri Feb 28 19:21:56 UTC 2025


On Fri, Feb 21, 2025 at 10:17:25AM +0000, Tvrtko Ursulin wrote:
> Instead of just looking at the first plane use the fb cached overall
> minimum alignment.
> 
> This aligns with how the i915 version of intel_plane_pin_fb works.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at igalia.com>

Cc: Maarten Lankhort <maarten.lankhorst at linux.intel.com>

since this one has potential to impact the fastboot work that Maarten
recently fixed...

> ---
>  drivers/gpu/drm/xe/display/xe_fb_pin.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/display/xe_fb_pin.c b/drivers/gpu/drm/xe/display/xe_fb_pin.c
> index 3df51cd4a86b..496257a60009 100644
> --- a/drivers/gpu/drm/xe/display/xe_fb_pin.c
> +++ b/drivers/gpu/drm/xe/display/xe_fb_pin.c
> @@ -416,12 +416,9 @@ int intel_plane_pin_fb(struct intel_plane_state *new_plane_state,
>  		       const struct intel_plane_state *old_plane_state)
>  {
>  	struct drm_framebuffer *fb = new_plane_state->hw.fb;
> -	struct drm_gem_object *obj = intel_fb_bo(fb);
> -	struct xe_bo *bo = gem_to_xe_bo(obj);
> -	struct i915_vma *vma;
>  	struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb);
> -	struct intel_plane *plane = to_intel_plane(new_plane_state->uapi.plane);
> -	unsigned int alignment = plane->min_alignment(plane, fb, 0);
> +	struct xe_bo *bo = gem_to_xe_bo(intel_fb_bo(fb));
> +	struct i915_vma *vma;
>  
>  	if (reuse_vma(new_plane_state, old_plane_state))
>  		return 0;
> @@ -429,8 +426,8 @@ int intel_plane_pin_fb(struct intel_plane_state *new_plane_state,
>  	/* We reject creating !SCANOUT fb's, so this is weird.. */
>  	drm_WARN_ON(bo->ttm.base.dev, !(bo->flags & XE_BO_FLAG_SCANOUT));
>  
> -	vma = __xe_pin_fb_vma(intel_fb, &new_plane_state->view.gtt, alignment);
> -
> +	vma = __xe_pin_fb_vma(intel_fb, &new_plane_state->view.gtt,
> +			      intel_fb->min_alignment);
>  	if (IS_ERR(vma))
>  		return PTR_ERR(vma);
>  
> -- 
> 2.48.0
> 


More information about the Intel-xe mailing list