All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: imre.deak@intel.com, intel-gfx@lists.freedesktop.org
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH 2/4] drm/i915/gen9: Verify and enforce dc6 state writes
Date: Thu, 18 Feb 2016 17:52:08 +0200	[thread overview]
Message-ID: <8760xmow2f.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <1455810172.7638.11.camel@intel.com>

Imre Deak <imre.deak@intel.com> writes:

> On to, 2016-02-18 at 17:21 +0200, Mika Kuoppala wrote:
>> It has been observed that sometimes disabling the dc6 fails
>> and dc6 state pops back up, brief moment after disabling. This
>> has to be dmc save/restore timing issue or other bug in the
>> way dc states are handled.
>> 
>> Try to work around this issue as we don't have firmware fix
>> yet available. Verify that the value we wrote for the dmc sticks,
>> and also enforce it by rewriting it, if it didn't.
>> 
>> Testcase: kms_flip/basic-flip-vs-dpms
>> References: https://bugs.freedesktop.org/show_bug.cgi?id=93768
>> Cc: Patrik Jakobsson <patrik.jakobsson@linux.intel.com>
>> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
>> Cc: Imre Deak <imre.deak@intel.com>
>> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
>> ---
>>  drivers/gpu/drm/i915/intel_runtime_pm.c | 40
>> +++++++++++++++++++++++++++++++--
>>  1 file changed, 38 insertions(+), 2 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c
>> b/drivers/gpu/drm/i915/intel_runtime_pm.c
>> index 8b9290fdb3b2..cb91540cfbad 100644
>> --- a/drivers/gpu/drm/i915/intel_runtime_pm.c
>> +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
>> @@ -470,6 +470,42 @@ static void
>> gen9_set_dc_state_debugmask_memory_up(
>>  	}
>>  }
>>  
>> +static void gen9_write_dc_state(struct drm_i915_private *dev_priv,
>> +				u32 state)
>> +{
>> +	int rewrites = 0;
>> +	int rereads = 0;
>> +	u32 v;
>> +
>> +	I915_WRITE(DC_STATE_EN, state);
>> +
>> +	/* It has been observed that disabling the dc6 state
>> sometimes
>> +	 * doesn't stick and dmc keeps returning old value. Make
>> sure
>> +	 * the write really sticks enough times and also force
>> rewrite until
>> +	 * we are confident that state is exactly what we want.
>> +	 */
>> +	do  {
>> +		v = I915_READ(DC_STATE_EN);
>> +
>> +		if (v != state) {
>> +			I915_WRITE(DC_STATE_EN, state);
>> +			rewrites++;
>
> Could be rereads = 0; for extra paranoia. Either way:

Oh yes, extra paranoia in here is warranted. I will
add that.

> Reviewed-by: Imre Deak <imre.deak@intel.com>

Thanks,
-Mika

>
>> +		} else if (rereads++ > 5) {
>> +			break;
>> +		}
>> +
>> +	} while (rewrites < 100);
>> +
>> +	if (v != state)
>> +		DRM_ERROR("Writing dc state to 0x%x failed, now
>> 0x%x\n",
>> +			  state, v);
>> +
>> +	/* Most of the times we need one retry, avoid spam */
>> +	if (rewrites > 1)
>> +		DRM_DEBUG_KMS("Rewrote dc state to 0x%x %d times\n",
>> +			      state, rewrites);
>> +}
>> +
>>  static void gen9_set_dc_state(struct drm_i915_private *dev_priv,
>> uint32_t state)
>>  {
>>  	uint32_t val;
>> @@ -502,8 +538,8 @@ static void gen9_set_dc_state(struct
>> drm_i915_private *dev_priv, uint32_t state)
>>  
>>  	val &= ~mask;
>>  	val |= state;
>> -	I915_WRITE(DC_STATE_EN, val);
>> -	POSTING_READ(DC_STATE_EN);
>> +
>> +	gen9_write_dc_state(dev_priv, val);
>>  
>>  	dev_priv->csr.dc_state = val & mask;
>>  }
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-02-18 15:53 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-18 15:21 [PATCH 0/4] gen9 dmc state harderning Mika Kuoppala
2016-02-18 15:21 ` [PATCH 1/4] drm/i915/gen9: Check for DC state mismatch Mika Kuoppala
2016-02-18 15:21 ` [PATCH 2/4] drm/i915/gen9: Verify and enforce dc6 state writes Mika Kuoppala
2016-02-18 15:42   ` Imre Deak
2016-02-18 15:52     ` Mika Kuoppala [this message]
2016-02-18 15:58   ` Mika Kuoppala
2016-02-18 15:21 ` [PATCH 3/4] drm/i915/gen9: Extend dmc debug mask to include cores Mika Kuoppala
2016-02-18 15:34   ` Imre Deak
2016-02-18 23:43     ` Runyan, Arthur J
2016-02-19 10:26   ` Mika Kuoppala
2016-02-19 10:34     ` Imre Deak
2016-02-18 15:21 ` [PATCH 4/4] drm/i915/gen9: Write dc state debugmask bits only once Mika Kuoppala
2016-02-18 15:46   ` Imre Deak
2016-02-19 11:35 ` ✗ Fi.CI.BAT: failure for gen9 dmc state harderning (rev3) Patchwork
2016-02-22 15:13   ` Imre Deak
2016-02-22 15:26     ` Imre Deak
2016-02-19 13:29 ` ✗ Fi.CI.BAT: failure for gen9 dmc state harderning (rev2) 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=8760xmow2f.fsf@gaia.fi.intel.com \
    --to=mika.kuoppala@linux.intel.com \
    --cc=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=rodrigo.vivi@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.