All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Souza, Jose" <jose.souza@intel.com>
To: "ville.syrjala@linux.intel.com" <ville.syrjala@linux.intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH 11/12] drm/i915: Fix g4x fbc watermark enable
Date: Thu, 25 Jun 2020 01:04:15 +0000	[thread overview]
Message-ID: <599be76dd4f2aaa242f48abe809ec089e5354acc.camel@intel.com> (raw)
In-Reply-To: <20200429101034.8208-12-ville.syrjala@linux.intel.com>

On Wed, 2020-04-29 at 13:10 +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> 'level' here means the highest level we can't use, so when checking
> the fbc watermarks we need a -1 to get at the last enabled level.
> 
> While at if refactor the code a bit to declutter
> g4x_compute_pipe_wm().
> 

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>

> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_pm.c | 33 +++++++++++++++++++++------------
>  1 file changed, 21 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 1e99b35f007e..1c92ebf64a34 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -1344,6 +1344,23 @@ static void g4x_invalidate_wms(struct intel_crtc *crtc,
>  	}
>  }
>  
> +static bool g4x_compute_fbc_en(const struct g4x_wm_state *wm_state,
> +			       int level)
> +{
> +	if (level < G4X_WM_LEVEL_SR)
> +		return false;
> +
> +	if (level >= G4X_WM_LEVEL_SR &&
> +	    wm_state->sr.fbc > g4x_fbc_fifo_size(G4X_WM_LEVEL_SR))
> +		return false;
> +
> +	if (level >= G4X_WM_LEVEL_HPLL &&
> +	    wm_state->hpll.fbc > g4x_fbc_fifo_size(G4X_WM_LEVEL_HPLL))
> +		return false;
> +
> +	return true;
> +}
> +
>  static int g4x_compute_pipe_wm(struct intel_crtc_state *crtc_state)
>  {
>  	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
> @@ -1383,7 +1400,6 @@ static int g4x_compute_pipe_wm(struct intel_crtc_state *crtc_state)
>  		wm_state->wm.plane[plane_id] = raw->plane[plane_id];
>  
>  	level = G4X_WM_LEVEL_SR;
> -
>  	if (!g4x_raw_crtc_wm_is_valid(crtc_state, level))
>  		goto out;
>  
> @@ -1395,7 +1411,6 @@ static int g4x_compute_pipe_wm(struct intel_crtc_state *crtc_state)
>  	wm_state->cxsr = num_active_planes == BIT(PLANE_PRIMARY);
>  
>  	level = G4X_WM_LEVEL_HPLL;
> -
>  	if (!g4x_raw_crtc_wm_is_valid(crtc_state, level))
>  		goto out;
>  
> @@ -1418,17 +1433,11 @@ static int g4x_compute_pipe_wm(struct intel_crtc_state *crtc_state)
>  	/*
>  	 * Determine if the FBC watermark(s) can be used. IF
>  	 * this isn't the case we prefer to disable the FBC
> -	 ( watermark(s) rather than disable the SR/HPLL
> -	 * level(s) entirely.
> +	 * watermark(s) rather than disable the SR/HPLL
> +	 * level(s) entirely. 'level-1' is the highest valid
> +	 * level here.
>  	 */
> -	wm_state->fbc_en = level > G4X_WM_LEVEL_NORMAL;
> -
> -	if (level >= G4X_WM_LEVEL_SR &&
> -	    wm_state->sr.fbc > g4x_fbc_fifo_size(G4X_WM_LEVEL_SR))
> -		wm_state->fbc_en = false;
> -	else if (level >= G4X_WM_LEVEL_HPLL &&
> -		 wm_state->hpll.fbc > g4x_fbc_fifo_size(G4X_WM_LEVEL_HPLL))
> -		wm_state->fbc_en = false;
> +	wm_state->fbc_en = g4x_compute_fbc_en(wm_state, level - 1);
>  
>  	return 0;
>  }
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-06-25  1:04 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-29 10:10 [Intel-gfx] [PATCH 00/12] drm/i915: FBC fixes Ville Syrjala
2020-04-29 10:10 ` [Intel-gfx] [PATCH 01/12] drm/i915/fbc: Require linear fb stride to be multiple of 512 bytes on gen9/glk Ville Syrjala
2020-05-01  1:03   ` Matt Roper
2020-04-29 10:10 ` [Intel-gfx] [PATCH 02/12] drm/i915/fbc: Use the correct plane stride Ville Syrjala
2020-04-29 15:29   ` [Intel-gfx] [PATCH v2 " Ville Syrjala
2020-05-02  0:16     ` Matt Roper
2020-05-04 14:33       ` Ville Syrjälä
2020-04-29 10:10 ` [Intel-gfx] [PATCH 03/12] drm/i915/fbc: Fix fence_y_offset handling Ville Syrjala
2020-05-02  0:33   ` Matt Roper
2020-04-29 10:10 ` [Intel-gfx] [PATCH 04/12] drm/i915/fbc: Fix nuke for pre-snb platforms Ville Syrjala
2020-05-02  1:18   ` Matt Roper
2020-05-04 15:02     ` Ville Syrjälä
2020-04-29 10:10 ` [Intel-gfx] [PATCH 05/12] drm/i915/fbc: Enable fbc on i865 Ville Syrjala
2020-04-29 10:10 ` [Intel-gfx] [PATCH 06/12] drm/i915/fbc: Don't clear busy_bits for origin==GTT Ville Syrjala
2020-06-25  1:04   ` Souza, Jose
2020-04-29 10:10 ` [Intel-gfx] [PATCH 07/12] drm/i915/fbc: Allow FBC to recompress after a 3D workload on i85x/i865 Ville Syrjala
2020-04-29 10:10 ` [Intel-gfx] [PATCH 08/12] drm/i915/fbc: Parametrize FBC_CONTROL Ville Syrjala
2020-06-25  0:41   ` Souza, Jose
2020-04-29 10:10 ` [Intel-gfx] [PATCH 09/12] drm/i915/fbc: Store the fbc1 compression interval in the params Ville Syrjala
2020-06-25  0:47   ` Souza, Jose
2020-04-29 10:10 ` [Intel-gfx] [PATCH 10/12] drm/i915/fbc: Reduce fbc1 compression interval to 1 second Ville Syrjala
2020-06-25  0:49   ` Souza, Jose
2020-04-29 10:10 ` [Intel-gfx] [PATCH 11/12] drm/i915: Fix g4x fbc watermark enable Ville Syrjala
2020-06-25  1:04   ` Souza, Jose [this message]
2020-04-29 10:10 ` [Intel-gfx] [PATCH 12/12] drm/i915: Suppress spurious underruns on gen2 Ville Syrjala
2020-06-25  0:59   ` Souza, Jose
2020-04-29 11:04 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: FBC fixes Patchwork
2020-04-29 13:44 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2020-04-29 17:27 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: FBC fixes (rev2) Patchwork
2020-04-29 23:22 ` [Intel-gfx] ✓ Fi.CI.IGT: " 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=599be76dd4f2aaa242f48abe809ec089e5354acc.camel@intel.com \
    --to=jose.souza@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@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.