Skip to content

Commit 1ca17e9

Browse files
committed
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Pull drm fix from Dave Airlie: "Just a single fix for amdgpu to just suspend the gpu on 'shutdown' instead of shutting it down fully, as for some reason the hw was getting upset in some situations" * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: drm/amdgpu: just suspend the hw on pci shutdown
2 parents 2b41226 + 4e4f3e9 commit 1ca17e9

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2472,6 +2472,7 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev,
24722472
struct drm_file *file_priv);
24732473
void amdgpu_driver_preclose_kms(struct drm_device *dev,
24742474
struct drm_file *file_priv);
2475+
int amdgpu_suspend(struct amdgpu_device *adev);
24752476
int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon);
24762477
int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon);
24772478
u32 amdgpu_get_vblank_counter_kms(struct drm_device *dev, unsigned int pipe);

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1493,7 +1493,7 @@ static int amdgpu_fini(struct amdgpu_device *adev)
14931493
return 0;
14941494
}
14951495

1496-
static int amdgpu_suspend(struct amdgpu_device *adev)
1496+
int amdgpu_suspend(struct amdgpu_device *adev)
14971497
{
14981498
int i, r;
14991499

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,12 +479,15 @@ amdgpu_pci_remove(struct pci_dev *pdev)
479479
static void
480480
amdgpu_pci_shutdown(struct pci_dev *pdev)
481481
{
482+
struct drm_device *dev = pci_get_drvdata(pdev);
483+
struct amdgpu_device *adev = dev->dev_private;
484+
482485
/* if we are running in a VM, make sure the device
483486
* torn down properly on reboot/shutdown.
484487
* unfortunately we can't detect certain
485488
* hypervisors so just do this all the time.
486489
*/
487-
amdgpu_pci_remove(pdev);
490+
amdgpu_suspend(adev);
488491
}
489492

490493
static int amdgpu_pmops_suspend(struct device *dev)

0 commit comments

Comments
 (0)