gma: Rework power handling in Update_Outputs()

We should also reevaluate power settings, when we only disabled pipes
and didn't enable any new outputs.

Change-Id: Ia81454bdeb770359b1d95e02f6f3d75e76584857
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/18121
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
This commit is contained in:
Nico Huber
2017-01-11 15:33:07 +01:00
committed by Nico Huber
parent b56b9c5e02
commit 564103f4cc

View File

@@ -201,8 +201,19 @@ is
end if;
end Check_HPD;
Did_Power_Up : Boolean := False;
Power_Changed : Boolean := False;
Old_Configs : Pipe_Configs;
-- Only called when we actually tried to change something
-- so we don't congest the log with unnecessary messages.
procedure Update_Power
is
begin
if not Power_Changed then
Power_And_Clocks.Power_Up (Old_Configs, Configs);
Power_Changed := True;
end if;
end Update_Power;
begin
Old_Configs := Cur_Configs;
@@ -222,6 +233,7 @@ is
then
Disable_Output (Pipe, Cur_Config);
Cur_Config.Port := Disabled;
Update_Power;
end if;
end if;
end;
@@ -246,10 +258,7 @@ is
end if;
if Success then
if not Did_Power_Up then
Power_And_Clocks.Power_Up (Old_Configs, Configs);
Did_Power_Up := True;
end if;
Update_Power;
Enable_Output (Pipe, New_Config, Success);
end if;
@@ -267,7 +276,7 @@ is
end;
end loop;
if Did_Power_Up then
if Power_Changed then
Power_And_Clocks.Power_Down (Old_Configs, Configs, Cur_Configs);
end if;
end Update_Outputs;