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 v2 07/12] drm/i915: Read out display FIFO size on VLV/CHV
Date: Fri, 27 Feb 2015 10:04:14 -0800	[thread overview]
Message-ID: <54F0B19E.8030502@virtuousgeek.org> (raw)
In-Reply-To: <1423767557-13757-1-git-send-email-ville.syrjala@linux.intel.com>

On 02/12/2015 10:59 AM, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> VLV/CHV have similar DSPARB registers as older platforms, just more of
> them due to more planes. Add a bit of code to read out the current FIFO
> split from the registers. Will be useful later when we improve the WM
> calculations.
> 
> v2: Add display_mmio_offset to DSPARB
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_reg.h |  5 +++-
>  drivers/gpu/drm/i915/intel_pm.c | 55 +++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 59 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index b35aaf3..3b48f4b 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -4026,7 +4026,7 @@ enum skl_disp_power_wells {
>  #define   DPINVGTT_STATUS_MASK			0xff
>  #define   DPINVGTT_STATUS_MASK_CHV		0xfff
>  
> -#define DSPARB			0x70030
> +#define DSPARB			(dev_priv->info.display_mmio_offset + 0x70030)
>  #define   DSPARB_CSTART_MASK	(0x7f << 7)
>  #define   DSPARB_CSTART_SHIFT	7
>  #define   DSPARB_BSTART_MASK	(0x7f)
> @@ -4034,6 +4034,9 @@ enum skl_disp_power_wells {
>  #define   DSPARB_BEND_SHIFT	9 /* on 855 */
>  #define   DSPARB_AEND_SHIFT	0
>  
> +#define DSPARB2			(VLV_DISPLAY_BASE + 0x70060) /* vlv/chv */
> +#define DSPARB3			(VLV_DISPLAY_BASE + 0x7006c) /* chv */
> +
>  /* pnv/gen4/g4x/vlv/chv */
>  #define DSPFW1			(dev_priv->info.display_mmio_offset + 0x70034)
>  #define   DSPFW_SR_SHIFT		23
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index fffcf64..e53038e 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -280,6 +280,61 @@ void intel_set_memory_cxsr(struct drm_i915_private *dev_priv, bool enable)
>   */
>  static const int pessimal_latency_ns = 5000;
>  
> +#define VLV_FIFO_START(dsparb, dsparb2, lo_shift, hi_shift) \
> +	((((dsparb) >> (lo_shift)) & 0xff) | ((((dsparb2) >> (hi_shift)) & 0x1) << 8))
> +
> +static int vlv_get_fifo_size(struct drm_device *dev,
> +			      enum pipe pipe, int plane)
> +{
> +	struct drm_i915_private *dev_priv = dev->dev_private;
> +	int sprite0_start, sprite1_start, size;
> +
> +	switch (pipe) {
> +		uint32_t dsparb, dsparb2, dsparb3;
> +	case PIPE_A:
> +		dsparb = I915_READ(DSPARB);
> +		dsparb2 = I915_READ(DSPARB2);
> +		sprite0_start = VLV_FIFO_START(dsparb, dsparb2, 0, 0);
> +		sprite1_start = VLV_FIFO_START(dsparb, dsparb2, 8, 4);
> +		break;
> +	case PIPE_B:
> +		dsparb = I915_READ(DSPARB);
> +		dsparb2 = I915_READ(DSPARB2);
> +		sprite0_start = VLV_FIFO_START(dsparb, dsparb2, 16, 8);
> +		sprite1_start = VLV_FIFO_START(dsparb, dsparb2, 24, 12);
> +		break;
> +	case PIPE_C:
> +		dsparb2 = I915_READ(DSPARB2);
> +		dsparb3 = I915_READ(DSPARB3);
> +		sprite0_start = VLV_FIFO_START(dsparb3, dsparb2, 0, 16);
> +		sprite1_start = VLV_FIFO_START(dsparb3, dsparb2, 8, 20);
> +		break;
> +	default:
> +		return 0;
> +	}
> +
> +	switch (plane) {
> +	case 0:
> +		size = sprite0_start;
> +		break;
> +	case 1:
> +		size = sprite1_start - sprite0_start;
> +		break;
> +	case 2:
> +		size = 512 - 1 - sprite1_start;
> +		break;
> +	default:
> +		return 0;
> +	}
> +
> +	DRM_DEBUG_KMS("Pipe %c %s %c FIFO size: %d\n",
> +		      pipe_name(pipe), plane == 0 ? "primary" : "sprite",
> +		      plane == 0 ? plane_name(pipe) : sprite_name(pipe, plane - 1),
> +		      size);
> +
> +	return size;
> +}
> +
>  static int i9xx_get_fifo_size(struct drm_device *dev, int plane)
>  {
>  	struct drm_i915_private *dev_priv = dev->dev_private;
> 

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 18:04 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
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 [this message]
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 v2 07/12] drm/i915: Read out display FIFO size on VLV/CHV 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=54F0B19E.8030502@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