Hello Angel Pons,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/libgfxinit/+/43668
to review the following change.
Change subject: gma: Export backlight control interface ......................................................................
gma: Export backlight control interface
Change-Id: I5a157d7849124fd3b4cca8f9de1d605092fd3c5e Signed-off-by: Nico Huber nico.huber@secunet.com --- M common/hw-gfx-gma.adb M common/hw-gfx-gma.ads 2 files changed, 52 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/68/43668/1
diff --git a/common/hw-gfx-gma.adb b/common/hw-gfx-gma.adb index 9157bbe..fae40ed 100644 --- a/common/hw-gfx-gma.adb +++ b/common/hw-gfx-gma.adb @@ -388,6 +388,40 @@
----------------------------------------------------------------------------
+ procedure Backlight_On (Port : Active_Port_Type) + with + Refined_Global => (In_Out => Registers.Register_State) + is + begin + Panel.Backlight_On (Config_Helpers.To_Panel (Port)); + end Backlight_On; + + procedure Backlight_Off (Port : Active_Port_Type) + with + Refined_Global => (In_Out => Registers.Register_State) + is + begin + Panel.Backlight_Off (Config_Helpers.To_Panel (Port)); + end Backlight_Off; + + procedure Set_Brightness (Port : Active_Port_Type; Level : Word32) + with + Refined_Global => (In_Out => Registers.Register_State) + is + begin + Panel.Set_Backlight (Config_Helpers.To_Panel (Port), Level); + end Set_Brightness; + + procedure Get_Max_Brightness (Port : Active_Port_Type; Level : out Word32) + with + Refined_Global => (In_Out => Registers.Register_State) + is + begin + Panel.Get_Max_Backlight (Config_Helpers.To_Panel (Port), Level); + end Get_Max_Brightness; + + ---------------------------------------------------------------------------- + procedure Initialize (Write_Delay : in Word64 := 0; Clean_State : in Boolean := False; diff --git a/common/hw-gfx-gma.ads b/common/hw-gfx-gma.ads index 1215fc5..747d2f1 100644 --- a/common/hw-gfx-gma.ads +++ b/common/hw-gfx-gma.ads @@ -161,6 +161,24 @@
----------------------------------------------------------------------------
+ procedure Backlight_On (Port : Active_Port_Type) + with + Global => (In_Out => Device_State); + + procedure Backlight_Off (Port : Active_Port_Type) + with + Global => (In_Out => Device_State); + + procedure Set_Brightness (Port : Active_Port_Type; Level : Word32) + with + Global => (In_Out => Device_State); + + procedure Get_Max_Brightness (Port : Active_Port_Type; Level : out Word32) + with + Global => (In_Out => Device_State); + + ---------------------------------------------------------------------------- + procedure Write_GTT (GTT_Page : GTT_Range; Device_Address : GTT_Address_Type;
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/libgfxinit/+/43668 )
Change subject: gma: Export backlight control interface ......................................................................
Patch Set 1: Code-Review+1
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/libgfxinit/+/43668 )
Change subject: gma: Export backlight control interface ......................................................................
Patch Set 1: Verified+1
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/libgfxinit/+/43668 )
Change subject: gma: Export backlight control interface ......................................................................
Patch Set 1: Code-Review+2
Nico Huber has submitted this change. ( https://review.coreboot.org/c/libgfxinit/+/43668 )
Change subject: gma: Export backlight control interface ......................................................................
gma: Export backlight control interface
Change-Id: I5a157d7849124fd3b4cca8f9de1d605092fd3c5e Signed-off-by: Nico Huber nico.huber@secunet.com Reviewed-on: https://review.coreboot.org/c/libgfxinit/+/43668 Tested-by: Nico Huber nico.h@gmx.de Reviewed-by: Angel Pons th3fanbus@gmail.com --- M common/hw-gfx-gma.adb M common/hw-gfx-gma.ads 2 files changed, 52 insertions(+), 0 deletions(-)
Approvals: Nico Huber: Verified Angel Pons: Looks good to me, approved
diff --git a/common/hw-gfx-gma.adb b/common/hw-gfx-gma.adb index d1ae1a0..851686e 100644 --- a/common/hw-gfx-gma.adb +++ b/common/hw-gfx-gma.adb @@ -402,6 +402,40 @@
----------------------------------------------------------------------------
+ procedure Backlight_On (Port : Active_Port_Type) + with + Refined_Global => (In_Out => Registers.Register_State) + is + begin + Panel.Backlight_On (Config_Helpers.To_Panel (Port)); + end Backlight_On; + + procedure Backlight_Off (Port : Active_Port_Type) + with + Refined_Global => (In_Out => Registers.Register_State) + is + begin + Panel.Backlight_Off (Config_Helpers.To_Panel (Port)); + end Backlight_Off; + + procedure Set_Brightness (Port : Active_Port_Type; Level : Word32) + with + Refined_Global => (In_Out => Registers.Register_State) + is + begin + Panel.Set_Backlight (Config_Helpers.To_Panel (Port), Level); + end Set_Brightness; + + procedure Get_Max_Brightness (Port : Active_Port_Type; Level : out Word32) + with + Refined_Global => (In_Out => Registers.Register_State) + is + begin + Panel.Get_Max_Backlight (Config_Helpers.To_Panel (Port), Level); + end Get_Max_Brightness; + + ---------------------------------------------------------------------------- + procedure Initialize (Write_Delay : in Word64 := 0; Clean_State : in Boolean := False; diff --git a/common/hw-gfx-gma.ads b/common/hw-gfx-gma.ads index 5c63942..afd1512 100644 --- a/common/hw-gfx-gma.ads +++ b/common/hw-gfx-gma.ads @@ -169,6 +169,24 @@
----------------------------------------------------------------------------
+ procedure Backlight_On (Port : Active_Port_Type) + with + Global => (In_Out => Device_State); + + procedure Backlight_Off (Port : Active_Port_Type) + with + Global => (In_Out => Device_State); + + procedure Set_Brightness (Port : Active_Port_Type; Level : Word32) + with + Global => (In_Out => Device_State); + + procedure Get_Max_Brightness (Port : Active_Port_Type; Level : out Word32) + with + Global => (In_Out => Device_State); + + ---------------------------------------------------------------------------- + procedure Write_GTT (GTT_Page : GTT_Range; Device_Address : GTT_Address_Type;