amd-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] drm/amdgpu: drop pm_runtime_set_active
@ 2020-05-07 16:08 Alex Deucher
  2020-05-07 16:08 ` [PATCH 2/4] drm/amdgpu: fix runpm logic in amdgpu_pmops_resume Alex Deucher
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Alex Deucher @ 2020-05-07 16:08 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher

The pci core handles this for us in pci_pm_init.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index c7f42ff6ab5e..233d6c8c4ca3 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
@@ -191,7 +191,6 @@ int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags)
 		dev_pm_set_driver_flags(dev->dev, DPM_FLAG_NEVER_SKIP);
 		pm_runtime_use_autosuspend(dev->dev);
 		pm_runtime_set_autosuspend_delay(dev->dev, 5000);
-		pm_runtime_set_active(dev->dev);
 		pm_runtime_allow(dev->dev);
 		pm_runtime_mark_last_busy(dev->dev);
 		pm_runtime_put_autosuspend(dev->dev);
-- 
2.25.4

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/4] drm/amdgpu: fix runpm logic in amdgpu_pmops_resume
  2020-05-07 16:08 [PATCH 1/4] drm/amdgpu: drop pm_runtime_set_active Alex Deucher
@ 2020-05-07 16:08 ` Alex Deucher
  2020-05-07 16:08 ` [PATCH 3/4] drm/amdgpu: drop extra runtime pm handling in resume pmop Alex Deucher
  2020-05-07 16:08 ` [PATCH 4/4] drm/amdgpu: only set DPM_FLAG_NEVER_SKIP for legacy ATPX BOCO Alex Deucher
  2 siblings, 0 replies; 5+ messages in thread
From: Alex Deucher @ 2020-05-07 16:08 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher

