aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMonk Liu <Monk.Liu@amd.com>2016-11-10 22:24:29 -0500
committerAlex Deucher <alexander.deucher@amd.com>2016-11-15 14:06:07 -0500
commit1da2c326e43b0834105993d13610647337bbad67 (patch)
tree01f7da15ac792681f80132f40bdafba2f87b34d0
parentcb434658a8ff151c221a9ac1d44fb6788100cd0d (diff)
drm/amdgpu:fix vpost_needed routine
1,cleanup description/comments 2,for FIJI & passthrough, force post when smc fw version below 22.15 3,for other cases, follow regular rules Signed-off-by: Monk Liu <Monk.Liu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_device.c27
1 files changed, 7 insertions, 20 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 7ca07e7b25c1..3161d77bf299 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -658,12 +658,10 @@ static bool amdgpu_vpost_needed(struct amdgpu_device *adev)
658 return false; 658 return false;
659 659
660 if (amdgpu_passthrough(adev)) { 660 if (amdgpu_passthrough(adev)) {
661 /* for FIJI: In whole GPU pass-through virtualization case 661 /* for FIJI: In whole GPU pass-through virtualization case, after VM reboot
662 * old smc fw won't clear some registers (e.g. MEM_SIZE, BIOS_SCRATCH) 662 * some old smc fw still need driver do vPost otherwise gpu hang, while
663 * so amdgpu_card_posted return false and driver will incorrectly skip vPost. 663 * those smc fw version above 22.15 doesn't have this flaw, so we force
664 * but if we force vPost do in pass-through case, the driver reload will hang. 664 * vpost executed for smc version below 22.15
665 * whether doing vPost depends on amdgpu_card_posted if smc version is above
666 * 00160e00 for FIJI.
667 */ 665 */
668 if (adev->asic_type == CHIP_FIJI) { 666 if (adev->asic_type == CHIP_FIJI) {
669 int err; 667 int err;
@@ -674,22 +672,11 @@ static bool amdgpu_vpost_needed(struct amdgpu_device *adev)
674 return true; 672 return true;
675 673
676 fw_ver = *((uint32_t *)adev->pm.fw->data + 69); 674 fw_ver = *((uint32_t *)adev->pm.fw->data + 69);
677 if (fw_ver >= 0x00160e00) 675 if (fw_ver < 0x00160e00)
678 return !amdgpu_card_posted(adev); 676 return true;
679 } 677 }
680 } else {
681 /* in bare-metal case, amdgpu_card_posted return false
682 * after system reboot/boot, and return true if driver
683 * reloaded.
684 * we shouldn't do vPost after driver reload otherwise GPU
685 * could hang.
686 */
687 if (amdgpu_card_posted(adev))
688 return false;
689 } 678 }
690 679 return !amdgpu_card_posted(adev);
691 /* we assume vPost is neede for all other cases */
692 return true;
693} 680}
694 681
695/** 682/**