diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/evergreen.c')
| -rw-r--r-- | drivers/gpu/drm/radeon/evergreen.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index 4dc5b4714c5a..7b337c361a12 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c | |||
| @@ -748,6 +748,8 @@ void evergreen_pcie_gart_tlb_flush(struct radeon_device *rdev) | |||
| 748 | unsigned i; | 748 | unsigned i; |
| 749 | u32 tmp; | 749 | u32 tmp; |
| 750 | 750 | ||
| 751 | WREG32(HDP_MEM_COHERENCY_FLUSH_CNTL, 0x1); | ||
| 752 | |||
| 751 | WREG32(VM_CONTEXT0_REQUEST_RESPONSE, REQUEST_TYPE(1)); | 753 | WREG32(VM_CONTEXT0_REQUEST_RESPONSE, REQUEST_TYPE(1)); |
| 752 | for (i = 0; i < rdev->usec_timeout; i++) { | 754 | for (i = 0; i < rdev->usec_timeout; i++) { |
| 753 | /* read MC_STATUS */ | 755 | /* read MC_STATUS */ |
| @@ -1922,7 +1924,6 @@ bool evergreen_gpu_is_lockup(struct radeon_device *rdev) | |||
| 1922 | static int evergreen_gpu_soft_reset(struct radeon_device *rdev) | 1924 | static int evergreen_gpu_soft_reset(struct radeon_device *rdev) |
| 1923 | { | 1925 | { |
| 1924 | struct evergreen_mc_save save; | 1926 | struct evergreen_mc_save save; |
| 1925 | u32 srbm_reset = 0; | ||
| 1926 | u32 grbm_reset = 0; | 1927 | u32 grbm_reset = 0; |
| 1927 | 1928 | ||
| 1928 | dev_info(rdev->dev, "GPU softreset \n"); | 1929 | dev_info(rdev->dev, "GPU softreset \n"); |
| @@ -1961,16 +1962,6 @@ static int evergreen_gpu_soft_reset(struct radeon_device *rdev) | |||
| 1961 | udelay(50); | 1962 | udelay(50); |
| 1962 | WREG32(GRBM_SOFT_RESET, 0); | 1963 | WREG32(GRBM_SOFT_RESET, 0); |
| 1963 | (void)RREG32(GRBM_SOFT_RESET); | 1964 | (void)RREG32(GRBM_SOFT_RESET); |
| 1964 | |||
| 1965 | /* reset all the system blocks */ | ||
| 1966 | srbm_reset = SRBM_SOFT_RESET_ALL_MASK; | ||
| 1967 | |||
| 1968 | dev_info(rdev->dev, " SRBM_SOFT_RESET=0x%08X\n", srbm_reset); | ||
| 1969 | WREG32(SRBM_SOFT_RESET, srbm_reset); | ||
| 1970 | (void)RREG32(SRBM_SOFT_RESET); | ||
| 1971 | udelay(50); | ||
| 1972 | WREG32(SRBM_SOFT_RESET, 0); | ||
| 1973 | (void)RREG32(SRBM_SOFT_RESET); | ||
| 1974 | /* Wait a little for things to settle down */ | 1965 | /* Wait a little for things to settle down */ |
| 1975 | udelay(50); | 1966 | udelay(50); |
| 1976 | dev_info(rdev->dev, " GRBM_STATUS=0x%08X\n", | 1967 | dev_info(rdev->dev, " GRBM_STATUS=0x%08X\n", |
| @@ -1981,10 +1972,6 @@ static int evergreen_gpu_soft_reset(struct radeon_device *rdev) | |||
| 1981 | RREG32(GRBM_STATUS_SE1)); | 1972 | RREG32(GRBM_STATUS_SE1)); |
| 1982 | dev_info(rdev->dev, " SRBM_STATUS=0x%08X\n", | 1973 | dev_info(rdev->dev, " SRBM_STATUS=0x%08X\n", |
| 1983 | RREG32(SRBM_STATUS)); | 1974 | RREG32(SRBM_STATUS)); |
| 1984 | /* After reset we need to reinit the asic as GPU often endup in an | ||
| 1985 | * incoherent state. | ||
| 1986 | */ | ||
| 1987 | atom_asic_init(rdev->mode_info.atom_context); | ||
| 1988 | evergreen_mc_resume(rdev, &save); | 1975 | evergreen_mc_resume(rdev, &save); |
| 1989 | return 0; | 1976 | return 0; |
| 1990 | } | 1977 | } |
| @@ -2596,6 +2583,11 @@ int evergreen_resume(struct radeon_device *rdev) | |||
| 2596 | { | 2583 | { |
| 2597 | int r; | 2584 | int r; |
| 2598 | 2585 | ||
| 2586 | /* reset the asic, the gfx blocks are often in a bad state | ||
| 2587 | * after the driver is unloaded or after a resume | ||
| 2588 | */ | ||
| 2589 | if (radeon_asic_reset(rdev)) | ||
| 2590 | dev_warn(rdev->dev, "GPU reset failed !\n"); | ||
| 2599 | /* Do not reset GPU before posting, on rv770 hw unlike on r500 hw, | 2591 | /* Do not reset GPU before posting, on rv770 hw unlike on r500 hw, |
| 2600 | * posting will perform necessary task to bring back GPU into good | 2592 | * posting will perform necessary task to bring back GPU into good |
| 2601 | * shape. | 2593 | * shape. |
| @@ -2712,6 +2704,11 @@ int evergreen_init(struct radeon_device *rdev) | |||
| 2712 | r = radeon_atombios_init(rdev); | 2704 | r = radeon_atombios_init(rdev); |
| 2713 | if (r) | 2705 | if (r) |
| 2714 | return r; | 2706 | return r; |
| 2707 | /* reset the asic, the gfx blocks are often in a bad state | ||
| 2708 | * after the driver is unloaded or after a resume | ||
| 2709 | */ | ||
| 2710 | if (radeon_asic_reset(rdev)) | ||
| 2711 | dev_warn(rdev->dev, "GPU reset failed !\n"); | ||
| 2715 | /* Post card if necessary */ | 2712 | /* Post card if necessary */ |
| 2716 | if (!evergreen_card_posted(rdev)) { | 2713 | if (!evergreen_card_posted(rdev)) { |
| 2717 | if (!rdev->bios) { | 2714 | if (!rdev->bios) { |
