Skip to content

Commit 56342da

Browse files
effective-lightalexdeucher
authored andcommitted
drm/amd/display: prevent register access while in IPS
We can't read/write to DCN registers while in IPS. Since, that can cause the system to hang. So, before proceeding with the access in that scenario, force the system out of IPS. Cc: [email protected] # 6.6+ Reviewed-by: Roman Li <[email protected]> Signed-off-by: Hamza Mahfooz <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 84801d4 commit 56342da

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11437,6 +11437,12 @@ void amdgpu_dm_trigger_timing_sync(struct drm_device *dev)
1143711437
mutex_unlock(&adev->dm.dc_lock);
1143811438
}
1143911439

11440+
static inline void amdgpu_dm_exit_ips_for_hw_access(struct dc *dc)
11441+
{
11442+
if (dc->ctx->dmub_srv && !dc->ctx->dmub_srv->idle_exit_counter)
11443+
dc_exit_ips_for_hw_access(dc);
11444+
}
11445+
1144011446
void dm_write_reg_func(const struct dc_context *ctx, uint32_t address,
1144111447
u32 value, const char *func_name)
1144211448
{
@@ -11447,6 +11453,8 @@ void dm_write_reg_func(const struct dc_context *ctx, uint32_t address,
1144711453
return;
1144811454
}
1144911455
#endif
11456+
11457+
amdgpu_dm_exit_ips_for_hw_access(ctx->dc);
1145011458
cgs_write_register(ctx->cgs_device, address, value);
1145111459
trace_amdgpu_dc_wreg(&ctx->perf_trace->write_count, address, value);
1145211460
}
@@ -11470,6 +11478,8 @@ uint32_t dm_read_reg_func(const struct dc_context *ctx, uint32_t address,
1147011478
return 0;
1147111479
}
1147211480

11481+
amdgpu_dm_exit_ips_for_hw_access(ctx->dc);
11482+
1147311483
value = cgs_read_register(ctx->cgs_device, address);
1147411484

1147511485
trace_amdgpu_dc_rreg(&ctx->perf_trace->read_count, address, value);

0 commit comments

Comments
 (0)