aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/drm2/radeon
diff options
context:
space:
mode:
authorJean-Sébastien Pédron <dumbbell@FreeBSD.org>2013-09-14 17:24:41 +0000
committerJean-Sébastien Pédron <dumbbell@FreeBSD.org>2013-09-14 17:24:41 +0000
commit02969dd0630ea32ca87156c8b0906f16654e9b30 (patch)
tree5f86f560cc939ebb36e6c0ef60cd844ffa3cc1ee /sys/dev/drm2/radeon
parentf4bb978a663eca853446a84c6b56b86bdbaccc08 (diff)
downloadsrc-02969dd0630ea32ca87156c8b0906f16654e9b30.tar.gz
src-02969dd0630ea32ca87156c8b0906f16654e9b30.zip
drm/radeon: Fix usage of pci_save_state() and pci_restore_state()
Calling those functions with the drmn device as argument causes a panic, because it's not a direct child of pci$N. They must be called with the vgapci device instead. This fix is not enough to make suspend/resume work reliably. Approved by: re (blanket)
Notes
Notes: svn path=/head/; revision=255573
Diffstat (limited to 'sys/dev/drm2/radeon')
-rw-r--r--sys/dev/drm2/radeon/r100.c4
-rw-r--r--sys/dev/drm2/radeon/r300.c4
-rw-r--r--sys/dev/drm2/radeon/radeon_device.c4
-rw-r--r--sys/dev/drm2/radeon/rs600.c4
4 files changed, 8 insertions, 8 deletions
diff --git a/sys/dev/drm2/radeon/r100.c b/sys/dev/drm2/radeon/r100.c
index 595f9221ba01..a66c7c2418b2 100644
--- a/sys/dev/drm2/radeon/r100.c
+++ b/sys/dev/drm2/radeon/r100.c
@@ -2647,7 +2647,7 @@ int r100_asic_reset(struct radeon_device *rdev)
WREG32(RADEON_CP_RB_WPTR, 0);
WREG32(RADEON_CP_RB_CNTL, tmp);
/* save PCI state */
- pci_save_state(rdev->dev);
+ pci_save_state(device_get_parent(rdev->dev));
/* disable bus mastering */
r100_bm_disable(rdev);
WREG32(R_0000F0_RBBM_SOFT_RESET, S_0000F0_SOFT_RESET_SE(1) |
@@ -2669,7 +2669,7 @@ int r100_asic_reset(struct radeon_device *rdev)
status = RREG32(R_000E40_RBBM_STATUS);
dev_info(rdev->dev, "(%s:%d) RBBM_STATUS=0x%08X\n", __func__, __LINE__, status);
/* restore PCI & busmastering */
- pci_restore_state(rdev->dev);
+ pci_restore_state(device_get_parent(rdev->dev));
r100_enable_bm(rdev);
/* Check if GPU is idle */
if (G_000E40_SE_BUSY(status) || G_000E40_RE_BUSY(status) ||
diff --git a/sys/dev/drm2/radeon/r300.c b/sys/dev/drm2/radeon/r300.c
index b8fdefc33652..aa9073cf2700 100644
--- a/sys/dev/drm2/radeon/r300.c
+++ b/sys/dev/drm2/radeon/r300.c
@@ -401,7 +401,7 @@ int r300_asic_reset(struct radeon_device *rdev)
WREG32(RADEON_CP_RB_WPTR, 0);
WREG32(RADEON_CP_RB_CNTL, tmp);
/* save PCI state */
- pci_save_state(rdev->dev);
+ pci_save_state(device_get_parent(rdev->dev));
/* disable bus mastering */
r100_bm_disable(rdev);
WREG32(R_0000F0_RBBM_SOFT_RESET, S_0000F0_SOFT_RESET_VAP(1) |
@@ -425,7 +425,7 @@ int r300_asic_reset(struct radeon_device *rdev)
status = RREG32(R_000E40_RBBM_STATUS);
dev_info(rdev->dev, "(%s:%d) RBBM_STATUS=0x%08X\n", __func__, __LINE__, status);
/* restore PCI & busmastering */
- pci_restore_state(rdev->dev);
+ pci_restore_state(device_get_parent(rdev->dev));
r100_enable_bm(rdev);
/* Check if GPU is idle */
if (G_000E40_GA_BUSY(status) || G_000E40_VAP_BUSY(status)) {
diff --git a/sys/dev/drm2/radeon/radeon_device.c b/sys/dev/drm2/radeon/radeon_device.c
index 5ed74fdbe236..676b38aad942 100644
--- a/sys/dev/drm2/radeon/radeon_device.c
+++ b/sys/dev/drm2/radeon/radeon_device.c
@@ -1316,7 +1316,7 @@ int radeon_suspend_kms(struct drm_device *dev)
radeon_agp_suspend(rdev);
- pci_save_state(dev->device);
+ pci_save_state(device_get_parent(rdev->dev));
#ifdef DUMBBELL_WIP
if (state.event == PM_EVENT_SUSPEND) {
/* Shut down the device */
@@ -1356,7 +1356,7 @@ int radeon_resume_kms(struct drm_device *dev)
console_lock();
#endif /* DUMBBELL_WIP */
pci_set_powerstate(dev->device, PCI_POWERSTATE_D0);
- pci_restore_state(dev->device);
+ pci_restore_state(device_get_parent(rdev->dev));
#ifdef DUMBBELL_WIP
if (pci_enable_device(dev->pdev)) {
console_unlock();
diff --git a/sys/dev/drm2/radeon/rs600.c b/sys/dev/drm2/radeon/rs600.c
index 6d3b17a495b4..11edbdfc5df9 100644
--- a/sys/dev/drm2/radeon/rs600.c
+++ b/sys/dev/drm2/radeon/rs600.c
@@ -373,7 +373,7 @@ int rs600_asic_reset(struct radeon_device *rdev)
WREG32(RADEON_CP_RB_RPTR_WR, 0);
WREG32(RADEON_CP_RB_WPTR, 0);
WREG32(RADEON_CP_RB_CNTL, tmp);
- pci_save_state(rdev->dev);
+ pci_save_state(device_get_parent(rdev->dev));
/* disable bus mastering */
pci_disable_busmaster(rdev->dev);
DRM_MDELAY(1);
@@ -403,7 +403,7 @@ int rs600_asic_reset(struct radeon_device *rdev)
status = RREG32(R_000E40_RBBM_STATUS);
dev_info(rdev->dev, "(%s:%d) RBBM_STATUS=0x%08X\n", __func__, __LINE__, status);
/* restore PCI & busmastering */
- pci_restore_state(rdev->dev);
+ pci_restore_state(device_get_parent(rdev->dev));
/* Check if GPU is idle */
if (G_000E40_GA_BUSY(status) || G_000E40_VAP_BUSY(status)) {
dev_err(rdev->dev, "failed to reset GPU\n");