drm/amdgpu: delete dead code about fw load check
authorRex Zhu <Rex.Zhu@amd.com>
Mon, 25 Sep 2017 09:50:13 +0000 (17:50 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 28 Sep 2017 20:03:32 +0000 (16:03 -0400)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c

index dfc10b1baea0edca0e22023a0cccd07e333cad5a..e04de7a81592884a1b134bbfd8344eaf89b30ebf 100644 (file)
@@ -4132,18 +4132,12 @@ static int gfx_v8_0_rlc_resume(struct amdgpu_device *adev)
        gfx_v8_0_rlc_reset(adev);
        gfx_v8_0_init_pg(adev);
 
-       if (!adev->pp_enabled) {
-               if (adev->firmware.load_type != AMDGPU_FW_LOAD_SMU) {
-                       /* legacy rlc firmware loading */
-                       r = gfx_v8_0_rlc_load_microcode(adev);
-                       if (r)
-                               return r;
-               } else {
-                       r = adev->smu.smumgr_funcs->check_fw_load_finish(adev,
-                                                       AMDGPU_UCODE_ID_RLC_G);
-                       if (r)
-                               return -EINVAL;
-               }
+
+       if (adev->firmware.load_type == AMDGPU_FW_LOAD_DIRECT) {
+               /* legacy rlc firmware loading */
+               r = gfx_v8_0_rlc_load_microcode(adev);
+               if (r)
+                       return r;
        }
 
        gfx_v8_0_rlc_start(adev);
@@ -4959,43 +4953,15 @@ static int gfx_v8_0_cp_resume(struct amdgpu_device *adev)
        if (!(adev->flags & AMD_IS_APU))
                gfx_v8_0_enable_gui_idle_interrupt(adev, false);
 
-       if (!adev->pp_enabled) {
-               if (adev->firmware.load_type != AMDGPU_FW_LOAD_SMU) {
+       if (adev->firmware.load_type == AMDGPU_FW_LOAD_DIRECT) {
                        /* legacy firmware loading */
-                       r = gfx_v8_0_cp_gfx_load_microcode(adev);
-                       if (r)
-                               return r;
+               r = gfx_v8_0_cp_gfx_load_microcode(adev);
+               if (r)
+                       return r;
 
-                       r = gfx_v8_0_cp_compute_load_microcode(adev);
-                       if (r)
-                               return r;
-               } else {
-                       r = adev->smu.smumgr_funcs->check_fw_load_finish(adev,
-                                                       AMDGPU_UCODE_ID_CP_CE);
-                       if (r)
-                               return -EINVAL;
-
-                       r = adev->smu.smumgr_funcs->check_fw_load_finish(adev,
-                                                       AMDGPU_UCODE_ID_CP_PFP);
-                       if (r)
-                               return -EINVAL;
-
-                       r = adev->smu.smumgr_funcs->check_fw_load_finish(adev,
-                                                       AMDGPU_UCODE_ID_CP_ME);
-                       if (r)
-                               return -EINVAL;
-
-                       if (adev->asic_type == CHIP_TOPAZ) {
-                               r = gfx_v8_0_cp_compute_load_microcode(adev);
-                               if (r)
-                                       return r;
-                       } else {
-                               r = adev->smu.smumgr_funcs->check_fw_load_finish(adev,
-                                                                                AMDGPU_UCODE_ID_CP_MEC1);
-                               if (r)
-                                       return -EINVAL;
-                       }
-               }
+               r = gfx_v8_0_cp_compute_load_microcode(adev);
+               if (r)
+                       return r;
        }
 
        r = gfx_v8_0_cp_gfx_resume(adev);
index acdee3a4602c2cd2d3bcc8882b61e9348394c91e..67f375bfe45204436095ee41b59f75563d37c91f 100644 (file)
@@ -561,21 +561,11 @@ static int sdma_v2_4_start(struct amdgpu_device *adev)
 {
        int r;
 
-       if (!adev->pp_enabled) {
-               if (adev->firmware.load_type != AMDGPU_FW_LOAD_SMU) {
-                       r = sdma_v2_4_load_microcode(adev);
-                       if (r)
-                               return r;
-               } else {
-                       r = adev->smu.smumgr_funcs->check_fw_load_finish(adev,
-                                                       AMDGPU_UCODE_ID_SDMA0);
-                       if (r)
-                               return -EINVAL;
-                       r = adev->smu.smumgr_funcs->check_fw_load_finish(adev,
-                                                       AMDGPU_UCODE_ID_SDMA1);
-                       if (r)
-                               return -EINVAL;
-               }
+
+       if (adev->firmware.load_type == AMDGPU_FW_LOAD_DIRECT) {
+               r = sdma_v2_4_load_microcode(adev);
+               if (r)
+                       return r;
        }
 
        /* halt the engine before programing */
index 72f31cc7df00e6dadf9a865f097ce1bfdd083ebc..6d06f8eb659fadb32779bad8293ad220ce49fcd2 100644 (file)
@@ -819,23 +819,12 @@ static int sdma_v3_0_load_microcode(struct amdgpu_device *adev)
  */
 static int sdma_v3_0_start(struct amdgpu_device *adev)
 {
-       int r, i;
+       int r;
 
-       if (!adev->pp_enabled) {
-               if (adev->firmware.load_type != AMDGPU_FW_LOAD_SMU) {
-                       r = sdma_v3_0_load_microcode(adev);
-                       if (r)
-                               return r;
-               } else {
-                       for (i = 0; i < adev->sdma.num_instances; i++) {
-                               r = adev->smu.smumgr_funcs->check_fw_load_finish(adev,
-                                                                                (i == 0) ?
-                                                                                AMDGPU_UCODE_ID_SDMA0 :
-                                                                                AMDGPU_UCODE_ID_SDMA1);
-                               if (r)
-                                       return -EINVAL;
-                       }
-               }
+       if (adev->firmware.load_type == AMDGPU_FW_LOAD_DIRECT) {
+               r = sdma_v3_0_load_microcode(adev);
+               if (r)
+                       return r;
        }
 
        /* disable sdma engine before programing it */