]> xenbits.xen.org Git - xenclient/xen-pq.git/commitdiff
Guest operating system driven brightness control support.
authorKamala Narasimhan <kamala.narasimhan@citrix.com>
Fri, 8 Jan 2010 19:26:48 +0000 (14:26 -0500)
committerKamala Narasimhan <kamala.narasimhan@citrix.com>
Fri, 8 Jan 2010 19:26:48 +0000 (14:26 -0500)
Virtual acpi layer changes to support standard output device object
methods.

master/guest-os-controlled-brightness-support [new file with mode: 0644]
master/series

diff --git a/master/guest-os-controlled-brightness-support b/master/guest-os-controlled-brightness-support
new file mode 100644 (file)
index 0000000..569cab9
--- /dev/null
@@ -0,0 +1,97 @@
+diff --git a/tools/firmware/hvmloader/acpi/dsdt.asl b/tools/firmware/hvmloader/acpi/dsdt.asl
+index 44a5022..d3aa5ee 100644
+--- a/tools/firmware/hvmloader/acpi/dsdt.asl
++++ b/tools/firmware/hvmloader/acpi/dsdt.asl
+@@ -97,6 +97,12 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, "Xen", "HVM", 0)
+            PLEN, 32
+        }
++        OperationRegion( OBRI, SystemIO, 0x94, 0x1 )
++        Field ( OBRI, ByteAcc, NoLock, Preserve)
++        {
++            BRI1, 8,
++        }
++
+         /* Fix HCT test for 0x400 pci memory:
+          * - need to report low 640 MB mem as motherboard resource
+          */
+@@ -1050,6 +1056,17 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, "Xen", "HVM", 0)
+                 Name (_ADR, 0x00020000) /* Dev 2, Func 0 */
+                 Name (_SUN, 0x00000002)
++                Name (VDOS, 0x0)
++                Method (_DOS, 1, NotSerialized)
++                {
++                    Store (Arg0, VDOS)
++                }
++
++                Method (_DOD, 0, NotSerialized)
++                {
++                    Return ( Package() { 0x00000400, } )
++                }
++
+                 Method (_PS0, 0)
+                 {
+                     Store (0x02, \_GPE.DPT1)
+@@ -1075,6 +1092,61 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, "Xen", "HVM", 0)
+                     Store (0x89, \_GPE.DPT2)
+                     Return (\_GPE.PH02) /* IN status as the _STA */
+                 }
++
++                Device (ODEV)
++                {
++                    Name ( BCUR, 0x0 )
++                    Name ( BLVL, Package(11) {} )
++
++                    Method (_ADR, 0, Serialized)
++                    {
++                        return ( 0x00000400 )
++                    }
++
++                    Method (_BCM, 1, Serialized)
++                    {
++                        Store ( Arg0, BCUR )
++                    }
++
++                    Method (_BQC, 0, Serialized)
++                    {
++                        Return ( BCUR )
++                    }
++
++                    Method (_BCL, 0)
++                    {
++                        Store (0, Local0)
++                        Store (11, Local1)
++
++                        Store ( 100, \_SB.BRI1) /* Read number of brightness levels */
++                        Store (\_SB.BRI1, Local2)
++
++                        If ( Or(LEqual(Local2, Local0), LGreater(Local2, Local1)) )
++                        {
++                            /* Bail out if we don't get brightness information from the underlying
++                             * firmware.
++                             */
++                            Return ( Package(11) { 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 99, } )
++                        }
++
++                        While ( LLess(Local0, Local1) )
++                        {
++                            Store (0, Index(BLVL, Local0))
++                            Increment (Local0)
++                        }
++
++                        Store (0, Local0)
++                        Store ( 101, \_SB.BRI1) /* Read brightness levels */
++                        While ( LLess(Local0, Local2) )
++                        {
++                            Store (\_SB.BRI1, Index(BLVL, Local0))
++                            Increment (Local0)
++                        }
++
++                        Store (102, \_SB.BRI1) /* Stop reading brightness levels */
++                        Return (BLVL)
++                    }
++                }
+             }
+             Device(S03)
index 5a34e123c3402ff889e2917f817f327ef36c514a..7778173e31381991ccee016d266945f816b623e4 100644 (file)
@@ -34,3 +34,4 @@ cope-with-dead-serial
 reset-atapi-after-failed-cd-boot
 vga-edid
 tboot-xen-fixes-01082010.patch
+guest-os-controlled-brightness-support