drm/amdgpu: disable legacy path of firmware check if powerplay is enabled
authorRex Zhu <Rex.Zhu@amd.com>
Sat, 7 Nov 2015 01:33:24 +0000 (20:33 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 21 Dec 2015 21:42:08 +0000 (16:42 -0500)
Powerplay will use a different interface once it's integrated.  These
legacy pathes will be removed once powerplay is enabled by default.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c

index b20369e4ea74c1a3300e466754b2b1f657a9976c..d90aae08445e07c3cf108a86607730f2439b7878 100644 (file)
@@ -2902,16 +2902,18 @@ static int gfx_v8_0_rlc_resume(struct amdgpu_device *adev)
 
        gfx_v8_0_rlc_reset(adev);
 
-       if (!adev->firmware.smu_load) {
-               /* 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 (!amdgpu_powerplay) {
+               if (!adev->firmware.smu_load) {
+                       /* 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;
+               }
        }
 
        gfx_v8_0_rlc_start(adev);
@@ -3802,35 +3804,37 @@ 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->firmware.smu_load) {
-               /* legacy firmware loading */
-               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 (!amdgpu_powerplay) {
+               if (!adev->firmware.smu_load) {
+                       /* legacy firmware loading */
+                       r = gfx_v8_0_cp_gfx_load_microcode(adev);
+                       if (r)
+                               return r;
 
-               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;
+               } 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;
+
+                       r = adev->smu.smumgr_funcs->check_fw_load_finish(adev,
+                                                       AMDGPU_UCODE_ID_CP_MEC1);
+                       if (r)
+                               return -EINVAL;
+               }
        }
 
        r = gfx_v8_0_cp_gfx_resume(adev);
index 7253132f04b82ede1e4910c9a9deb886344c92be..8091c1c37c4ef39a19301a8acfb7ad5d02d119aa 100644 (file)
@@ -727,18 +727,20 @@ static int sdma_v3_0_start(struct amdgpu_device *adev)
 {
        int r, i;
 
-       if (!adev->firmware.smu_load) {
-               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 (!amdgpu_powerplay) {
+               if (!adev->firmware.smu_load) {
+                       r = sdma_v3_0_load_microcode(adev);
                        if (r)
-                               return -EINVAL;
+                               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;
+                       }
                }
        }