Re: [PATCH v2 17/25] drm/i915: Store the normal view FB pitch in FB's intel_fb_view

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 25, 2021 at 11:48:00PM +0200, Imre Deak wrote:
> Instead of special casing getting the pitch for the normal view, store
> it during FB creation to the FB normal view struct and retrive it from
> there during atomic check, as it's done for the rotated view. A
> follow-up patch does the same for a new FB remapped view.
> 
> Cc: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
> Signed-off-by: Imre Deak <imre.deak@xxxxxxxxx>

Reviewed-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>

> ---
>  drivers/gpu/drm/i915/display/intel_fb.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c
> index b223e16eb6a22..31fd8480f707e 100644
> --- a/drivers/gpu/drm/i915/display/intel_fb.c
> +++ b/drivers/gpu/drm/i915/display/intel_fb.c
> @@ -484,12 +484,14 @@ static bool intel_plane_can_remap(const struct intel_plane_state *plane_state)
>  	return true;
>  }
>  
> -int intel_fb_pitch(const struct drm_framebuffer *fb, int color_plane, unsigned int rotation)
> +int intel_fb_pitch(const struct drm_framebuffer *drm_fb, int color_plane, unsigned int rotation)
>  {
> +	struct intel_framebuffer *fb = to_intel_framebuffer(drm_fb);
> +
>  	if (drm_rotation_90_or_270(rotation))
> -		return to_intel_framebuffer(fb)->rotated_view.color_plane[color_plane].pitch;
> +		return fb->rotated_view.color_plane[color_plane].pitch;
>  	else
> -		return fb->pitches[color_plane];
> +		return fb->normal_view.color_plane[color_plane].pitch;
>  }
>  
>  static bool intel_plane_needs_remap(const struct intel_plane_state *plane_state)
> @@ -744,6 +746,7 @@ int intel_fill_fb_info(struct drm_i915_private *i915, struct drm_framebuffer *fb
>  		 */
>  		intel_fb->normal_view.color_plane[i].x = x;
>  		intel_fb->normal_view.color_plane[i].y = y;
> +		intel_fb->normal_view.color_plane[i].pitch = intel_fb->base.pitches[i];
>  
>  		offset = calc_plane_aligned_offset(intel_fb, i, &x, &y);
>  
> -- 
> 2.25.1

-- 
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux