All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher@gmail.com>
To: amd-gfx@lists.freedesktop.org, alsa-devel@alsa-project.org,
	tiwai@suse.de, lukas@wunner.de
Cc: Alex Deucher <alexander.deucher@amd.com>, Evan Quan <evan.quan@amd.com>
Subject: [alsa-devel] [PATCH 13/21] drm/amdgpu: add baco support to runtime suspend/resume
Date: Mon, 28 Oct 2019 17:42:08 -0400	[thread overview]
Message-ID: <20191028214216.1508370-14-alexander.deucher@amd.com> (raw)
In-Reply-To: <20191028214216.1508370-1-alexander.deucher@amd.com>

BACO - Bus Active, Chip Off

This adds the necessary support to the runtime suspend
and resume functions to handle boards that support
baco.

Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 7b8478d08b2b..849784e27a98 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -1164,7 +1164,8 @@ static int amdgpu_pmops_resume(struct device *dev)
 	struct drm_device *drm_dev = dev_get_drvdata(dev);
 
 	/* GPU comes up enabled by the bios on resume */
-	if (amdgpu_device_supports_boco(drm_dev)) {
+	if (amdgpu_device_supports_boco(drm_dev) ||
+	    amdgpu_device_supports_baco(drm_dev)) {
 		pm_runtime_disable(dev);
 		pm_runtime_set_active(dev);
 		pm_runtime_enable(dev);
@@ -1231,6 +1232,8 @@ static int amdgpu_pmops_runtime_suspend(struct device *dev)
 		else if (!amdgpu_has_atpx_dgpu_power_cntl())
 			pci_set_power_state(pdev, PCI_D3hot);
 		drm_dev->switch_power_state = DRM_SWITCH_POWER_DYNAMIC_OFF;
+	} else if (amdgpu_device_supports_baco(drm_dev)) {
+		amdgpu_device_baco_enter(drm_dev);
 	}
 
 	return 0;
@@ -1256,6 +1259,8 @@ static int amdgpu_pmops_runtime_resume(struct device *dev)
 		if (ret)
 			return ret;
 		pci_set_master(pdev);
+	} else if (amdgpu_device_supports_baco(drm_dev)) {
+		amdgpu_device_baco_exit(drm_dev);
 	}
 	ret = amdgpu_device_resume(drm_dev, false, false);
 	drm_kms_helper_poll_enable(drm_dev);
-- 
2.23.0

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

WARNING: multiple messages have this Message-ID (diff)
From: Alex Deucher <alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org,
	tiwai-l3A5Bk7waGM@public.gmane.org,
	lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org
Cc: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>,
	Evan Quan <evan.quan-5C7GfCeVMHo@public.gmane.org>
Subject: [PATCH 13/21] drm/amdgpu: add baco support to runtime suspend/resume
Date: Mon, 28 Oct 2019 17:42:08 -0400	[thread overview]
Message-ID: <20191028214216.1508370-14-alexander.deucher@amd.com> (raw)
In-Reply-To: <20191028214216.1508370-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>

BACO - Bus Active, Chip Off

This adds the necessary support to the runtime suspend
and resume functions to handle boards that support
baco.

Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 7b8478d08b2b..849784e27a98 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -1164,7 +1164,8 @@ static int amdgpu_pmops_resume(struct device *dev)
 	struct drm_device *drm_dev = dev_get_drvdata(dev);
 
 	/* GPU comes up enabled by the bios on resume */
-	if (amdgpu_device_supports_boco(drm_dev)) {
+	if (amdgpu_device_supports_boco(drm_dev) ||
+	    amdgpu_device_supports_baco(drm_dev)) {
 		pm_runtime_disable(dev);
 		pm_runtime_set_active(dev);
 		pm_runtime_enable(dev);
@@ -1231,6 +1232,8 @@ static int amdgpu_pmops_runtime_suspend(struct device *dev)
 		else if (!amdgpu_has_atpx_dgpu_power_cntl())
 			pci_set_power_state(pdev, PCI_D3hot);
 		drm_dev->switch_power_state = DRM_SWITCH_POWER_DYNAMIC_OFF;
+	} else if (amdgpu_device_supports_baco(drm_dev)) {
+		amdgpu_device_baco_enter(drm_dev);
 	}
 
 	return 0;
@@ -1256,6 +1259,8 @@ static int amdgpu_pmops_runtime_resume(struct device *dev)
 		if (ret)
 			return ret;
 		pci_set_master(pdev);
+	} else if (amdgpu_device_supports_baco(drm_dev)) {
+		amdgpu_device_baco_exit(drm_dev);
 	}
 	ret = amdgpu_device_resume(drm_dev, false, false);
 	drm_kms_helper_poll_enable(drm_dev);
-- 
2.23.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

WARNING: multiple messages have this Message-ID (diff)
From: Alex Deucher <alexdeucher@gmail.com>
To: amd-gfx@lists.freedesktop.org, alsa-devel@alsa-project.org,
	tiwai@suse.de, lukas@wunner.de
Cc: Alex Deucher <alexander.deucher@amd.com>, Evan Quan <evan.quan@amd.com>
Subject: [PATCH 13/21] drm/amdgpu: add baco support to runtime suspend/resume
Date: Mon, 28 Oct 2019 17:42:08 -0400	[thread overview]
Message-ID: <20191028214216.1508370-14-alexander.deucher@amd.com> (raw)
Message-ID: <20191028214208.H02BmUJyt_y5bQ1u4BGfoz9c-mFIAONRZKytveYgQ6I@z> (raw)
In-Reply-To: <20191028214216.1508370-1-alexander.deucher@amd.com>

BACO - Bus Active, Chip Off

This adds the necessary support to the runtime suspend
and resume functions to handle boards that support
baco.

Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 7b8478d08b2b..849784e27a98 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -1164,7 +1164,8 @@ static int amdgpu_pmops_resume(struct device *dev)
 	struct drm_device *drm_dev = dev_get_drvdata(dev);
 
 	/* GPU comes up enabled by the bios on resume */
-	if (amdgpu_device_supports_boco(drm_dev)) {
+	if (amdgpu_device_supports_boco(drm_dev) ||
+	    amdgpu_device_supports_baco(drm_dev)) {
 		pm_runtime_disable(dev);
 		pm_runtime_set_active(dev);
 		pm_runtime_enable(dev);
@@ -1231,6 +1232,8 @@ static int amdgpu_pmops_runtime_suspend(struct device *dev)
 		else if (!amdgpu_has_atpx_dgpu_power_cntl())
 			pci_set_power_state(pdev, PCI_D3hot);
 		drm_dev->switch_power_state = DRM_SWITCH_POWER_DYNAMIC_OFF;
+	} else if (amdgpu_device_supports_baco(drm_dev)) {
+		amdgpu_device_baco_enter(drm_dev);
 	}
 
 	return 0;
@@ -1256,6 +1259,8 @@ static int amdgpu_pmops_runtime_resume(struct device *dev)
 		if (ret)
 			return ret;
 		pci_set_master(pdev);
+	} else if (amdgpu_device_supports_baco(drm_dev)) {
+		amdgpu_device_baco_exit(drm_dev);
 	}
 	ret = amdgpu_device_resume(drm_dev, false, false);
 	drm_kms_helper_poll_enable(drm_dev);
