summaryrefslogtreecommitdiff
path: root/Board/EM/SwitchableGraphics/SgTpv/AcpiTables/SgTpvPEG/NViGDmisc.asl
blob: e81c4a65860ef7e8f41bd252c9dda3aa95f4e6c4 (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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
//****************************************************************************
//****************************************************************************
//**                                                                        **
//**         (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/SgTpvPEG/NViGDmisc.asl 1     1/15/13 5:59a Joshchou $
//
// $Revision: 1 $
//
// $Date: 1/15/13 5:59a $
//**********************************************************************
// Revision History
// ----------------
// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/SwitchableGraphics/Sg TPV/Sg Acpi Tables/SgTpvPEG/NViGDmisc.asl $
// 
// 1     1/15/13 5:59a Joshchou
// [TAG]  		None
// [Category]  	Improvement
// [Description]  	Create componet for SG support on PEG
// [Files]  		SgNvidia.cif
// NvSSDT.asl
// NVdGPU.asl
// NViGPU.asl
// NViGDmisc.asl
// OpSSDT.asl
// NvVentura.asl
// NvGPS.asl
// 
// 2     9/09/12 11:04p Joshchou
// [TAG]  		EIPNone
// [Category]  	Improvement
// [Description]  	Tpv module support for sharkbay.
// [Files]  		NvSSDT.asl
// NVdGPU.asl
// NViGPU.asl
// NViGDmisc.asl
// OpSSDT.asl
// NvVentura.asl
// NvGPS.asl
// 
// 1     6/27/11 5:27a Alanlin
// [TAG]  		EIP61848
// [Category]  	New Feature
// [Description]  	Initial check-in.Integrated SwitchableGraphics Intel
// Reference code 0.6.0
// [Files]  		SgNvidia.cif
// NvSSDT.asl
// NVdGPU.asl
// NViGPU.asl
// NViGDmisc.asl
// OpSSDT.asl
// NvVentura.asl
// 
// 
// 4     11/12/10 1:27p Alexp
// Change IDAB method: invoke IGD_SCOPE.IDAB is it's defined 
// 
// 3     10/08/10 12:04p Alexp
// code clean up: removed unused externs
// 
// 2     10/05/10 7:14p Alexp
// 1. Added debug macro to be able to insert check points in target ASL
// code
// 2. Reuse NVdGPU.asl file to build OpSSDT for Optimus and NvSSDT for
// MUXed SG targets.
//     NvOptimus.asl no longer required
// 
// 1     9/17/10 1:21p Alexp
// [TAG]    	  EIP43103 
// [Category]  Function Request
// [Severity]	  Normal
// [Symptom]    Initial check-in of SgTPV module
// [RootCause] Request to implement SG reference code .
// [Solution]	Initial check-in. 
// [Files]	
//         SgNvidia.cif;
//         NvSSDT.asl; NVdGPU.asl;NViGPU.asl;NViGDmisc
//         OpSSDT.asl;NvOptimus.asl;NvVenture.asl
// 
// 1     6/08/10 3:45p Alexp
// 
// 1     6/03/10 2:54p Alexp
// 
// 6     10/05/09 5:35p Alexp
// updated asl code for Ati and Nvidia according to Calpella SG BWG 1.1
// 
// 5     8/20/09 7:08p Alexp
// upgraded Ati and Nvidia SSDT Asl files to match latest Acpi code drop
// #68
// 
// 4     8/10/09 4:21p Alexp
// changed with latest reference code from Intel MPG. not yet tested
// 
// 3     7/16/09 11:17a Alexp
// Added SG support for AMD ATI Gfx adaptors
// 
// 
//**********************************************************************

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                      **
//**                                                                  **
//**********************************************************************
//**********************************************************************