From: Imre Deak <imre.deak@intel.com>
To: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: intel-gfx@lists.freedesktop.org, kristen@linux.intel.com
Subject: Re: [PATCH 3/4] drm/i915: send proper opregion notifications on suspend/resume
Date: Fri, 30 May 2014 16:47:13 +0300 [thread overview]
Message-ID: <1401457633.24060.55.camel@intelbox> (raw)
In-Reply-To: <1401397897-4655-3-git-send-email-jbarnes@virtuousgeek.org>
[-- Attachment #1.1: Type: text/plain, Size: 2491 bytes --]
On Thu, 2014-05-29 at 14:11 -0700, Jesse Barnes wrote:
> From: Kristen Carlson Accardi <kristen@linux.intel.com>
>
> This indicates to the firmware that it can power down various other
> components or bring them back up, depending on the target system state.
>
> Signed-off-by: Kristen Carlson Accardi <kristen@linux.intel.com>
> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
> ---
> drivers/acpi/sleep.c | 1 +
> drivers/gpu/drm/i915/i915_drv.c | 10 ++++++++++
> 2 files changed, 11 insertions(+)
>
> diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
> index c40fb2e..807f333 100644
> --- a/drivers/acpi/sleep.c
> +++ b/drivers/acpi/sleep.c
> @@ -89,6 +89,7 @@ u32 acpi_target_system_state(void)
> {
> return acpi_target_sleep_state;
> }
> +EXPORT_SYMBOL(acpi_target_system_state);
>
> static bool pwr_btn_event_pending;
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 433bdfa..b6211d7 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -28,6 +28,7 @@
> */
>
> #include <linux/device.h>
> +#include <linux/acpi.h>
> #include <drm/drmP.h>
> #include <drm/i915_drm.h>
> #include "i915_drv.h"
> @@ -491,6 +492,7 @@ static int i915_drm_freeze(struct drm_device *dev)
> {
> struct drm_i915_private *dev_priv = dev->dev_private;
> struct drm_crtc *crtc;
> + pci_power_t opregion_target_state;
>
> intel_runtime_pm_get(dev_priv);
>
> @@ -540,6 +542,12 @@ static int i915_drm_freeze(struct drm_device *dev)
>
> i915_save_state(dev);
>
> + if (acpi_target_system_state() >= ACPI_STATE_S3)
> + opregion_target_state = PCI_D3cold;
> + else
> + opregion_target_state = PCI_D1;
> + intel_opregion_notify_adapter(dev, opregion_target_state);
> +
> intel_opregion_fini(dev);
>
> console_lock();
> @@ -671,6 +679,8 @@ static int __i915_drm_thaw(struct drm_device *dev, bool restore_gtt_mappings)
> dev_priv->modeset_restore = MODESET_DONE;
> mutex_unlock(&dev_priv->modeset_restore_lock);
>
> + intel_opregion_notify_adapter(dev, PCI_D0);
> +
This could be moved after intel_opregion_init() just for clarity, but
I'm also fine keeping it here.
This patch depends on Rafael's change in his PM tree to export
acpi_target_system_state(), other than that this is:
Reviewed-by: Imre Deak <imre.deak@intel.com>
> intel_runtime_pm_put(dev_priv);
> return 0;
> }
[-- 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-05-30 13:47 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-29 21:11 [PATCH 1/4] drm/i915: disable power wells on suspend Jesse Barnes
2014-05-29 21:11 ` [PATCH 2/4] drm/i915: leave rc6 enabled at suspend time Jesse Barnes
2014-05-30 12:54 ` Imre Deak
2014-05-30 15:32 ` Jesse Barnes
2014-05-30 15:40 ` Chris Wilson
2014-05-30 18:20 ` Jesse Barnes
2014-06-02 8:43 ` Daniel Vetter
2014-05-30 18:33 ` [PATCH] drm/i915: leave rc6 enabled at suspend time v2 Jesse Barnes
2014-06-04 19:33 ` [PATCH] drm/i915: leave rc6 enabled at suspend time v3 Jesse Barnes
2014-06-04 20:45 ` [PATCH] drm/i915: leave rc6 enabled at suspend time v4 Jesse Barnes
2014-06-05 9:21 ` Daniel Vetter
2014-06-05 15:50 ` Jesse Barnes
2014-06-10 13:42 ` Imre Deak
2014-06-10 13:57 ` Daniel Vetter
2014-06-10 14:41 ` Imre Deak
2014-06-10 15:26 ` Daniel Vetter
2014-06-11 22:21 ` Jesse Barnes
2014-06-11 22:24 ` Jesse Barnes
2014-06-12 15:08 ` Imre Deak
2014-05-30 19:00 ` [PATCH 2/4] drm/i915: leave rc6 enabled at suspend time Kristen Carlson Accardi
2014-05-29 21:11 ` [PATCH 3/4] drm/i915: send proper opregion notifications on suspend/resume Jesse Barnes
2014-05-29 21:48 ` [PATCH 3/5] ACPI: export target system state for use by drivers Jesse Barnes
2014-05-30 2:09 ` Rafael J. Wysocki
2014-05-29 21:48 ` [PATCH 4/5] drm/i915: send proper opregion notifications on suspend/resume Jesse Barnes
2014-05-30 13:47 ` Imre Deak [this message]
2014-05-30 19:08 ` [PATCH 3/4] " Kristen Carlson Accardi
2014-05-29 21:11 ` [PATCH 4/4] drm/i915: make sure PC8 is enabled on suspend and disabled on resume Jesse Barnes
2014-05-30 13:37 ` Imre Deak
2014-05-30 18:29 ` Jesse Barnes
2014-05-30 21:12 ` Rafael J. Wysocki
2014-05-30 21:05 ` Jesse Barnes
2014-05-30 18:32 ` [PATCH] drm/i915: make sure PC8 is enabled on suspend and disabled on resume v2 Jesse Barnes
2014-05-30 18:40 ` [PATCH] drm/i915: make sure PC8 is enabled on suspend and disabled on resume v3 Jesse Barnes
2014-05-30 18:48 ` [PATCH] drm/i915: make sure PC8 is enabled on suspend and disabled on resume v4 Jesse Barnes
2014-06-04 20:02 ` Imre Deak
2014-06-02 8:45 ` [PATCH 4/4] drm/i915: make sure PC8 is enabled on suspend and disabled on resume Daniel Vetter
2014-06-02 11:37 ` Imre Deak
2014-06-02 15:32 ` Daniel Vetter
2014-06-02 15:57 ` Imre Deak
2014-06-02 16:05 ` Daniel Vetter
2014-05-30 12:48 ` [PATCH 1/4] drm/i915: disable power wells on suspend Imre Deak
2014-05-30 18:59 ` Kristen Carlson Accardi
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=1401457633.24060.55.camel@intelbox \
--to=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jbarnes@virtuousgeek.org \
--cc=kristen@linux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox