[coreboot-gerrit] Patch set updated for coreboot: 41942f7 sandy/ivy: Respect ACPI in LCD handling as video device.

Vladimir Serbinenko (phcoder@gmail.com) gerrit at coreboot.org
Fri Aug 22 03:52:54 CEST 2014


Vladimir Serbinenko (phcoder at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6733

-gerrit

commit 41942f7dedd093fcb0627b9f521fc56749f76d93
Author: Vladimir Serbinenko <phcoder at gmail.com>
Date:   Fri Aug 22 03:11:33 2014 +0200

    sandy/ivy: Respect ACPI in LCD handling as video device.
    
    Makes windows happy
    
    Change-Id: Ib60eb12b40206da77758124b8b75412232bcab9e
    Signed-off-by: Vladimir Serbinenko <phcoder at gmail.com>
---
 src/mainboard/lenovo/t520/dsdt.asl             |   2 +-
 src/mainboard/lenovo/t530/dsdt.asl             |   2 +-
 src/mainboard/lenovo/x230/dsdt.asl             |   2 +-
 src/northbridge/intel/sandybridge/acpi/igd.asl | 191 +++++++++++++------------
 4 files changed, 102 insertions(+), 95 deletions(-)

diff --git a/src/mainboard/lenovo/t520/dsdt.asl b/src/mainboard/lenovo/t520/dsdt.asl
index 0e7a965..487876f 100644
--- a/src/mainboard/lenovo/t520/dsdt.asl
+++ b/src/mainboard/lenovo/t520/dsdt.asl
@@ -24,7 +24,7 @@
 #define BRIGHTNESS_DOWN \_SB.PCI0.GFX0.LCD0.DECB
 #define ACPI_VIDEO_DEVICE \_SB.PCI0.GFX0
 #define RP03_IS_EXPRESSCARD 1
-#define HAVE_LCD_SCREEN 1
+#define DISPLAY_DEVICE_2_IS_LCD_SCREEN 1
 
 DefinitionBlock(
 	"dsdt.aml",
diff --git a/src/mainboard/lenovo/t530/dsdt.asl b/src/mainboard/lenovo/t530/dsdt.asl
index d09a451..c232638 100644
--- a/src/mainboard/lenovo/t530/dsdt.asl
+++ b/src/mainboard/lenovo/t530/dsdt.asl
@@ -24,7 +24,7 @@
 #define BRIGHTNESS_DOWN \_SB.PCI0.GFX0.LCD0.DECB
 #define ACPI_VIDEO_DEVICE \_SB.PCI0.GFX0
 #define RP03_IS_EXPRESSCARD 1
-#define HAVE_LCD_SCREEN 1
+#define DISPLAY_DEVICE_2_IS_LCD_SCREEN 1
 
 DefinitionBlock(
 	"dsdt.aml",
diff --git a/src/mainboard/lenovo/x230/dsdt.asl b/src/mainboard/lenovo/x230/dsdt.asl
index c73f795..dbca991 100644
--- a/src/mainboard/lenovo/x230/dsdt.asl
+++ b/src/mainboard/lenovo/x230/dsdt.asl
@@ -25,7 +25,7 @@
 #define ACPI_VIDEO_DEVICE \_SB.PCI0.GFX0
 #define RP03_IS_EXPRESSCARD 1
 #define EC_LENOVO_H8_ME_WORKAROUND 1
-#define HAVE_LCD_SCREEN 1
+#define DISPLAY_DEVICE_2_IS_LCD_SCREEN 1
 
 DefinitionBlock(
 	"dsdt.aml",
diff --git a/src/northbridge/intel/sandybridge/acpi/igd.asl b/src/northbridge/intel/sandybridge/acpi/igd.asl
index d40fad5..5fa2ff1 100644
--- a/src/northbridge/intel/sandybridge/acpi/igd.asl
+++ b/src/northbridge/intel/sandybridge/acpi/igd.asl
@@ -162,6 +162,104 @@ Device (GFX0)
 		}
 	}
 
+#ifdef DISPLAY_DEVICE_2_IS_LCD_SCREEN
+	Device (LCD0)
+	{
+		/* Device Unique ID */
+		Method(_ADR, 0, Serialized)
+		{
+			If(LEqual(DID2, 0)) {
+				Return (2)
+			} Else {
+				Return (And(0xffff, DID2))
+			}
+		}
+		Name (BRCT, 0)
+
+		Name (BRIG, Package (0x12)
+		{
+			0x61,
+			0x61,
+			0x2,
+			0x4,
+			0x5,
+			0x7,
+			0x9,
+			0xb,
+			0xd,
+			0x11,
+			0x14,
+			0x17,
+			0x1c,
+			0x20,
+			0x27,
+			0x31,
+			0x41,
+			0x61,
+		})
+
+		Method (_BCL, 0, NotSerialized)
+		{
+			Store (1, BRCT)
+			Return (BRIG)
+		}
+
+		Method (_BCM, 1, NotSerialized)
+		{
+			Store (ShiftLeft (Arg0, 4), ^^BCLV)
+			Store (0x80000000, ^^CR1)
+			Store (0x061a061a, ^^CR2)
+		}
+		Method (_BQC, 0, NotSerialized)
+		{
+			Store (^^BCLV, Local0)
+			ShiftRight (Local0, 4, Local0)
+			Return (Local0)
+		}
+
+		Method(BRID, 1, NotSerialized)
+		{
+			Store (Match (BRIG, MEQ, Arg0, MTR, Zero, 2), Local0)
+			If (LEqual (Local0, Ones))
+			{
+				Return (0x11)
+			}
+			Return (Local0)
+		}
+
+		/* Using Notify is the right way. But Windows doesn't handle
+		   it well. So use both method in a way to avoid double action.
+		 */
+		Method (DECB, 0, NotSerialized)
+		{
+			If (BRCT)
+			{
+				Notify (LCD0, 0x87)
+			} Else {
+				Store (BRID (_BQC ()), Local0)
+				If (LNotEqual (Local0, 2))
+				{
+					Decrement (Local0)
+				}
+				_BCM (DerefOf (Index (BRIG, Local0)))
+			}
+		}
+		Method (INCB, 0, NotSerialized)
+		{
+			If (BRCT)
+			{
+				Notify (LCD0, 0x86)
+			} Else {
+				Store (BRID (_BQC ()), Local0)
+				If (LNotEqual (Local0, 0x11))
+				{
+					Increment (Local0)
+				}
+				_BCM (DerefOf (Index (BRIG, Local0)))
+			}
+		}
+	}
+#else
 	Device(DD02)
 	{
 		/* Device Unique ID */
@@ -204,7 +302,7 @@ Device (GFX0)
 			}
 		}
 	}
-
+#endif
 
 	Device(DD03)
 	{
@@ -336,95 +434,4 @@ Device (GFX0)
 			}
 		}
 	}
-
-#ifdef HAVE_LCD_SCREEN
-	Device (LCD0)
-	{
-		Name (_ADR, 0x0400)
-		Name (BRCT, 0)
-
-		Name (BRIG, Package (0x12)
-		{
-			0x61,
-			0x61,
-			0x2,
-			0x4,
-			0x5,
-			0x7,
-			0x9,
-			0xb,
-			0xd,
-			0x11,
-			0x14,
-			0x17,
-			0x1c,
-			0x20,
-			0x27,
-			0x31,
-			0x41,
-			0x61,
-		})
-
-		Method (_BCL, 0, NotSerialized)
-		{
-			Store (1, BRCT)
-			Return (BRIG)
-		}
-
-		Method (_BCM, 1, NotSerialized)
-		{
-			Store (ShiftLeft (Arg0, 4), ^^BCLV)
-			Store (0x80000000, ^^CR1)
-			Store (0x061a061a, ^^CR2)
-		}
-		Method (_BQC, 0, NotSerialized)
-		{
-			Store (^^BCLV, Local0)
-			ShiftRight (Local0, 4, Local0)
-			Return (Local0)
-		}
-
-		Method(BRID, 1, NotSerialized)
-		{
-			Store (Match (BRIG, MEQ, Arg0, MTR, Zero, 2), Local0)
-			If (LEqual (Local0, Ones))
-			{
-				Return (0x11)
-			}
-			Return (Local0)
-		}
-
-		/* Using Notify is the right way. But Windows doesn't handle
-		   it well. So use both method in a way to avoid double action.
-		 */
-		Method (DECB, 0, NotSerialized)
-		{
-			If (BRCT)
-			{
-				Notify (LCD0, 0x87)
-			} Else {
-				Store (BRID (_BQC ()), Local0)
-				If (LNotEqual (Local0, 2))
-				{
-					Decrement (Local0)
-				}
-				_BCM (DerefOf (Index (BRIG, Local0)))
-			}
-		}
-		Method (INCB, 0, NotSerialized)
-		{
-			If (BRCT)
-			{
-				Notify (LCD0, 0x86)
-			} Else {
-				Store (BRID (_BQC ()), Local0)
-				If (LNotEqual (Local0, 0x11))
-				{
-					Increment (Local0)
-				}
-				_BCM (DerefOf (Index (BRIG, Local0)))
-			}
-		}
-	}
-#endif
 }



More information about the coreboot-gerrit mailing list