public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: ville.syrjala@linux.intel.com, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 05/12] drm/i915: Reorganize VLV DDL setup
Date: Fri, 27 Feb 2015 09:52:46 -0800	[thread overview]
Message-ID: <54F0AEEE.8070308@virtuousgeek.org> (raw)
In-Reply-To: <1423574909-1074-6-git-send-email-ville.syrjala@linux.intel.com>

On 02/10/2015 05:28 AM, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Introduce struct vlv_wm_values to house VLV watermark/drain latency
> values. We start by using it when computing the drain latency values.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h |  9 ++++++++
>  drivers/gpu/drm/i915/intel_pm.c | 46 +++++++++++++++++++++++++++--------------
>  2 files changed, 40 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 26ffe8b..5de69a0 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1514,6 +1514,14 @@ struct ilk_wm_values {
>  	enum intel_ddb_partitioning partitioning;
>  };
>  
> +struct vlv_wm_values {
> +	struct {
> +		uint8_t cursor;
> +		uint8_t sprite[2];
> +		uint8_t primary;
> +	} ddl[3];
> +};
> +
>  struct skl_ddb_entry {
>  	uint16_t start, end;	/* in number of blocks, 'end' is exclusive */
>  };
> @@ -1870,6 +1878,7 @@ struct drm_i915_private {
>  		union {
>  			struct ilk_wm_values hw;
>  			struct skl_wm_values skl_hw;
> +			struct vlv_wm_values vlv;
>  		};
>  	} wm;
>  
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index c4c2317..5515d10 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -711,6 +711,21 @@ static bool g4x_compute_srwm(struct drm_device *dev,
>  			      display, cursor);
>  }
>  
> +static void vlv_write_wm_values(struct intel_crtc *crtc,
> +				const struct vlv_wm_values *wm)
> +{
> +	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
> +	enum pipe pipe = crtc->pipe;
> +
> +	I915_WRITE(VLV_DDL(pipe),
> +		   (wm->ddl[pipe].cursor << DDL_CURSOR_SHIFT) |
> +		   (wm->ddl[pipe].sprite[1] << DDL_SPRITE_SHIFT(1)) |
> +		   (wm->ddl[pipe].sprite[0] << DDL_SPRITE_SHIFT(0)) |
> +		   (wm->ddl[pipe].primary << DDL_PLANE_SHIFT));
> +
> +	dev_priv->wm.vlv = *wm;
> +}
> +
>  static uint8_t vlv_compute_drain_latency(struct drm_crtc *crtc,
>  					 int pixel_size)
>  {
> @@ -757,20 +772,19 @@ static void vlv_update_drain_latency(struct drm_crtc *crtc)
>  	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
>  	int pixel_size;
>  	enum pipe pipe = intel_crtc->pipe;
> -	int plane_dl;
> +	struct vlv_wm_values wm = dev_priv->wm.vlv;
>  
> -	plane_dl = I915_READ(VLV_DDL(pipe)) &
> -		~(((DDL_PRECISION_HIGH | DRAIN_LATENCY_MASK) << DDL_CURSOR_SHIFT) |
> -		  ((DDL_PRECISION_HIGH | DRAIN_LATENCY_MASK) << DDL_PLANE_SHIFT));
> +	wm.ddl[pipe].primary = 0;
> +	wm.ddl[pipe].cursor = 0;
>  
>  	if (!intel_crtc_active(crtc)) {
> -		I915_WRITE(VLV_DDL(pipe), plane_dl);
> +		vlv_write_wm_values(intel_crtc, &wm);
>  		return;
>  	}
>  
>  	/* Primary plane Drain Latency */
>  	pixel_size = crtc->primary->fb->bits_per_pixel / 8;	/* BPP */
> -	plane_dl = vlv_compute_drain_latency(crtc, pixel_size) << DDL_PLANE_SHIFT;
> +	wm.ddl[pipe].primary = vlv_compute_drain_latency(crtc, pixel_size);
>  
>  	/* Cursor Drain Latency
>  	 * BPP is always 4 for cursor
> @@ -779,9 +793,10 @@ static void vlv_update_drain_latency(struct drm_crtc *crtc)
>  
>  	/* Program cursor DL only if it is enabled */
>  	if (intel_crtc->cursor_base)
> -		plane_dl |= vlv_compute_drain_latency(crtc, pixel_size) << DDL_CURSOR_SHIFT;
> +		wm.ddl[pipe].cursor =
> +			vlv_compute_drain_latency(crtc, pixel_size);
>  
> -	I915_WRITE(VLV_DDL(pipe), plane_dl);
> +	vlv_write_wm_values(intel_crtc, &wm);
>  }
>  
>  #define single_plane_enabled(mask) is_power_of_2(mask)
> @@ -939,17 +954,18 @@ static void valleyview_update_sprite_wm(struct drm_plane *plane,
>  {
>  	struct drm_device *dev = crtc->dev;
>  	struct drm_i915_private *dev_priv = dev->dev_private;
> -	int pipe = to_intel_plane(plane)->pipe;
> +	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> +	enum pipe pipe = intel_crtc->pipe;
>  	int sprite = to_intel_plane(plane)->plane;
> -	int sprite_dl;
> -
> -	sprite_dl = I915_READ(VLV_DDL(pipe)) &
> -		~((DDL_PRECISION_HIGH | DRAIN_LATENCY_MASK) << DDL_SPRITE_SHIFT(sprite));
> +	struct vlv_wm_values wm = dev_priv->wm.vlv;
>  
>  	if (enabled)
> -		sprite_dl |= vlv_compute_drain_latency(crtc, pixel_size) << DDL_SPRITE_SHIFT(sprite);
> +		wm.ddl[pipe].sprite[sprite] =
> +			vlv_compute_drain_latency(crtc, pixel_size);
> +	else
> +		wm.ddl[pipe].sprite[sprite] = 0;
>  
> -	I915_WRITE(VLV_DDL(pipe), sprite_dl);
> +	vlv_write_wm_values(intel_crtc, &wm);
>  }
>  
>  static void g4x_update_wm(struct drm_crtc *crtc)
> 

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

  reply	other threads:[~2015-02-27 17:53 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-10 13:28 [PATCH 00/12] drm/i915: Redo VLV/CHV watermark code ville.syrjala
2015-02-10 13:28 ` [PATCH 01/12] drm/i915: Reduce CHV DDL multiplier to 16/8 ville.syrjala
2015-02-27 17:36   ` Jesse Barnes
2015-02-27 18:02     ` Ville Syrjälä
     [not found]   ` <54F42A58.1020103@linux.intel.com>
2015-03-02  9:36     ` Arun R Murthy
2015-02-10 13:28 ` [PATCH 02/12] drm/i915: Kill DRAIN_LATENCY_PRECISION_* defines ville.syrjala
2015-02-27 17:38   ` Jesse Barnes
2015-02-27 18:06     ` Ville Syrjälä
2015-02-10 13:28 ` [PATCH 03/12] drm/i915: Simplify VLV drain latency computation ville.syrjala
2015-02-27 17:40   ` Jesse Barnes
2015-02-10 13:28 ` [PATCH 04/12] drm/i915: Hide VLV DDL precision handling ville.syrjala
2015-02-27 17:46   ` Jesse Barnes
2015-02-10 13:28 ` [PATCH 05/12] drm/i915: Reorganize VLV DDL setup ville.syrjala
2015-02-27 17:52   ` Jesse Barnes [this message]
2015-02-10 13:28 ` [PATCH 06/12] drm/i915: Pass plane to vlv_compute_drain_latency() ville.syrjala
2015-02-27 17:57   ` Jesse Barnes
2015-02-27 18:09     ` Ville Syrjälä
2015-02-27 20:37       ` Jesse Barnes
2015-03-02 14:44       ` Daniel Vetter
2015-03-02 14:49         ` Ville Syrjälä
2015-03-02 17:18           ` Daniel Vetter
2015-02-10 13:28 ` [PATCH 07/12] drm/i915: Read out display FIFO size on VLV/CHV ville.syrjala
2015-02-12 18:59   ` [PATCH v2 " ville.syrjala
2015-02-27 18:04     ` Jesse Barnes
2015-02-10 13:28 ` [PATCH 08/12] drm/i915: Make sure PND deadline mode is enabled " ville.syrjala
2015-02-27 20:38   ` Jesse Barnes
2015-02-27 20:48     ` Ville Syrjälä
2015-02-10 13:28 ` [PATCH 09/12] drm/i915: Rewrite VLV/CHV watermark code ville.syrjala
2015-03-05 17:22   ` Ville Syrjälä
2015-02-10 13:28 ` [PATCH 10/12] drm/i915: Support maxfifo with two planes on CHV ville.syrjala
2015-03-04 14:04   ` Purushothaman, Vijay A
2015-03-04 14:50     ` Ville Syrjälä
2015-02-10 13:28 ` [PATCH 11/12] drm/i915: Program PFI credits for VLV ville.syrjala
2015-03-04 14:25   ` Purushothaman, Vijay A
2015-03-04 15:06     ` Ville Syrjälä
2015-03-04 15:26     ` Ville Syrjälä
2015-02-10 13:28 ` [PATCH 12/12] drm/i915: Enable the maxfifo PM5 mode when appropriate on CHV ville.syrjala
2015-02-11  0:01   ` shuang.he
2015-02-26 19:01   ` [PATCH v2 " ville.syrjala
2015-03-04 14:28   ` [PATCH " Purushothaman, Vijay A
2015-03-04 15:07     ` Ville Syrjälä
  -- strict thread matches above, loose matches on Subject: below --
2015-03-05 19:19 [PATCH v2 00/12] drm/i915: Redo VLV/CHV watermark code (v2) ville.syrjala
2015-03-05 19:19 ` [PATCH 05/12] drm/i915: Reorganize VLV DDL setup ville.syrjala

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=54F0AEEE.8070308@virtuousgeek.org \
    --to=jbarnes@virtuousgeek.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox