From: Imre Deak <imre.deak@intel.com>
To: Animesh Manna <animesh.manna@intel.com>
Cc: Suketu Shah <suketu.j.shah@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 7/8] drm/i915/skl: Assert the requirements to enter or exit DC6.
Date: Thu, 02 Apr 2015 23:49:09 +0300 [thread overview]
Message-ID: <1428007749.8235.71.camel@ideak-mobl> (raw)
In-Reply-To: <1427885547-8834-7-git-send-email-animesh.manna@intel.com>
On Wed, 2015-04-01 at 16:22 +0530, Animesh Manna wrote:
> From: Suketu Shah <suketu.j.shah@intel.com>
>
> Warn if the conditions to enter or exit DC6 are not satisfied such
> as support for runtime PM, state of power well, CSR loading etc.
>
> v2: Removed camelcase in functions and variables.
>
> v3: Do some minimal check to assert if CSR program is not loaded.
>
> v4:
> 1] Correct the check for backlight-disabling in assert_can_enable_dc6().
> 2] Check csr.loaded = false before disabling DC6 and simplify other checks.
>
> v5:
> 1] Remove checks for DC5 state from assert_can_enable_dc6 function as DC5 is no
> longer enabled before enabling DC6.
> 2] Correct the check for CSR-loading in assert_can_disable_dc6 function as CSR must
> be loaded for context restore to happen on DC6 disabling.
>
> v6:
> 1] It's okay to explicitly disable DC6 during driver-load/resume even though it might
> already be disabled and so don't warn about it.
>
> v7: Rebase to latest.
>
> v8: Sqashed the patch from Imre -
> [PATCH] drm/i915/skl: avoid false CSR fw not loaded WARN during driver load/resume
>
> v9: After adding dmc ver 1.0 support rebased on top of nightly. (Animesh)
>
> Issue: VIZ-2819
> Signed-off-by: A.Sunil Kamath <sunil.kamath@intel.com>
> Signed-off-by: Suketu Shah <suketu.j.shah@intel.com>
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> Signed-off-by: Animesh Manna <animesh.manna@intel.com>
> ---
> drivers/gpu/drm/i915/intel_runtime_pm.c | 38 +++++++++++++++++++++++++++------
> 1 file changed, 32 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
> index cc94503..9196de3 100644
> --- a/drivers/gpu/drm/i915/intel_runtime_pm.c
> +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
> @@ -1,5 +1,5 @@
> -/*
> - * Copyright © 2012-2014 Intel Corporation
> + /*
> + * Cipyright © 2012-2014 Intel Corporation
Unintentional change.
> *
> * Permission is hereby granted, free of charge, to any person obtaining a
> * copy of this software and associated documentation files (the "Software"),
> @@ -408,12 +408,39 @@ static void gen9_disable_dc5(struct drm_i915_private *dev_priv)
> POSTING_READ(DC_STATE_EN);
> }
>
> -static void skl_enable_dc6(struct drm_i915_private *dev_priv)
> +static void assert_can_enable_dc6(struct drm_i915_private *dev_priv)
> {
> struct drm_device *dev = dev_priv->dev;
> +
> + WARN(!IS_SKYLAKE(dev), "Platform doesn't support DC6.\n");
> + WARN(!HAS_RUNTIME_PM(dev), "Runtime PM not enabled.\n");
> + WARN(I915_READ(UTIL_PIN_CTL) & UTIL_PIN_ENABLE,
> + "Backlight is not disabled.\n");
> + WARN((I915_READ(DC_STATE_EN) & DC_STATE_EN_UPTO_DC6),
> + "DC6 already programmed to be enabled.\n");
> +
> + assert_csr_loaded(dev_priv);
> +}
> +
> +static void assert_can_disable_dc6(struct drm_i915_private *dev_priv)
> +{
> + /*
> + * During initialization, the firmware may not be loaded yet.
> + * We still want to make sure that the DC enabling flag is cleared.
> + */
> + if (dev_priv->power_domains.initializing)
> + return;
I missed this earlier, but this early return should also be added to
assert_can_disable_dc5().
With the above fixed:
Reviewed-by: Imre Deak <imre.deak@intel.com>
> +
> + assert_csr_loaded(dev_priv);
> + WARN(!(I915_READ(DC_STATE_EN) & DC_STATE_EN_UPTO_DC6),
> + "DC6 already programmed to be disabled.\n");
> +}
> +
> +static void skl_enable_dc6(struct drm_i915_private *dev_priv)
> +{
> uint32_t val;
>
> - WARN_ON(!IS_SKYLAKE(dev));
> + assert_can_enable_dc6(dev_priv);
>
> DRM_DEBUG_KMS("Enabling DC6\n");
>
> @@ -428,10 +455,9 @@ static void skl_enable_dc6(struct drm_i915_private *dev_priv)
>
> static void skl_disable_dc6(struct drm_i915_private *dev_priv)
> {
> - struct drm_device *dev = dev_priv->dev;
> uint32_t val;
>
> - WARN_ON(!IS_SKYLAKE(dev));
> + assert_can_disable_dc6(dev_priv);
>
> DRM_DEBUG_KMS("Disabling DC6\n");
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-04-02 20:49 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-01 10:49 [PATCH 0/8] Enable DC states for skl Animesh Manna
2015-04-01 10:52 ` [PATCH 1/8] drm/i915/skl: Add support to load SKL CSR firmware Animesh Manna
2015-04-01 10:52 ` [PATCH 2/8] drm/i915/skl: Implement enable/disable for Display C5 sttate Animesh Manna
2015-04-02 15:58 ` Imre Deak
2015-04-13 13:17 ` Damien Lespiau
2015-04-13 13:51 ` Imre Deak
2015-04-14 11:50 ` Daniel Vetter
2015-04-01 10:52 ` [PATCH 3/8] drm/i915/skl: Add DC5 Trigger Sequence Animesh Manna
2015-04-02 19:33 ` Imre Deak
2015-04-10 15:11 ` [PATCH v2 " Animesh Manna
2015-04-13 10:26 ` [PATCH v3 " Animesh Manna
2015-04-13 11:33 ` Imre Deak
2015-04-13 17:41 ` Damien Lespiau
2015-04-13 15:25 ` Damien Lespiau
2015-04-13 17:49 ` Damien Lespiau
2015-04-01 10:52 ` [PATCH 4/8] drm/i915/skl: Assert the requirements to enter or exit DC5 Animesh Manna
2015-04-02 20:17 ` Imre Deak
2015-04-10 15:11 ` [PATCH v2 " Animesh Manna
2015-04-13 12:46 ` Imre Deak
2015-04-01 10:52 ` [PATCH 5/8] drm/i915/skl: Implement enable/disable for Display C6 state Animesh Manna
2015-04-02 20:20 ` Imre Deak
2015-04-01 10:52 ` [PATCH 6/8] drm/i915/skl: Add DC6 Trigger sequence Animesh Manna
2015-04-02 20:42 ` Imre Deak
2015-04-10 15:11 ` [PATCH v2 " Animesh Manna
2015-04-13 12:50 ` Imre Deak
2015-04-01 10:52 ` [PATCH 7/8] drm/i915/skl: Assert the requirements to enter or exit DC6 Animesh Manna
2015-04-02 20:49 ` Imre Deak [this message]
2015-04-10 15:12 ` [PATCH v2 " Animesh Manna
2015-04-01 10:52 ` [PATCH 8/8] drm/i915/skl: Enable runtime PM Animesh Manna
2015-04-02 20:49 ` Imre Deak
2015-04-02 15:21 ` [PATCH 1/8] drm/i915/skl: Add support to load SKL CSR firmware Imre Deak
2015-04-10 15:11 ` [PATCH v2 " Animesh Manna
2015-04-13 10:24 ` [PATCH v3 " Animesh Manna
2015-04-13 11:03 ` Imre Deak
2015-04-13 13:07 ` Animesh Manna
2015-04-13 12:37 ` Imre Deak
2015-04-13 16:34 ` Damien Lespiau
2015-04-13 16:52 ` Imre Deak
2015-04-13 17:02 ` Damien Lespiau
2015-04-13 17:15 ` Imre Deak
2015-04-13 17:22 ` Damien Lespiau
2015-04-14 9:16 ` Animesh Manna
2015-04-14 10:07 ` Damien Lespiau
[not found] ` <20804_1428943986_552BF472_20804_13643_1_1428943974.12269.9.camel@ideak-mobl>
2015-04-13 19:00 ` ns2501 DVO - success at last Thomas Richter
2015-04-14 17:21 ` Daniel Vetter
2015-04-10 15:10 ` [PATCH v2 0/8] Enable DC states for skl Animesh Manna
-- strict thread matches above, loose matches on Subject: below --
2015-04-01 7:49 [PATCH 7/8] drm/i915/skl: Assert the requirements to enter or exit DC6 Animesh Manna
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=1428007749.8235.71.camel@ideak-mobl \
--to=imre.deak@intel.com \
--cc=animesh.manna@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=suketu.j.shah@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.