summaryrefslogtreecommitdiff
path: root/Board/EM/SwitchableGraphics/SgTpv/AcpiTables/OEMSSDT/OEMNViGDmisc.asl
blob: 6e3ee2e745c53a762885080a30eb1a656ab2d502 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
//****************************************************************************
//****************************************************************************
//**                                                                        **
//**         (C)Copyright 1985-2012, American Megatrends, Inc.              **
//**                                                                        **
//**                          All Rights Reserved.                          **
//**                                                                        **
//**         5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093           **
//**                                                                        **
//**                          Phone (770)-246-8600                          **
//**                                                                        **
//****************************************************************************
//****************************************************************************
//****************************************************************************
//**********************************************************************
// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/SwitchableGraphics/Sg TPV/Sg Acpi Tables/OEMSSDT/OEMNViGDmisc.asl 2     9/09/12 11:01p Joshchou $
//
// $Revision: 2 $
//
// $Date: 9/09/12 11:01p $
//**********************************************************************
// Revision History
// ----------------
// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/SwitchableGraphics/Sg TPV/Sg Acpi Tables/OEMSSDT/OEMNViGDmisc.asl $
// 
// 2     9/09/12 11:01p Joshchou
// [TAG]  		None
// [Category]  	Improvement
// [Description]  	Tpv module support for sharkbay.
// [Files]  		OEMSSDT.mak
// OEMSSDT.asl
// OEMNVdGPU.asl
// OEMNViGPU.asl
// OEMNViGDmisc.asl
// OEMNvVentura.asl
// OEMNvGPS.asl
// OEMSSDT.cif
// 
// 1     12/12/11 9:10p Alanlin
// 
// 
// 
//**********************************************************************

External(DSEN)
External(IGPU_SCOPE.CDCK)
External(DGPU_SCOPE.DD02)
External(IGPU_SCOPE.IDAB, MethodObj)

//Do not remove this function.
Method(IDAB, 0, Serialized)
{
    If (CondRefOf(IGPU_SCOPE.IDAB))
    {
        IGPU_SCOPE.IDAB()
    }
}

//<AMI_PHDR_START>
//------------------------------------------------------------------------
//
// Procedure:    HGAS
//
// Description:  HG Adaptor select, notify
//
//-------------------------------------------------------------------------
//<AMI_PHDR_END> 
Method(HGAS) //HG Adaptor select
{
    //Stateless button/Hotkey supporting 3 states - Power Saver, Adaptive and Perf
    
    Increment(IGPU_SCOPE.GPSS)
    Mod(IGPU_SCOPE.GPSS, 3, IGPU_SCOPE.GPSS)

    Store(1,IGPU_SCOPE.GPPO)
    Store(1,IGPU_SCOPE.SGNC)    //indicate 'policy select' change

    Notify(IGPU_SCOPE, 0xD0)
    Notify(PCI_SCOPE.WMI1, 0xD0)    // Mirror Notify on WMI1

}

//<AMI_PHDR_START>
//------------------------------------------------------------------------
//
// Procedure:    HBRT
//
// Description:  Send backlight notifications to the DGPU LFP device
//              This is required for Win7 and is backward compatible with Vista
//
// Input:       Arg0 - 4 - Brightnes Down, 3- Up
//-------------------------------------------------------------------------
//<AMI_PHDR_END> 
Method(HBRT, 1 , Serialized)
{
    Store(Arg0,IGPU_SCOPE.DACE)
  
    If(And(4,DSEN))     //Note: DSEN variable is expected to be set by IGD miniport only.
    {
        If(LEqual(Arg0,4))
        {   
            Notify(DGPU_SCOPE.DD02,0x87)  //Note: DD02 is hardcoded as the LFP device in intelgfx.asl
        }
        If(LEqual(Arg0,3))
        {
            Notify(DGPU_SCOPE.DD02,0x86)
        }
    }       
    
}