-- 
2.23.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2019-10-28 21:53 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-28 21:41 [alsa-devel] [PATCH 00/21] Enable BACO for power savings (v2) Alex Deucher
2019-10-28 21:41 ` Alex Deucher
2019-10-28 21:41 ` Alex Deucher
2019-10-28 21:41 ` [alsa-devel] [PATCH 01/21] drm/amdgpu: add asic callback for BACO support Alex Deucher
2019-10-28 21:41   ` Alex Deucher
2019-10-28 21:41   ` Alex Deucher
2019-10-28 21:41 ` [alsa-devel] [PATCH 02/21] drm/amdgpu/soc15: move struct definition around to align with other soc15 asics Alex Deucher
2019-10-28 21:41   ` Alex Deucher
2019-10-28 21:41   ` Alex Deucher
2019-10-28 21:41 ` [alsa-devel] [PATCH 03/21] drm/amdgpu: add supports_baco callback for soc15 asics. (v2) Alex Deucher
2019-10-28 21:41   ` Alex Deucher
2019-10-28 21:41   ` Alex Deucher
2019-10-28 21:41 ` [alsa-devel] [PATCH 04/21] drm/amdgpu: add supports_baco callback for SI asics Alex Deucher
2019-10-28 21:41   ` Alex Deucher
2019-10-28 21:41   ` Alex Deucher
2019-10-28 21:42 ` [alsa-devel] [PATCH 05/21] drm/amdgpu: add supports_baco callback for CIK asics Alex Deucher
2019-10-28 21:42   ` Alex Deucher
2019-10-28 21:42   ` Alex Deucher
2019-10-28 21:42 ` [alsa-devel] [PATCH 06/21] drm/amdgpu: add supports_baco callback for VI asics Alex Deucher
2019-10-28 21:42   ` Alex Deucher
2019-10-28 21:42   ` Alex Deucher
2019-10-28 21:42 ` [alsa-devel] [PATCH 07/21] drm/amdgpu: add supports_baco callback for NV asics Alex Deucher
2019-10-28 21:42   ` Alex Deucher
2019-10-28 21:42   ` Alex Deucher
2019-10-28 21:42 ` [alsa-devel] [PATCH 08/21] drm/amdgpu: add a amdgpu_device_supports_baco helper Alex Deucher
2019-10-28 21:42   ` Alex Deucher
2019-10-28 21:42   ` Alex Deucher
2019-10-28 21:42 ` [alsa-devel] [PATCH 09/21] drm/amdgpu: rename amdgpu_device_is_px to amdgpu_device_supports_boco (v2) Alex Deucher
2019-10-28 21:42   ` Alex Deucher
2019-10-28 21:42   ` Alex Deucher
2019-10-28 21:42 ` [alsa-devel] [PATCH 10/21] drm/amdgpu: add additional boco checks to runtime suspend/resume (v2) Alex Deucher
2019-10-28 21:42   ` Alex Deucher
2019-10-28 21:42   ` Alex Deucher
2019-10-28 21:42 ` [alsa-devel] [PATCH 11/21] drm/amdgpu: split swSMU baco_reset into enter and exit Alex Deucher
2019-10-28 21:42   ` Alex Deucher
2019-10-28 21:42   ` Alex Deucher
2019-10-28 21:42 ` [alsa-devel] [PATCH 12/21] drm/amdgpu: add helpers for baco entry " Alex Deucher
2019-10-28 21:42   ` Alex Deucher
2019-10-28 21:42   ` Alex Deucher
2019-10-28 21:42 ` Alex Deucher [this message]
2019-10-28 21:42   ` [PATCH 13/21] drm/amdgpu: add baco support to runtime suspend/resume Alex Deucher
2019-10-28 21:42   ` Alex Deucher
2019-10-28 21:42 ` [alsa-devel] [PATCH 14/21] drm/amdgpu: start to disentangle boco from runtime pm Alex Deucher
2019-10-28 21:42   ` Alex Deucher
2019-10-28 21:42   ` Alex Deucher
2019-10-28 21:42 ` [alsa-devel] [PATCH 15/21] drm/amdgpu: disentangle runtime pm and vga_switcheroo Alex Deucher
2019-10-28 21:42   ` Alex Deucher
2019-10-28 21:42   ` Alex Deucher
2019-10-28 21:42 ` [alsa-devel] [PATCH 16/21] drm/amdgpu: enable runtime pm on BACO capable boards if runpm=1 Alex Deucher
2019-10-28 21:42   ` Alex Deucher
2019-10-28 21:42   ` Alex Deucher
2019-10-28 21:42 ` [alsa-devel] [PATCH 17/21] drm/amdgpu/runpm: enable runpm on baco capable VI+ asics Alex Deucher
2019-10-28 21:42   ` Alex Deucher
2019-10-28 21:42   ` Alex Deucher
2019-10-28 21:42 ` [alsa-devel] [PATCH 18/21] ALSA: hda/hdmi - fix vgaswitcheroo detection for AMD Alex Deucher
2019-10-28 21:42   ` Alex Deucher
2019-10-28 21:42   ` Alex Deucher
2019-10-29  5:49   ` [alsa-devel] " Takashi Iwai
2019-10-29  5:49     ` Takashi Iwai
2019-10-29  5:49     ` Takashi Iwai
2019-10-28 21:42 ` [alsa-devel] [PATCH 19/21] ALSA: hda/hdmi - Add new pci ids for AMD GPU display audio Alex Deucher
2019-10-28 21:42   ` Alex Deucher
2019-10-28 21:42   ` Alex Deucher
2019-10-29  5:49   ` [alsa-devel] " Takashi Iwai
2019-10-29  5:49     ` Takashi Iwai
2019-10-29  5:49     ` Takashi Iwai
2019-10-28 21:42 ` [alsa-devel] [PATCH 20/21] ALSA: hda/hdmi - enable runtime pm for newer AMD " Alex Deucher
2019-10-28 21:42   ` Alex Deucher
2019-10-28 21:42   ` Alex Deucher
2019-10-29  5:50   ` [alsa-devel] " Takashi Iwai
2019-10-29  5:50     ` Takashi Iwai
2019-10-29  5:50     ` Takashi Iwai
2019-10-28 21:42 ` [alsa-devel] [PATCH 21/21] ALSA: hda/hdmi - enable automatic runtime pm for AMD HDMI codecs by default Alex Deucher
2019-10-28 21:42   ` Alex Deucher
2019-10-28 21:42   ` Alex Deucher
2019-10-29  5:51   ` [alsa-devel] " Takashi Iwai
2019-10-29  5:51     ` Takashi Iwai
2019-10-29  5:51     ` Takashi Iwai

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=20191028214216.1508370-14-alexander.deucher@amd.com \
    --to=alexdeucher@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=evan.quan@amd.com \
    --cc=lukas@wunner.de \
    --cc=tiwai@suse.de \
    /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.