We should be checking whether the driver enabled runtime pm
rather than whether the asic supports BOCO or BACO.  That said
in general they are equivalent unless the user has disabled
runpm or it has been disabled for a specific asic.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 0ca396d4ebcb..ea2b4254d30c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -1174,10 +1174,10 @@ static int amdgpu_pmops_suspend(struct device *dev)
 static int amdgpu_pmops_resume(struct device *dev)
 {
 	struct drm_device *drm_dev = dev_get_drvdata(dev);
+	struct amdgpu_device *adev = drm_dev->dev_private;
 
 	/* GPU comes up enabled by the bios on resume */
-	if (amdgpu_device_supports_boco(drm_dev) ||
-	    amdgpu_device_supports_baco(drm_dev)) {
+	if (adev->runpm) {
 		pm_runtime_disable(dev);
 		pm_runtime_set_active(dev);
 		pm_runtime_enable(dev);
-- 
2.25.4

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/4] drm/amdgpu: drop extra runtime pm handling in resume pmop
  2020-05-07 16:08 [PATCH 1/4] drm/amdgpu: drop pm_runtime_set_active Alex Deucher
  2020-05-07 16:08 ` [PATCH 2/4] drm/amdgpu: fix runpm logic in amdgpu_pmops_resume Alex Deucher
@ 2020-05-07 16:08 ` Alex Deucher
  2020-05-07 16:08 ` [PATCH 4/4] drm/amdgpu: only set DPM_FLAG_NEVER_SKIP for legacy ATPX BOCO Alex Deucher
  2 siblings, 0 replies; 5+ messages in thread
From: Alex Deucher @ 2020-05-07 16:08 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher

The core handles this for us.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index ea2b4254d30c..5407edeeccc2 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -1174,14 +1174,6 @@ static int amdgpu_pmops_suspend(struct device *dev)
 static int amdgpu_pmops_resume(struct device *dev)
 {
 	struct drm_device *drm_dev = dev_get_drvdata(dev);
-	struct amdgpu_device *adev = drm_dev->dev_private;
-
-	/* GPU comes up enabled by the bios on resume */
-	if (adev->runpm) {
-		pm_runtime_disable(dev);
-		pm_runtime_set_active(dev);
-		pm_runtime_enable(dev);
-	}
 
 	return amdgpu_device_resume(drm_dev, true);
 }
-- 
2.25.4

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 4/4] drm/amdgpu: only set DPM_FLAG_NEVER_SKIP for legacy ATPX BOCO
  2020-05-07 16:08 [PATCH 1/4] drm/amdgpu: drop pm_runtime_set_active Alex Deucher
  2020-05-07 16:08 ` [PATCH 2/4] drm/amdgpu: fix runpm logic in amdgpu_pmops_resume Alex Deucher
  2020-05-07 16:08 ` [PATCH 3/4] drm/amdgpu: drop extra runtime pm handling in resume pmop Alex Deucher
@ 2020-05-07 16:08 ` Alex Deucher
  2020-05-08  3:46   ` Quan, Evan
  2 siblings, 1 reply; 5+ messages in thread
From: Alex Deucher @ 2020-05-07 16:08 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher

We only need to set DPM_FLAG_NEVER_SKIP for the legacy ATPX
BOCO case.  D3cold and BACO work as expected.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index 233d6c8c4ca3..4e4c9550dcf8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
@@ -188,7 +188,10 @@ int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags)
 		dev_dbg(&dev->pdev->dev, "Error during ACPI methods call\n");
 
 	if (adev->runpm) {
-		dev_pm_set_driver_flags(dev->dev, DPM_FLAG_NEVER_SKIP);
+		/* only need to skip on ATPX */
+		if (amdgpu_device_supports_boco(dev) &&
+		    !amdgpu_is_atpx_hybrid())
+			dev_pm_set_driver_flags(dev->dev, DPM_FLAG_NEVER_SKIP);
 		pm_runtime_use_autosuspend(dev->dev);
 		pm_runtime_set_autosuspend_delay(dev->dev, 5000);
 		pm_runtime_allow(dev->dev);
-- 
2.25.4

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* RE: [PATCH 4/4] drm/amdgpu: only set DPM_FLAG_NEVER_SKIP for legacy ATPX BOCO
  2020-05-07 16:08 ` [PATCH 4/4] drm/amdgpu: only set DPM_FLAG_NEVER_SKIP for legacy ATPX BOCO Alex Deucher
@ 2020-05-08  3:46   ` Quan, Evan
  0 siblings, 0 replies; 5+ messages in thread
From: Quan, Evan @ 2020-05-08  3:46 UTC (permalink / raw)
  To: Alex Deucher, amd-gfx; +Cc: Deucher, Alexander

[AMD Official Use Only - Internal Distribution Only]

Patch2 is reviewed-by: Evan Quan <evan.quan@amd.com>
Others from the series are acked-by: Evan Quan <evan.quan@amd.com>

-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Alex Deucher
Sent: Friday, May 8, 2020 12:08 AM
To: amd-gfx@lists.freedesktop.org
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>
Subject: [PATCH 4/4] drm/amdgpu: only set DPM_FLAG_NEVER_SKIP for legacy ATPX BOCO

We only need to set DPM_FLAG_NEVER_SKIP for the legacy ATPX
BOCO case.  D3cold and BACO work as expected.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index 233d6c8c4ca3..4e4c9550dcf8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
@@ -188,7 +188,10 @@ int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags)
 dev_dbg(&dev->pdev->dev, "Error during ACPI methods call\n");

 if (adev->runpm) {
-dev_pm_set_driver_flags(dev->dev, DPM_FLAG_NEVER_SKIP);
+/* only need to skip on ATPX */
+if (amdgpu_device_supports_boco(dev) &&
+    !amdgpu_is_atpx_hybrid())
+dev_pm_set_driver_flags(dev->dev, DPM_FLAG_NEVER_SKIP);
 pm_runtime_use_autosuspend(dev->dev);
 pm_runtime_set_autosuspend_delay(dev->dev, 5000);
 pm_runtime_allow(dev->dev);
--
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Cevan.quan%40amd.com%7C62fe0eef98e74285482908d7f2a0dd85%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637244645084791405&amp;sdata=n4w17BAf2MR8AClxM6RQ8MZHoTnMiC3aeGj3RYUPdtk%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-05-08  3:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-07 16:08 [PATCH 1/4] drm/amdgpu: drop pm_runtime_set_active Alex Deucher
2020-05-07 16:08 ` [PATCH 2/4] drm/amdgpu: fix runpm logic in amdgpu_pmops_resume Alex Deucher
2020-05-07 16:08 ` [PATCH 3/4] drm/amdgpu: drop extra runtime pm handling in resume pmop Alex Deucher
2020-05-07 16:08 ` [PATCH 4/4] drm/amdgpu: only set DPM_FLAG_NEVER_SKIP for legacy ATPX BOCO Alex Deucher
2020-05-08  3:46   ` Quan, Evan

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).