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

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Thu Oct 31 11:27:42 UTC 2019


Op 31-10-2019 om 11:30 schreef Ville Syrjälä:
> On Thu, Oct 31, 2019 at 10:15:41AM +0100, Maarten Lankhorst wrote:
>> Op 30-10-2019 om 17:19 schreef Ville Syrjälä:
>>> 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 at linux.intel.com>
>>>> ---
>>>>  .../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 at linux.intel.com>
>> No, we still use src/dst rect and visible from uapi. So correct here. :)
> Doh. I knew that would trip me over eventually.
>
Yeah, it's unfortunate that the drm properties are not in their own struct.



More information about the Intel-gfx mailing list