All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/i915: Allow preservation of watermarks.
Date: Wed, 2 Mar 2016 13:17:55 +0200	[thread overview]
Message-ID: <20160302111755.GQ15993@intel.com> (raw)
In-Reply-To: <1456826842-32553-1-git-send-email-maarten.lankhorst@linux.intel.com>

On Tue, Mar 01, 2016 at 11:07:21AM +0100, Maarten Lankhorst wrote:
> As Paulo has noted we can help bisectability by separating computing
> watermarks on a noop in 2 separate commits.
> 
> This patch no longer clears the crtc watermark state, but recalculates
> it completely. Regardless whether a level is used the full values for
> each level are calculated. If a level is invalid wm[level].enable is
> unset.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_pm.c | 22 ++++++++++++----------
>  1 file changed, 12 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index d33de954a2e4..1b8ba777d2b3 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -2300,7 +2300,7 @@ static int ilk_compute_pipe_wm(struct intel_crtc *intel_crtc,
>  	struct intel_plane_state *pristate = NULL;
>  	struct intel_plane_state *sprstate = NULL;
>  	struct intel_plane_state *curstate = NULL;
> -	int level, max_level = ilk_wm_max_level(dev);
> +	int level, max_level = ilk_wm_max_level(dev), usable_level;
>  	struct ilk_wm_maximums max;
>  
>  	cstate = intel_atomic_get_crtc_state(state, intel_crtc);
> @@ -2308,7 +2308,6 @@ static int ilk_compute_pipe_wm(struct intel_crtc *intel_crtc,
>  		return PTR_ERR(cstate);
>  
>  	pipe_wm = &cstate->wm.optimal.ilk;
> -	memset(pipe_wm, 0, sizeof(*pipe_wm));
>  
>  	for_each_intel_plane_on_crtc(dev, intel_crtc, intel_plane) {
>  		ps = drm_atomic_get_plane_state(state,
> @@ -2330,13 +2329,15 @@ static int ilk_compute_pipe_wm(struct intel_crtc *intel_crtc,
>  		(drm_rect_width(&sprstate->dst) != drm_rect_width(&sprstate->src) >> 16 ||
>  		drm_rect_height(&sprstate->dst) != drm_rect_height(&sprstate->src) >> 16);
>  
> +	usable_level = max_level;
> +
>  	/* ILK/SNB: LP2+ watermarks only w/o sprites */
>  	if (INTEL_INFO(dev)->gen <= 6 && sprstate->visible)
> -		max_level = 1;
> +		usable_level = 1;
>  
>  	/* ILK/SNB/IVB: LP1+ watermarks only w/o scaling */
>  	if (pipe_wm->sprites_scaled)
> -		max_level = 0;
> +		usable_level = 0;
>  
>  	ilk_compute_wm_level(dev_priv, intel_crtc, 0, cstate,
>  			     pristate, sprstate, curstate, &pipe_wm->wm[0]);
> @@ -2350,20 +2351,21 @@ static int ilk_compute_pipe_wm(struct intel_crtc *intel_crtc,
>  	ilk_compute_wm_reg_maximums(dev, 1, &max);
>  
>  	for (level = 1; level <= max_level; level++) {
> -		struct intel_wm_level wm = {};
> +		struct intel_wm_level *wm = &pipe_wm->wm[level];
>  
>  		ilk_compute_wm_level(dev_priv, intel_crtc, level, cstate,
> -				     pristate, sprstate, curstate, &wm);
> +				     pristate, sprstate, curstate, wm);
>  
>  		/*
>  		 * Disable any watermark level that exceeds the
>  		 * register maximums since such watermarks are
>  		 * always invalid.
>  		 */
> -		if (!ilk_validate_wm_level(level, &max, &wm))
> -			break;
> -
> -		pipe_wm->wm[level] = wm;
> +		if (!ilk_validate_wm_level(level, &max, wm)) {
> +			usable_level = level;
> +			wm->enable = false;
> +		} else if (level > usable_level)
> +			wm->enable = false;

That seems to be the wrong way around. I don't think there's
any point in calling ilk_validate_wm_level() if the level
already exceeds the max.

>  	}
>  
>  	return 0;
> -- 
> 2.1.0
> 
> _______________________________________________
> 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

  parent reply	other threads:[~2016-03-02 11:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-01 10:07 [PATCH 1/2] drm/i915: Allow preservation of watermarks Maarten Lankhorst
2016-03-01 10:07 ` [PATCH 2/2] drm/i915: Only recalculate wm's for planes part of the state, v2 Maarten Lankhorst
2016-03-01 22:28   ` Matt Roper
2016-03-02 21:08     ` Zanoni, Paulo R
2016-03-03  8:23       ` Maarten Lankhorst
2016-03-01 12:55 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] drm/i915: Allow preservation of watermarks Patchwork
2016-03-02 11:17 ` Ville Syrjälä [this message]
2016-03-02 11:25   ` [PATCH 1/2] " Maarten Lankhorst
2016-03-02 11:38   ` [PATCH v1.1 1/2] drm/i915: Allow preservation of watermarks, v2 Maarten Lankhorst
2016-03-02 19:44     ` Zanoni, Paulo R
2016-03-04 19:11     ` Ville Syrjälä

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=20160302111755.GQ15993@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=maarten.lankhorst@linux.intel.com \
    /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 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.