All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915: Fix fastboot scalers for skylake.
@ 2015-09-14  9:30 Maarten Lankhorst
  2015-09-14  9:30 ` [PATCH 2/2] drm/i915: Only check pipe state for fast modeset when it's possible Maarten Lankhorst
  2015-09-16 18:45 ` [PATCH 1/2] drm/i915: Fix fastboot scalers for skylake Jesse Barnes
  0 siblings, 2 replies; 9+ messages in thread
From: Maarten Lankhorst @ 2015-09-14  9:30 UTC (permalink / raw)
  To: intel-gfx

The scaler_id in intel_pipe_config_compare should not be checked
when adjusting in intel_pipe_config_compare. The hw scaler id may
be changed in intel_update_pipe_config.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 452e8f77151d..deb76c84a307 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -12467,9 +12467,9 @@ intel_pipe_config_compare(struct drm_device *dev,
 			PIPE_CONF_CHECK_X(pch_pfit.pos);
 			PIPE_CONF_CHECK_X(pch_pfit.size);
 		}
-	}
 
-	PIPE_CONF_CHECK_I(scaler_state.scaler_id);
+		PIPE_CONF_CHECK_I(scaler_state.scaler_id);
+	}
 
 	/* BDW+ don't expose a synchronous way to read the state */
 	if (IS_HASWELL(dev))
-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/2] drm/i915: Only check pipe state for fast modeset when it's possible.
  2015-09-14  9:30 [PATCH 1/2] drm/i915: Fix fastboot scalers for skylake Maarten Lankhorst
@ 2015-09-14  9:30 ` Maarten Lankhorst
  2015-09-14 13:55   ` Daniel Vetter
                     ` (2 more replies)
  2015-09-16 18:45 ` [PATCH 1/2] drm/i915: Fix fastboot scalers for skylake Jesse Barnes
  1 sibling, 3 replies; 9+ messages in thread
From: Maarten Lankhorst @ 2015-09-14  9:30 UTC (permalink / raw)
  To: intel-gfx

A fast modeset can only be performed when connectors and active are
not changed. This prevents a lot of KMS spam when going from a NULL
mode with 0 connectors to an actual mode.

