public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Damien Lespiau <damien.lespiau@intel.com>
To: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Cc: intel-gfx@lists.freedesktop.org, Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: Re: [PATCH 08/19] drm/i915: write D_COMP using the mailbox
Date: Thu, 19 Sep 2013 10:58:36 +0100	[thread overview]
Message-ID: <20130919095835.GA11569@strange.amr.corp.intel.com> (raw)
In-Reply-To: <1378852608-30281-9-git-send-email-rodrigo.vivi@gmail.com>

On Tue, Sep 10, 2013 at 07:36:37PM -0300, Rodrigo Vivi wrote:
> From: Paulo Zanoni <paulo.r.zanoni@intel.com>
> 
> You can't write it using the MCHBAR mirror, the write will just get
> dropped.
> 
> This should make us BSpec-compliant, but there's no real bug I could
> reproduce that is fixed by this patch.
> 
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>

With or without the 'from' typo fixed (can be fixed later, amended
while applying):

Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>

> ---
>  drivers/gpu/drm/i915/i915_reg.h      |  4 ++++
>  drivers/gpu/drm/i915/intel_display.c | 10 ++++++++--
>  2 files changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index bcee89b..ff60945 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -1441,6 +1441,8 @@
>   * device 0 function 0's pci config register 0x44 or 0x48 and matches it in
>   * every way.  It is not accessible from the CP register read instructions.
>   *
> + * Starting form Haswell, you can't write registers using the MCHBAR mirror,

'from'

> + * just read.
>   */
>  #define MCHBAR_MIRROR_BASE	0x10000
>  
> @@ -4723,6 +4725,8 @@
>  #define   GEN6_PCODE_READ_MIN_FREQ_TABLE	0x9
>  #define	  GEN6_PCODE_WRITE_RC6VIDS		0x4
>  #define	  GEN6_PCODE_READ_RC6VIDS		0x5
> +#define   GEN6_PCODE_READ_D_COMP		0x10
> +#define   GEN6_PCODE_WRITE_D_COMP		0x11
>  #define   GEN6_ENCODE_RC6_VID(mv)		(((mv) - 245) / 5)
>  #define   GEN6_DECODE_RC6_VID(vids)		(((vids) * 5) + 245)
>  #define GEN6_PCODE_DATA				0x138128
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 882da0e..3098465 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -6019,7 +6019,10 @@ void hsw_disable_lcpll(struct drm_i915_private *dev_priv,
>  
>  	val = I915_READ(D_COMP);
>  	val |= D_COMP_COMP_DISABLE;
> -	I915_WRITE(D_COMP, val);
> +	mutex_lock(&dev_priv->rps.hw_lock);
> +	if (sandybridge_pcode_write(dev_priv, GEN6_PCODE_WRITE_D_COMP, val))
> +		DRM_ERROR("Failed to disable D_COMP\n");
> +	mutex_unlock(&dev_priv->rps.hw_lock);
>  	POSTING_READ(D_COMP);
>  	ndelay(100);
>  
> @@ -6061,7 +6064,10 @@ void hsw_restore_lcpll(struct drm_i915_private *dev_priv)
>  	val = I915_READ(D_COMP);
>  	val |= D_COMP_COMP_FORCE;
>  	val &= ~D_COMP_COMP_DISABLE;
> -	I915_WRITE(D_COMP, val);
> +	mutex_lock(&dev_priv->rps.hw_lock);
> +	if (sandybridge_pcode_write(dev_priv, GEN6_PCODE_WRITE_D_COMP, val))
> +		DRM_ERROR("Failed to enable D_COMP\n");
> +	mutex_unlock(&dev_priv->rps.hw_lock);
>  	POSTING_READ(D_COMP);
>  
>  	val = I915_READ(LCPLL_CTL);
> -- 
> 1.8.1.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2013-09-19  9:59 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-10 22:36 [PATCH 00/19] drm-intel-collector push simple patches for review Rodrigo Vivi
2013-09-10 22:36 ` [PATCH 01/19] drm/i915: check that the i965g/gm 4G limit is really obeyed Rodrigo Vivi
2013-09-10 22:36 ` [PATCH 02/19] drm/i915: Cancel outstanding modeset workers before suspend Rodrigo Vivi
2013-09-10 22:36 ` [PATCH 03/19] drm/i915: Move the conditional seqno query into the tracepoint Rodrigo Vivi
2013-09-10 22:36 ` [PATCH 04/19] drm/i915: Add some missing steps to i915_driver_load error path Rodrigo Vivi
2013-09-10 22:36 ` [PATCH 05/19] drm/i915: Asynchronously perform the set-base for a simple modeset Rodrigo Vivi
2013-09-10 22:36 ` [PATCH 06/19] drm/i915: Align tiled scanouts from stolen memory to 256k in the GTT Rodrigo Vivi
2013-09-10 22:36 ` [PATCH 07/19] drm/i915: Pair seqno completion tracepoint with its dispatch Rodrigo Vivi
2013-09-10 22:36 ` [PATCH 08/19] drm/i915: write D_COMP using the mailbox Rodrigo Vivi
2013-09-19  9:58   ` Damien Lespiau [this message]
2013-09-19 12:11     ` Daniel Vetter
2013-09-10 22:36 ` [PATCH 09/19] drm/i915: Initialise min/max frequencies before updating RPS registers Rodrigo Vivi
2013-09-10 22:36 ` [PATCH 10/19] drm/i915: Delay the relase of the forcewake by a jiffie Rodrigo Vivi
2013-09-10 22:36 ` [PATCH 11/19] drm/i915: Add a tracepoint for using a semaphore Rodrigo Vivi
2013-09-10 22:36 ` [PATCH 12/19] drm/i915: Write RING_TAIL once per-request Rodrigo Vivi
2013-09-10 22:36 ` [PATCH 13/19] drm/i915: Boost RPS frequency for CPU stalls Rodrigo Vivi
2013-09-10 22:53   ` Chris Wilson
2013-09-10 22:36 ` [PATCH 14/19] drm/i915: Tweak RPS thresholds to more aggressively downclock Rodrigo Vivi
2013-09-10 22:36 ` [PATCH 15/19] drm/i915: i915.quirks_set/quirks_mask overrides dmi match Rodrigo Vivi
2013-09-11  8:21   ` [Intel-gfx] " Jani Nikula
2013-09-17 16:42     ` Kamal Mostafa
2013-09-19 12:10       ` Jani Nikula
2013-09-10 22:36 ` [PATCH 16/19] drm/i915: Fix l3 parity buffer offset Rodrigo Vivi
2013-09-11 11:45   ` Ville Syrjälä
2013-09-11 17:07     ` Ben Widawsky
2013-09-11 17:44       ` Ville Syrjälä
2013-09-11 17:59         ` Ben Widawsky
2013-09-10 22:36 ` [PATCH 17/19] drm/i915: Fix HSW parity test Rodrigo Vivi
2013-09-10 22:36 ` [PATCH 18/19] drm/i915: Allow GT3 Slice Shutdown on Boot Rodrigo Vivi
2013-09-10 22:36 ` [PATCH 19/19] drm/i915: Allow Dynamically GT3 Slice Shutdown Rodrigo Vivi

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=20130919095835.GA11569@strange.amr.corp.intel.com \
    --to=damien.lespiau@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=paulo.r.zanoni@intel.com \
    --cc=rodrigo.vivi@gmail.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