drm/amdgpu: add hw_start and non-psp firmware loading into resume
authorHuang Rui <ray.huang@amd.com>
Thu, 23 Mar 2017 03:20:25 +0000 (11:20 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 28 Apr 2017 20:37:59 +0000 (16:37 -0400)
Rework in order to properly support suspend.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

index 0d20dc3ea84eb5498d3259fb951dfae34b7179d9..68ccaedad0f7531031ae1a8c8d90589856db3709 100644 (file)
@@ -435,18 +435,30 @@ static int psp_resume(void *handle)
 {
        int ret;
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct psp_context *psp = &adev->psp;
 
        if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP)
                return 0;
 
+       DRM_INFO("PSP is resuming...\n");
+
        mutex_lock(&adev->firmware.mutex);
 
-       ret = psp_load_fw(adev);
+       ret = psp_hw_start(psp);
        if (ret)
-               DRM_ERROR("PSP resume failed\n");
+               goto failed;
+
+       ret = psp_np_fw_load(psp);
+       if (ret)
+               goto failed;
 
        mutex_unlock(&adev->firmware.mutex);
 
+       return 0;
+
+failed:
+       DRM_ERROR("PSP resume failed\n");
+       mutex_unlock(&adev->firmware.mutex);
        return ret;
 }