//<AMI_PHDR_START>
//------------------------------------------------------------------------
//
// Procedure:    HPFS
//
// Description:  Panel Fitting Hot Key
//
// Input:       None
//-------------------------------------------------------------------------
//<AMI_PHDR_END> 
Method(HPFS, 0, Serialized)     //Panel Fitting Hot Key
{
    //
    // HG Handling of Panel Fitting Switch
    //

    Store(5,IGPU_SCOPE.DACE)  // Indicate display scaling hot key event
    Store(2,IGPU_SCOPE.SGNC)  // Indicate platpolicy change

    //
    // Expansion Mode toggling
    //
    Increment(IGPU_SCOPE.GPSP)
    Mod(IGPU_SCOPE.GPSP, 4 , IGPU_SCOPE.GPSP)    

    Notify(IGPU_SCOPE,0xDC)

}


//<AMI_PHDR_START>
//------------------------------------------------------------------------
//
// Procedure:    HNOT
//
// Description:  Notification handler for Switchable graphics. Called from GNOT()
//
// Input:	Arg0 = Current event type:
//			1 = display switch
//			2 = lid
//			3 = dock (!!!!!Acpi ref code, Method(GDCK)sends 4 for Dock notifications )
//-------------------------------------------------------------------------
//<AMI_PHDR_END> 
Method (HNOT, 1, Serialized)
{
    Switch(ToInteger(Arg0))
    {
        case(1) //Display Switch event
        {            
            Store(3,IGPU_SCOPE.SGNC)    // indicate 'Displaystatus' change
            Store(1,IGPU_SCOPE.DACE)
            Notify(IGPU_SCOPE, 0x80)
            Notify(PCI_SCOPE.WMI1, 0x80)    // Mirror Notify on WMI1
        }

        case (2) //Lid switch event
        {
            //Note: NV clarified that only LDES needs to be set           
            Store(1,IGPU_SCOPE.LDES)            
            Notify(IGPU_SCOPE, 0xDB)
            Notify(PCI_SCOPE.WMI1, 0xDB)    // Mirror Notify on WMI1
        }
//        case (3) //Dock event
        case (4) //Dock event (!!!Acpi ref code, Method(GDCK)sends 4 for Dock notifications)
        {
            Store(IGPU_SCOPE.CDCK, IGPU_SCOPE.DKST) // Store the current dock state
            Notify(IGPU_SCOPE, 0x81)     
            Notify(PCI_SCOPE.WMI1, 0x81)    // Mirror Notify on WMI1
        }

        Default 
        {
            Notify(IGPU_SCOPE,0x80)
        }
        
    }

}

//<AMI_PHDR_START>
//------------------------------------------------------------------------
//
// Procedure:    CHPS
//
// Description:  Shows current Hybrid Policy status on Port80 header
//         Adaptive -> 1, Save power -> 2 and High performance -> 3
//
// Input:	None
//-------------------------------------------------------------------------
//<AMI_PHDR_END> 
Method(CHPS)
{
    P8DB(0xEC, Add(IGPU_SCOPE.GPSS, 1), 2000)
}


//<AMI_PHDR_START>
//------------------------------------------------------------------------
//
// Procedure:    HDOS
//
// Description:  Check if the _DOS flag was set during the hot key handling
//
// Input:	None
//-------------------------------------------------------------------------
//<AMI_PHDR_END> 
Method(HDOS, 0, Serialized)
{
    If(LEqual(IGPU_SCOPE.DOSF,1))
    {                
        Store(1,IGPU_SCOPE.SGNC)    // indicate 'policy select' change
        Notify(IGPU_SCOPE,0xD0)
        Notify(PCI_SCOPE.WMI1, 0xD0)    // Mirror Notify on WMI1
        Store(0, IGPU_SCOPE.DOSF)   // Clear the DOSF
    }
}
//**********************************************************************
//**********************************************************************
//**********************************************************************
//**                                                                  **
//**        (C)Copyright 1985-2012, American Megatrends, Inc.         **
//**                                                                  **
//**                       All Rights Reserved.                       **
//**                                                                  **
//**        5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093         **
//**                                                                  **
//**                       Phone: (770)-246-8600                      **
//**                                                                  **
//**********************************************************************
//**********************************************************************