public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v3 09/11] drm/i915: Handle ips_enabled in fastset, v2.
Date: Fri, 10 Nov 2017 22:06:30 +0200	[thread overview]
Message-ID: <20171110200630.GH10981@intel.com> (raw)
In-Reply-To: <20171110131504.lw4agtg6nyptpciy@phenom.ffwll.local>

On Fri, Nov 10, 2017 at 02:15:04PM +0100, Daniel Vetter wrote:
> On Fri, Nov 10, 2017 at 12:35:01PM +0100, Maarten Lankhorst wrote:
> > pre_plane_disable and post_plane_enable handle set ips correctly,
> > but if there is no modeset and the ips_enabled value changes
> > because of force disabling for crc, or hw state readout, then we
> > don't toggle ips correctly. Handle this special case, which prevents
> > us from having to do a full modeset when collecting pipe crc.
> > 
> > Changes since v1:
> > - Simplify conditions.
> > 
> > Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> 
> Hm yeah, more hints that maybe ips should be a plane, or at least a wm
> state thing?

I think we would have to write this as something like:

pre_plane_update()
if (old_crtc_state->ips && old_crtc_state->active_planes != 0 &&
    (!new_crtc_state->ips || new_crtc_state->active_planes == 0)
    disable_ips();
 
post_plane_update()
if ((!old_crtc_state->ips || old_crtc_state->active_planes == 0) &&
    new_crtc_state->ips && new_crtc_state->active_planes != 0)
    enable_ips();

Probably needs a few mode needs_modeset() and crtc_state->active
checks etc. to account for all the disabling pipe, enabling pipe,
toggling pipe, and doing nothing to the pipe cases.

To simplify maybe we should probably just account for active_planes
in crtc_state->ips_enabled already. Ie. call hsw_compute_ips_config()
even if we don't do a modeset.

We'd have to change the bdw cdclk vs. ips workaround to work the
other way around though since currently hsw_compute_ips_config() assumes
that we can do a modeset to increase cdclk (assuming it's not already
maxed out). But I think it would be a worthwile change to make the code
less convoluted.

> 
> This turns a bit into a rabbit hole, so if Ville thinks this is all still
> reasonably clean-ish I think we can go with this here too ... I'm just
> wondering a bit.
> -Daniel
> 
> > ---
> >  drivers/gpu/drm/i915/intel_display.c  | 6 ++++++
> >  drivers/gpu/drm/i915/intel_pipe_crc.c | 2 +-
> >  2 files changed, 7 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index 4aa02e27985d..1b75af773ef7 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -5040,6 +5040,9 @@ static void intel_post_plane_update(struct intel_crtc_state *old_crtc_state)
> >  		    (needs_modeset(&pipe_config->base) ||
> >  		     !old_primary_state->base.visible))
> >  			intel_post_enable_primary(&crtc->base, pipe_config);
> > +		else if (pipe_config->update_pipe)
> > +			/* IPS turned on after fastset or CRC collection disable. */
> > +			hsw_enable_ips(pipe_config);
> >  	}
> >  }
> >  
> > @@ -5069,6 +5072,9 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,
> >  		if (old_primary_state->base.visible &&
> >  		    (modeset || !primary_state->base.visible))
> >  			intel_pre_disable_primary(&crtc->base, old_crtc_state);
> > +		else if (pipe_config->update_pipe && !pipe_config->ips_enabled)
> > +			/* IPS turned off for CRC, disable it. */
> > +			hsw_disable_ips(old_crtc_state);
> >  	}
> >  
> >  	/*
> > diff --git a/drivers/gpu/drm/i915/intel_pipe_crc.c b/drivers/gpu/drm/i915/intel_pipe_crc.c
> > index 899839f2f7c6..cb92befc16d7 100644
> > --- a/drivers/gpu/drm/i915/intel_pipe_crc.c
> > +++ b/drivers/gpu/drm/i915/intel_pipe_crc.c
> > @@ -542,7 +542,7 @@ static void hsw_pipe_A_crc_wa(struct drm_i915_private *dev_priv,
> >  		 */
> >  		pipe_config->ips_force_disable = enable;
> >  		if (pipe_config->ips_enabled == enable)
> > -			pipe_config->base.connectors_changed = true;
> > +			pipe_config->base.mode_changed = true;
> >  	}
> >  
> >  	if (IS_HASWELL(dev_priv)) {
> > -- 
> > 2.15.0
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://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
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

  reply	other threads:[~2017-11-10 20:06 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-10 11:34 [PATCH v3 01/11] drm/i915: Update watermark state correctly in sanitize_watermarks Maarten Lankhorst
2017-11-10 11:34 ` [PATCH v3 02/11] drm/i915: Remove bogus ips_enabled check Maarten Lankhorst
2017-11-10 12:57   ` Daniel Vetter
2017-11-13 17:19     ` Ville Syrjälä
2017-11-10 11:34 ` [PATCH v3 03/11] drm/i915: Check boolean options in intel_pipe_config_compare with its own macro Maarten Lankhorst
2017-11-10 12:58   ` Daniel Vetter
2017-11-10 11:34 ` [PATCH v3 04/11] drm/i915: Handle adjust better in intel_pipe_config_compare Maarten Lankhorst
2017-11-10 13:02   ` Daniel Vetter
2017-11-13 17:24     ` Ville Syrjälä
2017-11-20 10:38       ` Daniel Vetter
2017-11-20 10:53         ` Ville Syrjälä
2017-11-20 12:54           ` Daniel Vetter
2017-11-10 11:34 ` [PATCH v3 05/11] drm/i915: Only enable IPS when primary plane is visible Maarten Lankhorst
2017-11-10 13:05   ` Daniel Vetter
2017-11-10 11:34 ` [PATCH v3 06/11] drm/i915: Handle locking better in i915_sink_crc Maarten Lankhorst
2017-11-10 13:13   ` Daniel Vetter
2017-11-10 13:24     ` Daniel Vetter
2017-11-13 12:05       ` Maarten Lankhorst
2017-11-10 11:34 ` [PATCH v3 07/11] drm/i915: Pass idle crtc_state to intel_dp_sink_crc Maarten Lankhorst
2017-11-13 17:17   ` Ville Syrjälä
2017-11-10 11:35 ` [PATCH v3 08/11] drm/i915: Pass crtc_state to ips toggle functions, v2 Maarten Lankhorst
2017-11-13 17:18   ` Ville Syrjälä
2017-11-17 11:21     ` Maarten Lankhorst
2017-11-10 11:35 ` [PATCH v3 09/11] drm/i915: Handle ips_enabled in fastset, v2 Maarten Lankhorst
2017-11-10 13:15   ` Daniel Vetter
2017-11-10 20:06     ` Ville Syrjälä [this message]
2017-11-10 11:35 ` [PATCH v3 10/11] drm/i915: Enable FIFO underrun reporting after initial fastset, v3 Maarten Lankhorst
2017-11-10 13:58   ` Daniel Vetter
2017-11-10 19:48   ` Ville Syrjälä
2017-11-13 12:01     ` Maarten Lankhorst
2017-11-13 13:19       ` Ville Syrjälä
2017-11-13 14:40     ` [PATCH] drm/i915: Enable FIFO underrun reporting after initial fastset, v4 Maarten Lankhorst
2017-11-13 14:49       ` Ville Syrjälä
2017-11-10 11:35 ` [PATCH v3 11/11] drm/i915: Re-enable fastboot by default Maarten Lankhorst
2017-11-10 12:30 ` ✓ Fi.CI.BAT: success for series starting with [v3,01/11] drm/i915: Update watermark state correctly in sanitize_watermarks Patchwork
2017-11-10 13:48 ` ✓ Fi.CI.IGT: " Patchwork
2017-11-10 15:28 ` [Intel-gfx] [PATCH v3 01/11] " Ville Syrjälä
2017-11-11 14:14   ` Maarten Lankhorst
2017-11-13 14:52 ` ✗ Fi.CI.BAT: failure for series starting with [v3,01/11] drm/i915: Update watermark state correctly in sanitize_watermarks (rev2) Patchwork
2017-11-13 15:21 ` Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171110200630.GH10981@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox