diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2011-01-11 13:36:55 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-01-16 21:21:57 -0500 |
commit | 25b2ec5b643c9ea784e5a51e5e9602cd536965f2 (patch) | |
tree | a6a7f9f7423f2957819d362cadad37a53da5ee0f /drivers/gpu/drm/radeon/r300.c | |
parent | fd909c3718da3fb8c5c0530f93ae21d85dc31471 (diff) |
drm/radeon/kms: balance asic_reset functions
First, we were calling mc_stop() at the top of the function
which turns off all MC (memory controller) clients,
then checking if the GPU is idle. If it was idle we
returned without re-enabling the MC clients which would
lead to a blank screen, etc. This patch checks if the
GPU is idle before calling mc_stop().
Second, if the reset failed, we were returning without
re-enabling the MC clients. This patch re-enables
the MC clients before returning regardless of whether
the reset was successful or not.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/r300.c')
-rw-r--r-- | drivers/gpu/drm/radeon/r300.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c index fae5e709f270..cf862ca580bf 100644 --- a/drivers/gpu/drm/radeon/r300.c +++ b/drivers/gpu/drm/radeon/r300.c | |||
@@ -405,12 +405,13 @@ int r300_asic_reset(struct radeon_device *rdev) | |||
405 | { | 405 | { |
406 | struct r100_mc_save save; | 406 | struct r100_mc_save save; |
407 | u32 status, tmp; | 407 | u32 status, tmp; |
408 | int ret = 0; | ||
408 | 409 | ||
409 | r100_mc_stop(rdev, &save); | ||
410 | status = RREG32(R_000E40_RBBM_STATUS); | 410 | status = RREG32(R_000E40_RBBM_STATUS); |
411 | if (!G_000E40_GUI_ACTIVE(status)) { | 411 | if (!G_000E40_GUI_ACTIVE(status)) { |
412 | return 0; | 412 | return 0; |
413 | } | 413 | } |
414 | r100_mc_stop(rdev, &save); | ||
414 | status = RREG32(R_000E40_RBBM_STATUS); | 415 | status = RREG32(R_000E40_RBBM_STATUS); |
415 | dev_info(rdev->dev, "(%s:%d) RBBM_STATUS=0x%08X\n", __func__, __LINE__, status); | 416 | dev_info(rdev->dev, "(%s:%d) RBBM_STATUS=0x%08X\n", __func__, __LINE__, status); |
416 | /* stop CP */ | 417 | /* stop CP */ |
@@ -451,11 +452,11 @@ int r300_asic_reset(struct radeon_device *rdev) | |||
451 | if (G_000E40_GA_BUSY(status) || G_000E40_VAP_BUSY(status)) { | 452 | if (G_000E40_GA_BUSY(status) || G_000E40_VAP_BUSY(status)) { |
452 | dev_err(rdev->dev, "failed to reset GPU\n"); | 453 | dev_err(rdev->dev, "failed to reset GPU\n"); |
453 | rdev->gpu_lockup = true; | 454 | rdev->gpu_lockup = true; |
454 | return -1; | 455 | ret = -1; |
455 | } | 456 | } else |
457 | dev_info(rdev->dev, "GPU reset succeed\n"); | ||
456 | r100_mc_resume(rdev, &save); | 458 | r100_mc_resume(rdev, &save); |
457 | dev_info(rdev->dev, "GPU reset succeed\n"); | 459 | return ret; |
458 | return 0; | ||
459 | } | 460 | } |
460 | 461 | ||
461 | /* | 462 | /* |