drm/amd/pp: Fix gfx ring test failed on Fiji without hw avfs support
authorRex Zhu <Rex.Zhu@amd.com>
Tue, 20 Mar 2018 09:04:46 +0000 (17:04 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 21 Mar 2018 04:45:01 +0000 (23:45 -0500)
caused by
'commit ca82cec868d1 ("drm/amd/pp: Simplified the avfs btc state on smu7")'

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/powerplay/smumgr/fiji_smumgr.c
drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c

index 43432e4c7bdc044d2bddb1b82b921aa2f457ee97..faef78321446f9823d6bc7b8098b6c6a3605cf05 100644 (file)
@@ -263,6 +263,9 @@ static int fiji_setup_graphics_level_structure(struct pp_hwmgr *hwmgr)
 
 static int fiji_avfs_event_mgr(struct pp_hwmgr *hwmgr)
 {
+       if (!hwmgr->avfs_supported)
+               return 0;
+
        PP_ASSERT_WITH_CODE(0 == fiji_setup_graphics_level_structure(hwmgr),
                        "[AVFS][fiji_avfs_event_mgr] Could not Copy Graphics Level"
                        " table over to SMU",
index f6b12980c87c8b5eab964d1c1a819448d64cc129..997a777dd35b284be0cb94f4d867625331fb33e0 100644 (file)
@@ -172,11 +172,13 @@ static int polaris10_setup_graphics_level_structure(struct pp_hwmgr *hwmgr)
 }
 
 
-static int
-polaris10_avfs_event_mgr(struct pp_hwmgr *hwmgr)
+static int polaris10_avfs_event_mgr(struct pp_hwmgr *hwmgr)
 {
        struct smu7_smumgr *smu_data = (struct smu7_smumgr *)(hwmgr->smu_backend);
 
+       if (!hwmgr->avfs_supported)
+               return 0;
+
        PP_ASSERT_WITH_CODE(0 == polaris10_setup_graphics_level_structure(hwmgr),
                "[AVFS][Polaris10_AVFSEventMgr] Could not Copy Graphics Level table over to SMU",
                return -EINVAL);