When a crtc is inactive there's no need to evade either, the changes
can be applied when the crtc turns on again.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index deb76c84a307..eddc81c2d459 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -12281,7 +12281,7 @@ intel_compare_link_m_n(const struct intel_link_m_n *m_n,
 
 static bool
 intel_pipe_config_compare(struct drm_device *dev,
-			  struct intel_crtc_state *current_config,
+			  const struct intel_crtc_state *current_config,
 			  struct intel_crtc_state *pipe_config,
 			  bool adjust)
 {
@@ -13013,14 +13013,15 @@ static int intel_atomic_check(struct drm_device *dev,
 		if (ret)
 			return ret;
 
-		if (intel_pipe_config_compare(state->dev,
-					to_intel_crtc_state(crtc->state),
-					pipe_config, true)) {
+		if (!crtc_state->connectors_changed &&
+		    !crtc_state->active_changed &&
+		    crtc_state->active &&
+		    intel_pipe_config_compare(state->dev,
+					      to_intel_crtc_state(crtc->state),
+					      pipe_config, true)) {
 			crtc_state->mode_changed = false;
-			to_intel_crtc_state(crtc_state)->update_pipe = true;
-		}
-
-		if (needs_modeset(crtc_state)) {
+			pipe_config->update_pipe = true;
+		} else {
 			any_ms = true;
 
 			ret = drm_atomic_add_affected_planes(state, crtc);
@@ -13029,8 +13030,8 @@ static int intel_atomic_check(struct drm_device *dev,
 		}
 
 		intel_dump_pipe_config(to_intel_crtc(crtc), pipe_config,
-				       needs_modeset(crtc_state) ?
-				       "[modeset]" : "[fastset]");
+				       pipe_config->update_pipe ?
+				       "[fastset]" : "[modeset]");
 	}
 
 	if (any_ms) {
-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] drm/i915: Only check pipe state for fast modeset when it's possible.
  2015-09-14  9:30 ` [PATCH 2/2] drm/i915: Only check pipe state for fast modeset when it's possible Maarten Lankhorst
@ 2015-09-14 13:55   ` Daniel Vetter
  2015-09-14 17:10   ` Daniel Stone
  2015-09-16 18:48   ` Jesse Barnes
  2 siblings, 0 replies; 9+ messages in thread
From: Daniel Vetter @ 2015-09-14 13:55 UTC (permalink / raw)
  To: Maarten Lankhorst; +Cc: intel-gfx

On Mon, Sep 14, 2015 at 11:30:11AM +0200, Maarten Lankhorst wrote:
> A fast modeset can only be performed when connectors and active are
> not changed. This prevents a lot of KMS spam when going from a NULL
> mode with 0 connectors to an actual mode.
> 
> When a crtc is inactive there's no need to evade either, the changes
> can be applied when the crtc turns on again.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>

Needs an igt imo.
-Daniel

> ---
>  drivers/gpu/drm/i915/intel_display.c | 21 +++++++++++----------
>  1 file changed, 11 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index deb76c84a307..eddc81c2d459 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -12281,7 +12281,7 @@ intel_compare_link_m_n(const struct intel_link_m_n *m_n,
>  
>  static bool
>  intel_pipe_config_compare(struct drm_device *dev,
> -			  struct intel_crtc_state *current_config,
> +			  const struct intel_crtc_state *current_config,
>  			  struct intel_crtc_state *pipe_config,
>  			  bool adjust)
>  {
> @@ -13013,14 +13013,15 @@ static int intel_atomic_check(struct drm_device *dev,
>  		if (ret)
>  			return ret;
>  
> -		if (intel_pipe_config_compare(state->dev,
> -					to_intel_crtc_state(crtc->state),
> -					pipe_config, true)) {
> +		if (!crtc_state->connectors_changed &&
> +		    !crtc_state->active_changed &&
> +		    crtc_state->active &&
> +		    intel_pipe_config_compare(state->dev,
> +					      to_intel_crtc_state(crtc->state),
> +					      pipe_config, true)) {
>  			crtc_state->mode_changed = false;
> -			to_intel_crtc_state(crtc_state)->update_pipe = true;
> -		}
> -
> -		if (needs_modeset(crtc_state)) {
> +			pipe_config->update_pipe = true;
> +		} else {
>  			any_ms = true;
>  
>  			ret = drm_atomic_add_affected_planes(state, crtc);
> @@ -13029,8 +13030,8 @@ static int intel_atomic_check(struct drm_device *dev,
>  		}
>  
>  		intel_dump_pipe_config(to_intel_crtc(crtc), pipe_config,
> -				       needs_modeset(crtc_state) ?
> -				       "[modeset]" : "[fastset]");
> +				       pipe_config->update_pipe ?
> +				       "[fastset]" : "[modeset]");
>  	}
>  
>  	if (any_ms) {
> -- 
> 2.1.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] drm/i915: Only check pipe state for fast modeset when it's possible.
  2015-09-14  9:30 ` [PATCH 2/2] drm/i915: Only check pipe state for fast modeset when it's possible Maarten Lankhorst
  2015-09-14 13:55   ` Daniel Vetter
@ 2015-09-14 17:10   ` Daniel Stone
  2015-09-23 13:35     ` Maarten Lankhorst
  2015-09-16 18:48   ` Jesse Barnes
  2 siblings, 1 reply; 9+ messages in thread
From: Daniel Stone @ 2015-09-14 17:10 UTC (permalink / raw)
  To: Maarten Lankhorst; +Cc: intel-gfx

Hi,

On 14 September 2015 at 10:30, Maarten Lankhorst
<maarten.lankhorst@linux.intel.com> wrote:
> @@ -13013,14 +13013,15 @@ static int intel_atomic_check(struct drm_device *dev,
>                 if (ret)
>                         return ret;
>
> -               if (intel_pipe_config_compare(state->dev,
> -                                       to_intel_crtc_state(crtc->state),
> -                                       pipe_config, true)) {
> +               if (!crtc_state->connectors_changed &&
> +                   !crtc_state->active_changed && look
> +                   crtc_state->active &&
> +                   intel_pipe_config_compare(state->dev,
> +                                             to_intel_crtc_state(crtc->state),
> +                                             pipe_config, true)) {
>                         crtc_state->mode_changed = false;
> -                       to_intel_crtc_state(crtc_state)->update_pipe = true;
> -               }
> -
> -               if (needs_modeset(crtc_state)) {
> +                       pipe_config->update_pipe = true;
> +               } else {
>                         any_ms = true;

The change from only setting any_ms if needs_modeset() is true, to
always if we can't do a fastset, seems correct but maybe a bit subtle.
Was that intended? At the moment it does look like it'll widen the net
a little bit, but I _suspect_ that's a good thing. Pending igt:
Acked-by: Daniel Stone <daniels@collabora.com>

Cheers,
Daniel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] drm/i915: Fix fastboot scalers for skylake.
  2015-09-14  9:30 [PATCH 1/2] drm/i915: Fix fastboot scalers for skylake Maarten Lankhorst
  2015-09-14  9:30 ` [PATCH 2/2] drm/i915: Only check pipe state for fast modeset when it's possible Maarten Lankhorst
@ 2015-09-16 18:45 ` Jesse Barnes
  2015-09-23  8:55   ` Daniel Vetter
  1 sibling, 1 reply; 9+ messages in thread
From: Jesse Barnes @ 2015-09-16 18:45 UTC (permalink / raw)
  To: Maarten Lankhorst, intel-gfx

On 09/14/2015 02:30 AM, Maarten Lankhorst wrote:
> The scaler_id in intel_pipe_config_compare should not be checked
> when adjusting in intel_pipe_config_compare. The hw scaler id may
> be changed in intel_update_pipe_config.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 452e8f77151d..deb76c84a307 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -12467,9 +12467,9 @@ intel_pipe_config_compare(struct drm_device *dev,
>  			PIPE_CONF_CHECK_X(pch_pfit.pos);
>  			PIPE_CONF_CHECK_X(pch_pfit.size);
>  		}
> -	}
>  
> -	PIPE_CONF_CHECK_I(scaler_state.scaler_id);
> +		PIPE_CONF_CHECK_I(scaler_state.scaler_id);
> +	}
>  
>  	/* BDW+ don't expose a synchronous way to read the state */
>  	if (IS_HASWELL(dev))
> 

Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] drm/i915: Only check pipe state for fast modeset when it's possible.
  2015-09-14  9:30 ` [PATCH 2/2] drm/i915: Only check pipe state for fast modeset when it's possible Maarten Lankhorst
  2015-09-14 13:55   ` Daniel Vetter
  2015-09-14 17:10   ` Daniel Stone
@ 2015-09-16 18:48   ` Jesse Barnes
  2015-09-23 11:38     ` Maarten Lankhorst
  2 siblings, 1 reply; 9+ messages in thread
From: Jesse Barnes @ 2015-09-16 18:48 UTC (permalink / raw)
  To: Maarten Lankhorst, intel-gfx

On 09/14/2015 02:30 AM, Maarten Lankhorst wrote:
> +		if (!crtc_state->connectors_changed &&
> +		    !crtc_state->active_changed &&
> +		    crtc_state->active &&
> +		    intel_pipe_config_compare(state->dev,
> +					      to_intel_crtc_state(crtc->state),
> +					      pipe_config, true)) {
>  			crtc_state->mode_changed = false;
> -			to_intel_crtc_state(crtc_state)->update_pipe = true;
> -		}

Doesn't needs_modeset() cover the connectors and active changed cases?  Could we just hoist that up earlier in this function instead?

Jesse
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] drm/i915: Fix fastboot scalers for skylake.
  2015-09-16 18:45 ` [PATCH 1/2] drm/i915: Fix fastboot scalers for skylake Jesse Barnes
@ 2015-09-23  8:55   ` Daniel Vetter
  0 siblings, 0 replies; 9+ messages in thread
From: Daniel Vetter @ 2015-09-23  8:55 UTC (permalink / raw)
  To: Jesse Barnes; +Cc: intel-gfx

On Wed, Sep 16, 2015 at 11:45:22AM -0700, Jesse Barnes wrote:
> On 09/14/2015 02:30 AM, Maarten Lankhorst wrote:
> > The scaler_id in intel_pipe_config_compare should not be checked
> > when adjusting in intel_pipe_config_compare. The hw scaler id may
> > be changed in intel_update_pipe_config.
> > 
> > Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_display.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index 452e8f77151d..deb76c84a307 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -12467,9 +12467,9 @@ intel_pipe_config_compare(struct drm_device *dev,
> >  			PIPE_CONF_CHECK_X(pch_pfit.pos);
> >  			PIPE_CONF_CHECK_X(pch_pfit.size);
> >  		}
> > -	}
> >  
> > -	PIPE_CONF_CHECK_I(scaler_state.scaler_id);
> > +		PIPE_CONF_CHECK_I(scaler_state.scaler_id);
> > +	}
> >  
> >  	/* BDW+ don't expose a synchronous way to read the state */
> >  	if (IS_HASWELL(dev))
> > 
> 
> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>

Queued for -next, thanks for the patch. Still looking for that
kms_fastmodeset igt ...
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] drm/i915: Only check pipe state for fast modeset when it's possible.
  2015-09-16 18:48   ` Jesse Barnes
@ 2015-09-23 11:38     ` Maarten Lankhorst
  0 siblings, 0 replies; 9+ messages in thread
From: Maarten Lankhorst @ 2015-09-23 11:38 UTC (permalink / raw)
  To: Jesse Barnes, intel-gfx

Op 16-09-15 om 20:48 schreef Jesse Barnes:
> On 09/14/2015 02:30 AM, Maarten Lankhorst wrote:
>> +		if (!crtc_state->connectors_changed &&
>> +		    !crtc_state->active_changed &&
>> +		    crtc_state->active &&
>> +		    intel_pipe_config_compare(state->dev,
>> +					      to_intel_crtc_state(crtc->state),
>> +					      pipe_config, true)) {
>>  			crtc_state->mode_changed = false;
>> -			to_intel_crtc_state(crtc_state)->update_pipe = true;
>> -		}
> Doesn't needs_modeset() cover the connectors and active changed cases?  Could we just hoist that up earlier in this function instead?
>
Not sure what you're saying, since needs_modeset is always true here.

~Maarten
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] drm/i915: Only check pipe state for fast modeset when it's possible.
  2015-09-14 17:10   ` Daniel Stone
@ 2015-09-23 13:35     ` Maarten Lankhorst
  0 siblings, 0 replies; 9+ messages in thread
From: Maarten Lankhorst @ 2015-09-23 13:35 UTC (permalink / raw)
  To: Daniel Stone; +Cc: intel-gfx

Op 14-09-15 om 19:10 schreef Daniel Stone:
> Hi,
>
> On 14 September 2015 at 10:30, Maarten Lankhorst
> <maarten.lankhorst@linux.intel.com> wrote:
>> @@ -13013,14 +13013,15 @@ static int intel_atomic_check(struct drm_device *dev,
>>                 if (ret)
>>                         return ret;
>>
>> -               if (intel_pipe_config_compare(state->dev,
>> -                                       to_intel_crtc_state(crtc->state),
>> -                                       pipe_config, true)) {
>> +               if (!crtc_state->connectors_changed &&
>> +                   !crtc_state->active_changed && look
>> +                   crtc_state->active &&
>> +                   intel_pipe_config_compare(state->dev,
>> +                                             to_intel_crtc_state(crtc->state),
>> +                                             pipe_config, true)) {
>>                         crtc_state->mode_changed = false;
>> -                       to_intel_crtc_state(crtc_state)->update_pipe = true;
>> -               }
>> -
>> -               if (needs_modeset(crtc_state)) {
>> +                       pipe_config->update_pipe = true;
>> +               } else {
>>                         any_ms = true;
> The change from only setting any_ms if needs_modeset() is true, to
> always if we can't do a fastset, seems correct but maybe a bit subtle.
It's exactly the same thing, just made a bit more explicit.

before: any_ms = needs_modeset() with mode_changed = !update_pipe.
After: any_ms = !update_pipe.

> Was that intended? At the moment it does look like it'll widen the net
> a little bit, but I _suspect_ that's a good thing. Pending igt:
> Acked-by: Daniel Stone <daniels@collabora.com>
>
> Cheers,
> Daniel

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-09-23 13:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-14  9:30 [PATCH 1/2] drm/i915: Fix fastboot scalers for skylake Maarten Lankhorst
2015-09-14  9:30 ` [PATCH 2/2] drm/i915: Only check pipe state for fast modeset when it's possible Maarten Lankhorst
2015-09-14 13:55   ` Daniel Vetter
2015-09-14 17:10   ` Daniel Stone
2015-09-23 13:35     ` Maarten Lankhorst
2015-09-16 18:48   ` Jesse Barnes
2015-09-23 11:38     ` Maarten Lankhorst
2015-09-16 18:45 ` [PATCH 1/2] drm/i915: Fix fastboot scalers for skylake Jesse Barnes
2015-09-23  8:55   ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.