mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 07:03:03 +02:00
drm/amd/display: Exit IPS w/ DC helper for all dc_set_power_state cases
[why & how] On D3 path during dc_set_power_state, we may be in idle_allowed=true, at which point we will exit idle via dc_wake_and_execute_dmub_cmd_list which doesn't update dc->idle_optimizations_allowed to false. This would cause any future attempts to allow idle optimizations via the DC helper to get skipped because the value is stale and not reflective of the actual HW state. Move dc_exit_ips_for_hw_access() to the top of the function. Additionally ensure that dc_power_down_on_boot thread holds the DC lock and only runs if there are 0 streams. Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Signed-off-by: Ovidiu Bunea <ovidiu.bunea@amd.com> Signed-off-by: Ivan Lipski <ivan.lipski@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
413dd2fc60
commit
f44c094449
|
|
@ -5540,6 +5540,9 @@ void dc_power_down_on_boot(struct dc *dc)
|
|||
{
|
||||
if (dc->ctx->dce_environment != DCE_ENV_VIRTUAL_HW &&
|
||||
dc->hwss.power_down_on_boot) {
|
||||
if (dc->current_state->stream_count > 0)
|
||||
return;
|
||||
|
||||
if (dc->caps.ips_support)
|
||||
dc_exit_ips_for_hw_access(dc);
|
||||
dc->hwss.power_down_on_boot(dc);
|
||||
|
|
@ -5551,12 +5554,12 @@ void dc_set_power_state(struct dc *dc, enum dc_acpi_cm_power_state power_state)
|
|||
if (!dc->current_state)
|
||||
return;
|
||||
|
||||
dc_exit_ips_for_hw_access(dc);
|
||||
|
||||
switch (power_state) {
|
||||
case DC_ACPI_CM_POWER_STATE_D0:
|
||||
dc_state_construct(dc, dc->current_state);
|
||||
|
||||
dc_exit_ips_for_hw_access(dc);
|
||||
|
||||
dc_z10_restore(dc);
|
||||
|
||||
dc_dmub_srv_notify_fw_dc_power_state(dc->ctx->dmub_srv, power_state);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user