From: Ander Conselvan De Oliveira <conselvan2@gmail.com>
To: Imre Deak <imre.deak@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2 4/5] drm/i915: Preserve the state of power wells not explicitly enabled
Date: Mon, 20 Feb 2017 11:28:02 +0200 [thread overview]
Message-ID: <1487582882.4385.4.camel@gmail.com> (raw)
In-Reply-To: <1487345986-26511-5-git-send-email-imre.deak@intel.com>
On Fri, 2017-02-17 at 17:39 +0200, Imre Deak wrote:
> Atm, power wells that BIOS has enabled, but which we don't explicitly
> enable during power domain initialization would get disabled as we clear
> the BIOS request bit in the given power well sync_hw hook. To prevent
> this copy over any set request bits in the BIOS request register to the
> driver request register and clear the BIOS request bit only afterwards.
>
> This doesn't make a difference now, since we enable all power wells
> during power domain initialization. A follow-up patchset will add power
> wells for which this isn't true, so fix up the inconsistency.
>
> Cc: Ander Conselvan de Oliveira <conselvan2@gmail.com>
> Cc: David Weinehall <david.weinehall@linux.intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
> ---
> drivers/gpu/drm/i915/intel_runtime_pm.c | 18 ++++++++++++------
> 1 file changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
> index 62c99a9..44d4da3 100644
> --- a/drivers/gpu/drm/i915/intel_runtime_pm.c
> +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
> @@ -830,12 +830,14 @@ static void skl_set_power_well(struct drm_i915_private *dev_priv,
> static void hsw_power_well_sync_hw(struct drm_i915_private *dev_priv,
> struct i915_power_well *power_well)
> {
> - /*
> - * We're taking over the BIOS, so clear any requests made by it since
> - * the driver is in charge now.
> - */
> - if (I915_READ(HSW_PWR_WELL_BIOS) & HSW_PWR_WELL_ENABLE_REQUEST)
> + /* Take over the request bit if set by BIOS. */
> + if (I915_READ(HSW_PWR_WELL_BIOS) & HSW_PWR_WELL_ENABLE_REQUEST) {
> + if (!(I915_READ(HSW_PWR_WELL_DRIVER) &
> + HSW_PWR_WELL_ENABLE_REQUEST))
> + I915_WRITE(HSW_PWR_WELL_DRIVER,
> + HSW_PWR_WELL_ENABLE_REQUEST);
> I915_WRITE(HSW_PWR_WELL_BIOS, 0);
> + }
> }
>
> static void hsw_power_well_enable(struct drm_i915_private *dev_priv,
> @@ -865,8 +867,12 @@ static void skl_power_well_sync_hw(struct drm_i915_private *dev_priv,
> uint32_t mask = SKL_POWER_WELL_REQ(power_well->id);
> uint32_t bios_req = I915_READ(HSW_PWR_WELL_BIOS);
>
> - /* Clear any request made by BIOS as driver is taking over */
> + /* Take over the request bit if set by BIOS. */
> if (bios_req & mask) {
> + uint32_t drv_req = I915_READ(HSW_PWR_WELL_DRIVER);
> +
> + if (!(drv_req & mask))
> + I915_WRITE(HSW_PWR_WELL_DRIVER, drv_req | mask);
> I915_WRITE(HSW_PWR_WELL_BIOS, bios_req & ~mask);
> }
> }
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-02-20 9:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-17 15:39 [PATCH v2 0/5] drm/i915: Fix clearing of BIOS power well requests Imre Deak
2017-02-17 15:39 ` [PATCH v2 1/5] drm/i915: Remove redundant toggling from the power well sync_hw hooks Imre Deak
2017-02-17 15:39 ` [PATCH v2 2/5] drm/i915: Call the sync_hw hook for power wells without a domain Imre Deak
2017-02-20 8:55 ` Ander Conselvan De Oliveira
2017-02-17 15:39 ` [PATCH v2 3/5] drm/i915/gen9: Fix clearing of the BIOS power well request register Imre Deak
2017-02-17 15:39 ` [PATCH v2 4/5] drm/i915: Preserve the state of power wells not explicitly enabled Imre Deak
2017-02-20 9:28 ` Ander Conselvan De Oliveira [this message]
2017-02-17 15:39 ` [PATCH v2 5/5] drm/i915: Add power well SW/HW state verification Imre Deak
2017-02-20 9:32 ` Ander Conselvan De Oliveira
2017-02-17 19:52 ` ✓ Fi.CI.BAT: success for drm/i915: Fix clearing of BIOS power well requests (rev2) Patchwork
2017-02-20 12:57 ` Imre Deak
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=1487582882.4385.4.camel@gmail.com \
--to=conselvan2@gmail.com \
--cc=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/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;
as well as URLs for NNTP newsgroup(s).