Skip to content

Commit 1cdd675

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: 336568d ("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]>
1 parent 97ddae7 commit 1cdd675

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
@@ -1236,6 +1236,14 @@ static void smu_init_xgmi_plpd_mode(struct smu_context *smu)
12361236
}
12371237
}
12381238

1239+
static bool smu_is_workload_profile_available(struct smu_context *smu,
1240+
u32 profile)
1241+
{
1242+
if (profile >= PP_SMC_POWER_PROFILE_COUNT)
1243+
return false;
1244+
return smu->workload_map && smu->workload_map[profile].valid_mapping;
1245+
}
1246+
12391247
static int smu_sw_init(struct amdgpu_ip_block *ip_block)
12401248
{
12411249
struct amdgpu_device *adev = ip_block->adev;
@@ -1267,7 +1275,8 @@ static int smu_sw_init(struct amdgpu_ip_block *ip_block)
12671275
smu->workload_prority[PP_SMC_POWER_PROFILE_COMPUTE] = 5;
12681276
smu->workload_prority[PP_SMC_POWER_PROFILE_CUSTOM] = 6;
12691277

1270-
if (smu->is_apu)
1278+
if (smu->is_apu ||
1279+
!smu_is_workload_profile_available(smu, PP_SMC_POWER_PROFILE_FULLSCREEN3D))
12711280
smu->workload_mask = 1 << smu->workload_prority[PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT];
12721281
else
12731282
smu->workload_mask = 1 << smu->workload_prority[PP_SMC_POWER_PROFILE_FULLSCREEN3D];

0 commit comments

Comments
 (0)