aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2016-12-06 10:38:29 -0500
committerAlex Deucher <alexander.deucher@amd.com>2016-12-07 11:17:21 -0500
commitfaefba95c9e8ca3a523831c2ec2150f5ea054dae (patch)
tree9a22a1a9071737b04cf3b30e32826c4f8203a5d7
parentab7cd8d83e5dba13027de66f1b008b08b30b71a4 (diff)
drm/amdgpu: just suspend the hw on pci shutdown
We can't just reuse pci_remove as there may be userspace still doing things. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98638 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97980 Reviewed-by: Christian König <christian.koenig@amd.com> Reported-and-tested-by: Mike Lothian <mike@fireburn.co.uk> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu.h1
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_device.c2
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c5
3 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 496f72b134eb..05c2850c04b0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -2472,6 +2472,7 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev,
2472 struct drm_file *file_priv); 2472 struct drm_file *file_priv);
2473void amdgpu_driver_preclose_kms(struct drm_device *dev, 2473void amdgpu_driver_preclose_kms(struct drm_device *dev,
2474 struct drm_file *file_priv); 2474 struct drm_file *file_priv);
2475int amdgpu_suspend(struct amdgpu_device *adev);
2475int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon); 2476int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon);
2476int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon); 2477int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon);
2477u32 amdgpu_get_vblank_counter_kms(struct drm_device *dev, unsigned int pipe); 2478u32 amdgpu_get_vblank_counter_kms(struct drm_device *dev, unsigned int pipe);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 3161d77bf299..e41d4baebf86 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1493,7 +1493,7 @@ static int amdgpu_fini(struct amdgpu_device *adev)
1493 return 0; 1493 return 0;
1494} 1494}
1495 1495
1496static int amdgpu_suspend(struct amdgpu_device *adev) 1496int amdgpu_suspend(struct amdgpu_device *adev)
1497{ 1497{
1498 int i, r; 1498 int i, r;
1499 1499
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 02ff0747197c..e0890deccb2f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -479,12 +479,15 @@ amdgpu_pci_remove(struct pci_dev *pdev)
479static void 479static void
480amdgpu_pci_shutdown(struct pci_dev *pdev) 480amdgpu_pci_shutdown(struct pci_dev *pdev)
481{ 481{
482 struct drm_device *dev = pci_get_drvdata(pdev);
483 struct amdgpu_device *adev = dev->dev_private;
484
482 /* if we are running in a VM, make sure the device 485 /* if we are running in a VM, make sure the device
483 * torn down properly on reboot/shutdown. 486 * torn down properly on reboot/shutdown.
484 * unfortunately we can't detect certain 487 * unfortunately we can't detect certain
485 * hypervisors so just do this all the time. 488 * hypervisors so just do this all the time.
486 */ 489 */
487 amdgpu_pci_remove(pdev); 490 amdgpu_suspend(adev);
488} 491}
489 492
490static int amdgpu_pmops_suspend(struct device *dev) 493static int amdgpu_pmops_suspend(struct device *dev)