Patchwork intel/atomic: Stop updating legacy fb parameters

login
register
mail settings
Submitter Daniel Vetter
Date Dec. 5, 2017, 5 p.m.
Message ID <20171205170020.4560-1-daniel.vetter@ffwll.ch>
Download mbox | patch
Permalink /patch/10093371/
State New
Headers show

Comments

Daniel Vetter - Dec. 5, 2017, 5 p.m.
Even fbc isn't using this stuff anymore, so time to remove it.

Cleaning up one small piece of the atomic conversion cruft at the time
...

Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 29 -----------------------------
 1 file changed, 29 deletions(-)
Ville Syrjälä - Dec. 5, 2017, 5:40 p.m.
On Tue, Dec 05, 2017 at 06:00:20PM +0100, Daniel Vetter wrote:
> Even fbc isn't using this stuff anymore, so time to remove it.
> 
> Cleaning up one small piece of the atomic conversion cruft at the time
> ...
> 
> Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 29 -----------------------------
>  1 file changed, 29 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 1f7e312d0d0d..c883e14a06d3 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -10967,31 +10967,6 @@ intel_modeset_pipe_config(struct drm_crtc *crtc,
>  	return ret;
>  }
>  
> -static void
> -intel_modeset_update_crtc_state(struct drm_atomic_state *state)
> -{
> -	struct drm_crtc *crtc;
> -	struct drm_crtc_state *new_crtc_state;
> -	int i;
> -
> -	/* Double check state. */
> -	for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
> -		to_intel_crtc(crtc)->config = to_intel_crtc_state(new_crtc_state);
> -
> -		/*
> -		 * Update legacy state to satisfy fbc code. This can
> -		 * be removed when fbc uses the atomic state.
> -		 */
> -		if (drm_atomic_get_existing_plane_state(state, crtc->primary)) {
> -			struct drm_plane_state *plane_state = crtc->primary->state;
> -
> -			crtc->primary->fb = plane_state->fb;
> -			crtc->x = plane_state->src_x >> 16;
> -			crtc->y = plane_state->src_y >> 16;

crtc->x/y seem pretty safe to nuke here.

Not quite sure about plane->fb. The core still messes around with that
quite a bit. The lack of refcounting here seems strange too. I've been
actually wondering if that mess is somehow related to the fb leak we
have in CI on some machines.

> -		}
> -	}
> -}
> -
>  static bool intel_fuzzy_clock_check(int clock1, int clock2)
>  {
>  	int diff;
> @@ -12364,10 +12339,6 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)
>  		}
>  	}
>  
> -	/* Only after disabling all output pipelines that will be changed can we
> -	 * update the the output configuration. */
> -	intel_modeset_update_crtc_state(state);
> -
>  	if (intel_state->modeset) {
>  		drm_atomic_helper_update_legacy_modeset_state(state->dev, state);
>  
> -- 
> 2.15.0
Maarten Lankhorst - Dec. 6, 2017, 10:31 a.m.
Op 05-12-17 om 18:40 schreef Ville Syrjälä:
> On Tue, Dec 05, 2017 at 06:00:20PM +0100, Daniel Vetter wrote:
>> Even fbc isn't using this stuff anymore, so time to remove it.
>>
>> Cleaning up one small piece of the atomic conversion cruft at the time
>> ...
>>
>> Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
>> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
>> ---
>>  drivers/gpu/drm/i915/intel_display.c | 29 -----------------------------
>>  1 file changed, 29 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
>> index 1f7e312d0d0d..c883e14a06d3 100644
>> --- a/drivers/gpu/drm/i915/intel_display.c
>> +++ b/drivers/gpu/drm/i915/intel_display.c
>> @@ -10967,31 +10967,6 @@ intel_modeset_pipe_config(struct drm_crtc *crtc,
>>  	return ret;
>>  }
>>  
>> -static void
>> -intel_modeset_update_crtc_state(struct drm_atomic_state *state)
>> -{
>> -	struct drm_crtc *crtc;
>> -	struct drm_crtc_state *new_crtc_state;
>> -	int i;
>> -
>> -	/* Double check state. */
>> -	for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
>> -		to_intel_crtc(crtc)->config = to_intel_crtc_state(new_crtc_state);
>> -
>> -		/*
>> -		 * Update legacy state to satisfy fbc code. This can
>> -		 * be removed when fbc uses the atomic state.
>> -		 */
>> -		if (drm_atomic_get_existing_plane_state(state, crtc->primary)) {
>> -			struct drm_plane_state *plane_state = crtc->primary->state;
>> -
>> -			crtc->primary->fb = plane_state->fb;
>> -			crtc->x = plane_state->src_x >> 16;
>> -			crtc->y = plane_state->src_y >> 16;
> crtc->x/y seem pretty safe to nuke here.
>
> Not quite sure about plane->fb. The core still messes around with that
> quite a bit. The lack of refcounting here seems strange too. I've been
> actually wondering if that mess is somehow related to the fb leak we
> have in CI on some machines.
>
>> -		}
>> -	}
>> -}
>> -
>>  static bool intel_fuzzy_clock_check(int clock1, int clock2)
>>  {
>>  	int diff;
>> @@ -12364,10 +12339,6 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)
>>  		}
>>  	}
>>  
>> -	/* Only after disabling all output pipelines that will be changed can we
>> -	 * update the the output configuration. */
>> -	intel_modeset_update_crtc_state(state);
>> -
>>  	if (intel_state->modeset) {
>>  		drm_atomic_helper_update_legacy_modeset_state(state->dev, state);
>>  
>> -- 
>> 2.15.0

I don't think we should stop updating crtc->config, please move that loop to where intel_modeset_update_crtc_state() and you can have my r-b.
I already had a patch in my tree to do the same, but lost it.

plane->fb is safe to nuke, the atomic core updates it but we needed it earlier for FBC and back-then-not-quite atomic plane_update calls..

~Maarten

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 1f7e312d0d0d..c883e14a06d3 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -10967,31 +10967,6 @@  intel_modeset_pipe_config(struct drm_crtc *crtc,
 	return ret;
 }
 
-static void
-intel_modeset_update_crtc_state(struct drm_atomic_state *state)
-{
-	struct drm_crtc *crtc;
-	struct drm_crtc_state *new_crtc_state;
-	int i;
-
-	/* Double check state. */
-	for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
-		to_intel_crtc(crtc)->config = to_intel_crtc_state(new_crtc_state);
-
-		/*
-		 * Update legacy state to satisfy fbc code. This can
-		 * be removed when fbc uses the atomic state.
-		 */
-		if (drm_atomic_get_existing_plane_state(state, crtc->primary)) {
-			struct drm_plane_state *plane_state = crtc->primary->state;
-
-			crtc->primary->fb = plane_state->fb;
-			crtc->x = plane_state->src_x >> 16;
-			crtc->y = plane_state->src_y >> 16;
-		}
-	}
-}
-
 static bool intel_fuzzy_clock_check(int clock1, int clock2)
 {
 	int diff;
@@ -12364,10 +12339,6 @@  static void intel_atomic_commit_tail(struct drm_atomic_state *state)
 		}
 	}
 
-	/* Only after disabling all output pipelines that will be changed can we
-	 * update the the output configuration. */
-	intel_modeset_update_crtc_state(state);
-
 	if (intel_state->modeset) {
 		drm_atomic_helper_update_legacy_modeset_state(state->dev, state);