From: Imre Deak <imre.deak@intel.com>
To: Paulo Zanoni <przanoni@gmail.com>
Cc: intel-gfx@lists.freedesktop.org, Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: Re: [PATCH 04/19] drm/i915: extract __hsw_do_{en, dis}able_package_c8
Date: Thu, 27 Feb 2014 16:49:23 +0200 [thread overview]
Message-ID: <1393512563.3479.4.camel@intelbox> (raw)
In-Reply-To: <1387461309-2756-5-git-send-email-przanoni@gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 3941 bytes --]
On Thu, 2013-12-19 at 11:54 -0200, Paulo Zanoni wrote:
> From: Paulo Zanoni <paulo.r.zanoni@intel.com>
>
> When we merge PC8 and runtime PM, these new functions are going to be
> called by the runtime suspend/resume functions, and their callers are
> going to be removed.
>
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
> ---
> drivers/gpu/drm/i915/intel_display.c | 64 +++++++++++++++++++++---------------
> 1 file changed, 38 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index c661423..db6523e 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -6638,19 +6638,11 @@ static void hsw_restore_lcpll(struct drm_i915_private *dev_priv)
> gen6_gt_force_wake_put(dev_priv, FORCEWAKE_ALL);
> }
>
> -void hsw_enable_pc8_work(struct work_struct *__work)
> +static void __hsw_do_enable_pc8(struct drm_i915_private *dev_priv)
> {
> - struct drm_i915_private *dev_priv =
> - container_of(to_delayed_work(__work), struct drm_i915_private,
> - pc8.enable_work);
> struct drm_device *dev = dev_priv->dev;
> uint32_t val;
>
> - WARN_ON(!HAS_PC8(dev));
> -
> - if (dev_priv->pc8.enabled)
> - return;
> -
> DRM_DEBUG_KMS("Enabling package C8+\n");
>
> dev_priv->pc8.enabled = true;
> @@ -6664,7 +6656,21 @@ void hsw_enable_pc8_work(struct work_struct *__work)
> lpt_disable_clkout_dp(dev);
> hsw_pc8_disable_interrupts(dev);
> hsw_disable_lcpll(dev_priv, true, true);
> +}
> +
> +void hsw_enable_pc8_work(struct work_struct *__work)
> +{
> + struct drm_i915_private *dev_priv =
> + container_of(to_delayed_work(__work), struct drm_i915_private,
> + pc8.enable_work);
> + struct drm_device *dev = dev_priv->dev;
> +
> + WARN_ON(!HAS_PC8(dev));
>
> + if (dev_priv->pc8.enabled)
> + return;
> +
> + __hsw_do_enable_pc8(dev_priv);
> intel_runtime_pm_put(dev_priv);
> }
>
> @@ -6682,29 +6688,13 @@ static void __hsw_enable_package_c8(struct drm_i915_private *dev_priv)
> msecs_to_jiffies(i915_pc8_timeout));
> }
>
> -static void __hsw_disable_package_c8(struct drm_i915_private *dev_priv)
> +static void __hsw_do_disable_package_c8(struct drm_i915_private *dev_priv)
> {
> struct drm_device *dev = dev_priv->dev;
> uint32_t val;
>
> - WARN_ON(!mutex_is_locked(&dev_priv->pc8.lock));
> - WARN(dev_priv->pc8.disable_count < 0,
> - "pc8.disable_count: %d\n", dev_priv->pc8.disable_count);
> -
> - dev_priv->pc8.disable_count++;
> - if (dev_priv->pc8.disable_count != 1)
> - return;
> -
> - WARN_ON(!HAS_PC8(dev));
> -
> - cancel_delayed_work_sync(&dev_priv->pc8.enable_work);
> - if (!dev_priv->pc8.enabled)
> - return;
> -
> DRM_DEBUG_KMS("Disabling package C8+\n");
>
> - intel_runtime_pm_get(dev_priv);
> -
> hsw_restore_lcpll(dev_priv);
> hsw_pc8_restore_interrupts(dev);
> lpt_init_pch_refclk(dev);
> @@ -6723,6 +6713,28 @@ static void __hsw_disable_package_c8(struct drm_i915_private *dev_priv)
> dev_priv->pc8.enabled = false;
> }
>
> +static void __hsw_disable_package_c8(struct drm_i915_private *dev_priv)
> +{
> + struct drm_device *dev = dev_priv->dev;
> +
> + WARN_ON(!mutex_is_locked(&dev_priv->pc8.lock));
> + WARN(dev_priv->pc8.disable_count < 0,
> + "pc8.disable_count: %d\n", dev_priv->pc8.disable_count);
> +
> + dev_priv->pc8.disable_count++;
> + if (dev_priv->pc8.disable_count != 1)
> + return;
> +
> + WARN_ON(!HAS_PC8(dev));
> +
> + cancel_delayed_work_sync(&dev_priv->pc8.enable_work);
> + if (!dev_priv->pc8.enabled)
> + return;
> +
> + intel_runtime_pm_get(dev_priv);
> + __hsw_do_disable_package_c8(dev_priv);
> +}
> +
> void hsw_enable_package_c8(struct drm_i915_private *dev_priv)
> {
> if (!HAS_PC8(dev_priv->dev))
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2014-02-27 14:49 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-19 13:54 [PATCH 00/19] Make PC8 become part of runtime PM Paulo Zanoni
2013-12-19 13:54 ` [PATCH 01/19] drm/i915: rename modeset_update_power_wells Paulo Zanoni
2014-02-27 13:44 ` Imre Deak
2013-12-19 13:54 ` [PATCH 02/19] drm/i915: get/put runtime PM without holding rps.hw_lock Paulo Zanoni
2013-12-19 18:30 ` Jesse Barnes
2013-12-19 21:20 ` Daniel Vetter
2013-12-19 21:31 ` Paulo Zanoni
2014-02-27 13:45 ` Imre Deak
2013-12-19 13:54 ` [PATCH 03/19] drm/i915: add forcewake functions that don't touch runtime PM Paulo Zanoni
2014-02-27 14:43 ` Imre Deak
2014-02-27 14:48 ` Paulo Zanoni
2014-02-27 15:24 ` Imre Deak
2014-03-04 14:18 ` Daniel Vetter
2013-12-19 13:54 ` [PATCH 04/19] drm/i915: extract __hsw_do_{en, dis}able_package_c8 Paulo Zanoni
2014-02-27 14:49 ` Imre Deak [this message]
2013-12-19 13:54 ` [PATCH 05/19] drm/i915: make PC8 be part of runtime PM suspend/resume Paulo Zanoni
2013-12-19 13:54 ` [PATCH 06/19] drm/i915: get/put runtime PM when we get/put a power domain Paulo Zanoni
2014-01-24 19:58 ` Paulo Zanoni
2013-12-19 13:54 ` [PATCH 07/19] drm/i915: remove dev_priv->pc8.requirements_met Paulo Zanoni
2013-12-19 13:54 ` [PATCH 08/19] drm/i915: make gpu_idle be part of runtime PM, not PC8 Paulo Zanoni
2013-12-19 13:54 ` [PATCH 09/19] drm/i915: kill pc8.disable_count Paulo Zanoni
2013-12-19 13:55 ` [PATCH 10/19] drm/i915: remove an indirection level on PC8 functions Paulo Zanoni
2013-12-19 13:55 ` [PATCH 11/19] drm/i915: don't get/put PC8 reference on freeze/thaw Paulo Zanoni
2013-12-19 13:55 ` [PATCH 12/19] drm/i915: get/put runtime PM references for GMBUS and DP AUX Paulo Zanoni
2013-12-19 13:55 ` [PATCH 13/19] drm/i915: don't get/put PC8 when getting/putting power wells Paulo Zanoni
2013-12-19 13:55 ` [PATCH 14/19] drm/i915: remove dev_priv->pc8.enabled Paulo Zanoni
2013-12-19 13:55 ` [PATCH 15/19] drm/i915: move pc8.irqs_disabled to pm.irqs_disabled Paulo Zanoni
2013-12-19 13:55 ` [PATCH 16/19] drm/i915: kill struct i915_package_c8 Paulo Zanoni
2013-12-19 13:55 ` [PATCH 17/19] drm/i915: rename __hsw_do_{en, dis}able_pc8 Paulo Zanoni
2013-12-19 13:55 ` [PATCH 18/19] drm/i915: update the PC8 and runtime PM documentation Paulo Zanoni
2013-12-19 13:55 ` [PATCH 19/19] drm/i915: init pm.suspended earlier Paulo Zanoni
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=1393512563.3479.4.camel@intelbox \
--to=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=paulo.r.zanoni@intel.com \
--cc=przanoni@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