drm/amdgpu/gfx: set cg flags to enter/exit safe mode
authorJane Jian <Jane.Jian@amd.com>
Wed, 15 Mar 2023 10:59:59 +0000 (18:59 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 23 Mar 2023 13:32:01 +0000 (09:32 -0400)
sriov needs to enter/exit safe mode in update umd p state
add the cg flag to let it enter or exit while needed

Signed-off-by: Jane Jian <Jane.Jian@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c

index 08650f93f210a0c5d26f10b578945722f289662f..ecf8ceb53311ac2d1dbb09b80244fef86dc3bca3 100644 (file)
@@ -1287,6 +1287,11 @@ static int gfx_v11_0_sw_init(void *handle)
                break;
        }
 
+       /* Enable CG flag in one VF mode for enabling RLC safe mode enter/exit */
+       if (adev->ip_versions[GC_HWIP][0] == IP_VERSION(11, 0, 3) &&
+               amdgpu_sriov_is_pp_one_vf(adev))
+               adev->cg_flags = AMD_CG_SUPPORT_GFX_CGCG;
+
        /* EOP Event */
        r = amdgpu_irq_add_id(adev, SOC21_IH_CLIENTID_GRBM_CP,
                              GFX_11_0_0__SRCID__CP_EOP_INTERRUPT,