Skip to content

Commit 7c210ca

Browse files
committed
drm/amdgpu: handle default profile on on devices without fullscreen 3D
Some devices do not support fullscreen 3D. v2: Make the check generic. Fixes: ec1aab7 ("drm/amdgpu/swsmu: default to fullscreen 3D profile for dGPUs") Reviewed-by: Lijo Lazar <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: Kenneth Feng <[email protected]> Cc: Lijo Lazar <[email protected]> (cherry picked from commit 1cdd675)
1 parent ba1959f commit 7c210ca

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1234,6 +1234,14 @@ static void smu_init_xgmi_plpd_mode(struct smu_context *smu)
12341234
}
12351235
}
12361236

1237+
static bool smu_is_workload_profile_available(struct smu_context *smu,
1238+
u32 profile)
1239+
{
1240+
if (profile >= PP_SMC_POWER_PROFILE_COUNT)
1241+
return false;
1242+
return smu->workload_map && smu->workload_map[profile].valid_mapping;
1243+
}
1244+
12371245
static int smu_sw_init(void *handle)
12381246
{
12391247
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
@@ -1265,7 +1273,8 @@ static int smu_sw_init(void *handle)
12651273
smu->workload_prority[PP_SMC_POWER_PROFILE_COMPUTE] = 5;
12661274
smu->workload_prority[PP_SMC_POWER_PROFILE_CUSTOM] = 6;
12671275

1268-
if (smu->is_apu)
1276+
if (smu->is_apu ||
1277+
!smu_is_workload_profile_available(smu, PP_SMC_POWER_PROFILE_FULLSCREEN3D))
12691278
smu->workload_mask = 1 << smu->workload_prority[PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT];
12701279
else
12711280
smu->workload_mask = 1 << smu->workload_prority[PP_SMC_POWER_PROFILE_FULLSCREEN3D];

0 commit comments

Comments
 (0)