public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Damien Lespiau <damien.lespiau@intel.com>
Cc: intel-gfx@lists.freedesktop.org, Pradeep Bhat <pradeep.bhat@intel.com>
Subject: Re: [PATCH 01/28] drm/i915/skl: Read the Memory Latency Values for WM computation
Date: Wed, 5 Nov 2014 11:25:51 +0100	[thread overview]
Message-ID: <20141105102551.GC26941@phenom.ffwll.local> (raw)
In-Reply-To: <1415120825-4375-2-git-send-email-damien.lespiau@intel.com>

On Tue, Nov 04, 2014 at 05:06:38PM +0000, Damien Lespiau wrote:
> From: Pradeep Bhat <pradeep.bhat@intel.com>
> 
> This patch reads the memory latency values for all the 8 levels for
> SKL. These values are needed for the Watermark computation.
> 
> v2: Incorporated the review comments from Damien on register
>     indentation.
> 
> v3: Updated the code to use the sandybridge_pcode_read for reading
>     memory latencies for GEN9.
> 
> v4: Don't put gen 9 in the middle of an ordered list of ifs
>     (Damien)
> 
> v5: take the rps.hw_lock around sandybridge_pcode_read() (Damien)
> 
> v6: Use gen >= 9 in the pcode_read() function for data1.
>     Move the defines near the gen6 ones and prefix them with PCODE.
>     Remove unused timeout define (the pcode_read() code has a larger
>     timeout already).
> 
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Pradeep Bhat <pradeep.bhat@intel.com>
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h |  6 ++++
>  drivers/gpu/drm/i915/i915_reg.h |  7 ++++
>  drivers/gpu/drm/i915/intel_pm.c | 76 +++++++++++++++++++++++++++++++++++++----
>  3 files changed, 83 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 54691bc..05fcbe5 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1678,6 +1678,12 @@ struct drm_i915_private {
>  		uint16_t spr_latency[5];
>  		/* cursor */
>  		uint16_t cur_latency[5];
> +		/*
> +		 * Raw watermark memory latency values
> +		 * for SKL for all 8 levels
> +		 * in 1us units.
> +		 */
> +		uint16_t skl_latency[8];
>  
>  		/* current hardware state */
>  		struct ilk_wm_values hw;
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index f32c624..3f469c8 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -5957,6 +5957,13 @@ enum punit_power_well {
>  #define   GEN6_PCODE_FREQ_IA_RATIO_SHIFT	8
>  #define   GEN6_PCODE_FREQ_RING_RATIO_SHIFT	16
>  
> +#define GEN9_PCODE_DATA1			0x13812C
> +#define   GEN9_PCODE_READ_MEM_LATENCY		0x6
> +#define   GEN9_MEM_LATENCY_LEVEL_MASK		0xFF
> +#define   GEN9_MEM_LATENCY_LEVEL_1_5_SHIFT	8
> +#define   GEN9_MEM_LATENCY_LEVEL_2_6_SHIFT	16
> +#define   GEN9_MEM_LATENCY_LEVEL_3_7_SHIFT	24
> +
>  #define GEN6_GT_CORE_STATUS		0x138060
>  #define   GEN6_CORE_CPD_STATE_MASK	(7<<4)
>  #define   GEN6_RCn_MASK			7
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 7a69eba..761c884 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -2271,11 +2271,56 @@ hsw_compute_linetime_wm(struct drm_device *dev, struct drm_crtc *crtc)
>  	       PIPE_WM_LINETIME_TIME(linetime);
>  }
>  
> -static void intel_read_wm_latency(struct drm_device *dev, uint16_t wm[5])
> +static void intel_read_wm_latency(struct drm_device *dev, uint16_t wm[8])

Imo we should split this into an ilk_read_wm_latency and a
skl_read_wm_latency function. It's big and all the callers seem to only
care about one or the other. Care for a follow-up patch?
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2014-11-05 10:25 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-04 17:06 [PATCH 00/28] SKL stage 1, a few more patches Damien Lespiau
2014-11-04 17:06 ` [PATCH 01/28] drm/i915/skl: Read the Memory Latency Values for WM computation Damien Lespiau
2014-11-05 10:25   ` Daniel Vetter [this message]
2014-11-05 10:29     ` Daniel Vetter
2014-11-04 17:06 ` [PATCH 02/28] drm/i915/skl: Register definitions and macros for SKL Watermark regs Damien Lespiau
2014-11-04 17:06 ` [PATCH 03/28] drm/i915/skl: Definition of SKL WM param structs for pipe/plane Damien Lespiau
2014-11-04 17:06 ` [PATCH 04/28] drm/i915/skl: Add DDB allocation management structures Damien Lespiau
2014-11-04 17:06 ` [PATCH 05/28] drm/i915/skl: SKL Watermark Computation Damien Lespiau
2014-11-04 17:06 ` [PATCH 06/28] drm/i915/skl: Allocate DDB portions for display planes Damien Lespiau
2014-11-04 17:06 ` [PATCH 07/28] drm/i915/skl: Program the DDB allocation Damien Lespiau
2014-11-04 17:06 ` [PATCH 08/28] drm/i915/skl: Read the pipe WM HW state Damien Lespiau
2014-11-04 17:06 ` [PATCH 09/28] drm/i915/gen9: Add 2us read latency to WM level Damien Lespiau
2014-11-04 17:06 ` [PATCH 10/28] drm/i915/gen9: Disable WM if corresponding latency is 0 Damien Lespiau
2014-11-04 17:06 ` [PATCH 11/28] drm/i915/skl: Store the new WM state at the very end of the update Damien Lespiau
2014-11-04 17:06 ` [PATCH 12/28] drm/i915/skl: Read back the DDB allocation hw state Damien Lespiau
2014-11-04 17:06 ` [PATCH 13/28] drm/i915/skl: Augment the latency debugfs files for SKL Damien Lespiau
2014-11-04 17:06 ` [PATCH 14/28] drm/i915/skl: Add a debugfs file to dump the DDB allocation Damien Lespiau
2014-11-04 17:06 ` [PATCH 15/28] drm/i915/skl: Check the DDB state at modeset Damien Lespiau
2014-11-05 10:33   ` Daniel Vetter
2014-11-04 17:06 ` [PATCH 16/28] drm/i915/skl: Make 'end' of the DDB allocation entry exclusive Damien Lespiau
2014-11-04 17:06 ` [PATCH 17/28] drm/i915/skl: Use a more descriptive parameter name in skl_compute_plane_wm() Damien Lespiau
2014-11-04 17:06 ` [PATCH 18/28] drm/i915/skl: Make res_blocks/lines intermediate values 32 bits Damien Lespiau
2014-11-04 17:06 ` [PATCH 19/28] drm/i915/skl: Reduce the number of holes in struct skl_wm_level Damien Lespiau
2014-11-04 17:06 ` [PATCH 20/28] drm/i915/skl: Move all the WM compute functions in one place Damien Lespiau
2014-11-04 17:06 ` [PATCH 21/28] drm/i915/skl: Rework when the transition WMs are computed Damien Lespiau
2014-11-04 17:06 ` [PATCH 22/28] drm/i915/skl: Correctly align skl_compute_plane_wm() arguments Damien Lespiau
2014-11-04 17:07 ` [PATCH 23/28] drm/i915/skl: Reduce the indentation level in skl_write_wm_values() Damien Lespiau
2014-11-04 17:07 ` [PATCH 24/28] drm/i915/skl: Stage the pipe DDB allocation Damien Lespiau
2014-11-04 17:07 ` [PATCH 25/28] drm/i915/skl: Flush the WM configuration Damien Lespiau
2014-11-04 17:07 ` [PATCH 26/28] drm/i915/skl: Log the order in which we flush the pipes in the WM code Damien Lespiau
2014-11-04 17:07 ` [PATCH 27/28] drm/i915/skl: Gen9 Forcewake Damien Lespiau
2014-11-04 17:07 ` [PATCH 28/28] drm/i915/skl: Enable Gen9 RC6 Damien Lespiau
2014-11-05 11:28 ` [PATCH 00/28] SKL stage 1, a few more patches Daniel Vetter

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=20141105102551.GC26941@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=damien.lespiau@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=pradeep.bhat@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