diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_device.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 944ba0d3874a..6abb238b25c9 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | |||
@@ -619,25 +619,29 @@ void amdgpu_gtt_location(struct amdgpu_device *adev, struct amdgpu_mc *mc) | |||
619 | * GPU helpers function. | 619 | * GPU helpers function. |
620 | */ | 620 | */ |
621 | /** | 621 | /** |
622 | * amdgpu_card_posted - check if the hw has already been initialized | 622 | * amdgpu_need_post - check if the hw need post or not |
623 | * | 623 | * |
624 | * @adev: amdgpu_device pointer | 624 | * @adev: amdgpu_device pointer |
625 | * | 625 | * |
626 | * Check if the asic has been initialized (all asics). | 626 | * Check if the asic has been initialized (all asics) at driver startup |
627 | * Used at driver startup. | 627 | * or post is needed if hw reset is performed. |
628 | * Returns true if initialized or false if not. | 628 | * Returns true if need or false if not. |
629 | */ | 629 | */ |
630 | bool amdgpu_card_posted(struct amdgpu_device *adev) | 630 | bool amdgpu_need_post(struct amdgpu_device *adev) |
631 | { | 631 | { |
632 | uint32_t reg; | 632 | uint32_t reg; |
633 | 633 | ||
634 | if (adev->has_hw_reset) { | ||
635 | adev->has_hw_reset = false; | ||
636 | return true; | ||
637 | } | ||
634 | /* then check MEM_SIZE, in case the crtcs are off */ | 638 | /* then check MEM_SIZE, in case the crtcs are off */ |
635 | reg = RREG32(mmCONFIG_MEMSIZE); | 639 | reg = RREG32(mmCONFIG_MEMSIZE); |
636 | 640 | ||
637 | if (reg) | 641 | if (reg) |
638 | return true; | 642 | return false; |
639 | 643 | ||
640 | return false; | 644 | return true; |
641 | 645 | ||
642 | } | 646 | } |
643 | 647 | ||
@@ -665,7 +669,7 @@ static bool amdgpu_vpost_needed(struct amdgpu_device *adev) | |||
665 | return true; | 669 | return true; |
666 | } | 670 | } |
667 | } | 671 | } |
668 | return !amdgpu_card_posted(adev); | 672 | return amdgpu_need_post(adev); |
669 | } | 673 | } |
670 | 674 | ||
671 | /** | 675 | /** |
@@ -2071,7 +2075,7 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon) | |||
2071 | amdgpu_atombios_scratch_regs_restore(adev); | 2075 | amdgpu_atombios_scratch_regs_restore(adev); |
2072 | 2076 | ||
2073 | /* post card */ | 2077 | /* post card */ |
2074 | if (!amdgpu_card_posted(adev) || !resume) { | 2078 | if (amdgpu_need_post(adev)) { |
2075 | r = amdgpu_atom_asic_init(adev->mode_info.atom_context); | 2079 | r = amdgpu_atom_asic_init(adev->mode_info.atom_context); |
2076 | if (r) | 2080 | if (r) |
2077 | DRM_ERROR("amdgpu asic init failed\n"); | 2081 | DRM_ERROR("amdgpu asic init failed\n"); |