diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2010-12-21 16:05:39 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-01-04 17:31:50 -0500 |
commit | 17db7042b7ff77a4ae8b83ab42ec8286a9715a48 (patch) | |
tree | 0b79514c91067ce65e501dfda319b4ee5544b78d /drivers/gpu/drm/radeon/evergreen.c | |
parent | 4f125010d2d02c481a0fdf5aee23a9f937bc5de1 (diff) |
drm/radeon/kms: implement gpu lockup check for evergreen
Now that soft reset works, we can add this.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/evergreen.c')
-rw-r--r-- | drivers/gpu/drm/radeon/evergreen.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index ec641ce64764..3ae63ceb9c33 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c | |||
@@ -2085,8 +2085,30 @@ int evergreen_mc_init(struct radeon_device *rdev) | |||
2085 | 2085 | ||
2086 | bool evergreen_gpu_is_lockup(struct radeon_device *rdev) | 2086 | bool evergreen_gpu_is_lockup(struct radeon_device *rdev) |
2087 | { | 2087 | { |
2088 | /* FIXME: implement for evergreen */ | 2088 | u32 srbm_status; |
2089 | return false; | 2089 | u32 grbm_status; |
2090 | u32 grbm_status_se0, grbm_status_se1; | ||
2091 | struct r100_gpu_lockup *lockup = &rdev->config.evergreen.lockup; | ||
2092 | int r; | ||
2093 | |||
2094 | srbm_status = RREG32(SRBM_STATUS); | ||
2095 | grbm_status = RREG32(GRBM_STATUS); | ||
2096 | grbm_status_se0 = RREG32(GRBM_STATUS_SE0); | ||
2097 | grbm_status_se1 = RREG32(GRBM_STATUS_SE1); | ||
2098 | if (!(grbm_status & GUI_ACTIVE)) { | ||
2099 | r100_gpu_lockup_update(lockup, &rdev->cp); | ||
2100 | return false; | ||
2101 | } | ||
2102 | /* force CP activities */ | ||
2103 | r = radeon_ring_lock(rdev, 2); | ||
2104 | if (!r) { | ||
2105 | /* PACKET2 NOP */ | ||
2106 | radeon_ring_write(rdev, 0x80000000); | ||
2107 | radeon_ring_write(rdev, 0x80000000); | ||
2108 | radeon_ring_unlock_commit(rdev); | ||
2109 | } | ||
2110 | rdev->cp.rptr = RREG32(CP_RB_RPTR); | ||
2111 | return r100_gpu_cp_is_lockup(rdev, lockup, &rdev->cp); | ||
2090 | } | 2112 | } |
2091 | 2113 | ||
2092 | static int evergreen_gpu_soft_reset(struct radeon_device *rdev) | 2114 | static int evergreen_gpu_soft_reset(struct radeon_device *rdev) |