Re: [CI 08/12] drm/i915: Perform manual conversions for plane uapi/hw split, v2.

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

 



On Wed, Oct 30, 2019 at 03:26:53PM +0100, Maarten Lankhorst wrote:
> get_crtc_from_states() is called before plane_state is copied to uapi,
> so use the uapi state there.
> 
> intel_legacy_cursor_update() could probably get away with looking at
> the hw state, but for clarity always look at the uapi state.
> 
> Changes since v1:
> - Convert entirety of intel_legacy_cursor_update (Ville).
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx>
> ---
>  .../gpu/drm/i915/display/intel_atomic_plane.c |  8 ++--
>  drivers/gpu/drm/i915/display/intel_display.c  | 45 ++++++++++---------
>  2 files changed, 27 insertions(+), 26 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> index 393fb97a3dca..416cfa439f33 100644
> --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> @@ -225,11 +225,11 @@ static struct intel_crtc *
>  get_crtc_from_states(const struct intel_plane_state *old_plane_state,
>  		     const struct intel_plane_state *new_plane_state)
>  {
> -	if (new_plane_state->base.crtc)
> -		return to_intel_crtc(new_plane_state->base.crtc);
> +	if (new_plane_state->uapi.crtc)
> +		return to_intel_crtc(new_plane_state->uapi.crtc);
>  
> -	if (old_plane_state->base.crtc)
> -		return to_intel_crtc(old_plane_state->base.crtc);
> +	if (old_plane_state->uapi.crtc)
> +		return to_intel_crtc(old_plane_state->uapi.crtc);
>  
>  	return NULL;
>  }
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index e30f467eec67..b0b2c46e4c0a 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -15357,12 +15357,12 @@ intel_legacy_cursor_update(struct drm_plane *_plane,
>  	 * take the slowpath. Only changing fb or position should be
>  	 * in the fastpath.
>  	 */
> -	if (old_plane_state->base.crtc != &crtc->base ||
> -	    old_plane_state->base.src_w != src_w ||
> -	    old_plane_state->base.src_h != src_h ||
> -	    old_plane_state->base.crtc_w != crtc_w ||
> -	    old_plane_state->base.crtc_h != crtc_h ||
> -	    !old_plane_state->base.fb != !fb)
> +	if (old_plane_state->uapi.crtc != &crtc->base ||
> +	    old_plane_state->uapi.src_w != src_w ||
> +	    old_plane_state->uapi.src_h != src_h ||
> +	    old_plane_state->uapi.crtc_w != crtc_w ||
> +	    old_plane_state->uapi.crtc_h != crtc_h ||
> +	    !old_plane_state->uapi.fb != !fb)
>  		goto slow;
>  
>  	new_plane_state = to_intel_plane_state(intel_plane_duplicate_state(&plane->base));
> @@ -15375,16 +15375,16 @@ intel_legacy_cursor_update(struct drm_plane *_plane,
>  		goto out_free;
>  	}
>  
> -	drm_atomic_set_fb_for_plane(&new_plane_state->base, fb);
> +	drm_atomic_set_fb_for_plane(&new_plane_state->uapi, fb);
>  
> -	new_plane_state->base.src_x = src_x;
> -	new_plane_state->base.src_y = src_y;
> -	new_plane_state->base.src_w = src_w;
> -	new_plane_state->base.src_h = src_h;
> -	new_plane_state->base.crtc_x = crtc_x;
> -	new_plane_state->base.crtc_y = crtc_y;
> -	new_plane_state->base.crtc_w = crtc_w;
> -	new_plane_state->base.crtc_h = crtc_h;
> +	new_plane_state->uapi.src_x = src_x;
> +	new_plane_state->uapi.src_y = src_y;
> +	new_plane_state->uapi.src_w = src_w;
> +	new_plane_state->uapi.src_h = src_h;
> +	new_plane_state->uapi.crtc_x = crtc_x;
> +	new_plane_state->uapi.crtc_y = crtc_y;
> +	new_plane_state->uapi.crtc_w = crtc_w;
> +	new_plane_state->uapi.crtc_h = crtc_h;
>  
>  	ret = intel_plane_atomic_check_with_state(crtc_state, new_crtc_state,
>  						  old_plane_state, new_plane_state);
> @@ -15395,13 +15395,14 @@ intel_legacy_cursor_update(struct drm_plane *_plane,
>  	if (ret)
>  		goto out_free;
>  
> -	intel_frontbuffer_flush(to_intel_frontbuffer(new_plane_state->base.fb), ORIGIN_FLIP);
> -	intel_frontbuffer_track(to_intel_frontbuffer(old_plane_state->base.fb),
> -				to_intel_frontbuffer(new_plane_state->base.fb),
> +	intel_frontbuffer_flush(to_intel_frontbuffer(new_plane_state->hw.fb),
> +				ORIGIN_FLIP);
> +	intel_frontbuffer_track(to_intel_frontbuffer(old_plane_state->hw.fb),
> +				to_intel_frontbuffer(new_plane_state->hw.fb),
>  				plane->frontbuffer_bit);
>  
>  	/* Swap plane state */
> -	plane->base.state = &new_plane_state->base;
> +	plane->base.state = &new_plane_state->uapi;
>  
>  	/*
>  	 * We cannot swap crtc_state as it may be in use by an atomic commit or
> @@ -15415,7 +15416,7 @@ intel_legacy_cursor_update(struct drm_plane *_plane,
>  	 */
>  	crtc_state->active_planes = new_crtc_state->active_planes;
>  
> -	if (new_plane_state->base.visible)
> +	if (new_plane_state->uapi.visible)

Should be hw here?

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

>  		intel_update_plane(plane, crtc_state, new_plane_state);
>  	else
>  		intel_disable_plane(plane, crtc_state);
> @@ -15426,9 +15427,9 @@ intel_legacy_cursor_update(struct drm_plane *_plane,
>  	if (new_crtc_state)
>  		intel_crtc_destroy_state(&crtc->base, &new_crtc_state->uapi);
>  	if (ret)
> -		intel_plane_destroy_state(&plane->base, &new_plane_state->base);
> +		intel_plane_destroy_state(&plane->base, &new_plane_state->uapi);
>  	else
> -		intel_plane_destroy_state(&plane->base, &old_plane_state->base);
> +		intel_plane_destroy_state(&plane->base, &old_plane_state->uapi);
>  	return ret;
>  
>  slow:
> -- 
> 2.23.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
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