xref: /dragonfly/sys/dev/drm/radeon/radeon_acpi.h (revision a85cb24f)
1926deccbSFrançois Tigeot /*
2926deccbSFrançois Tigeot  * Copyright 2012 Advanced Micro Devices, Inc.
3926deccbSFrançois Tigeot  *
4926deccbSFrançois Tigeot  * Permission is hereby granted, free of charge, to any person obtaining a
5926deccbSFrançois Tigeot  * copy of this software and associated documentation files (the "Software"),
6926deccbSFrançois Tigeot  * to deal in the Software without restriction, including without limitation
7926deccbSFrançois Tigeot  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8926deccbSFrançois Tigeot  * and/or sell copies of the Software, and to permit persons to whom the
9926deccbSFrançois Tigeot  * Software is furnished to do so, subject to the following conditions:
10926deccbSFrançois Tigeot  *
11926deccbSFrançois Tigeot  * The above copyright notice and this permission notice shall be included in
12926deccbSFrançois Tigeot  * all copies or substantial portions of the Software.
13926deccbSFrançois Tigeot  *
14926deccbSFrançois Tigeot  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15926deccbSFrançois Tigeot  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16926deccbSFrançois Tigeot  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17926deccbSFrançois Tigeot  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18926deccbSFrançois Tigeot  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19926deccbSFrançois Tigeot  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20926deccbSFrançois Tigeot  * OTHER DEALINGS IN THE SOFTWARE.
21926deccbSFrançois Tigeot  *
22926deccbSFrançois Tigeot  */
23926deccbSFrançois Tigeot 
24926deccbSFrançois Tigeot #ifndef RADEON_ACPI_H
25926deccbSFrançois Tigeot #define RADEON_ACPI_H
26926deccbSFrançois Tigeot 
277eacbf00SSascha Wildner #include <contrib/dev/acpica/source/include/acpi.h>
28926deccbSFrançois Tigeot 
29926deccbSFrançois Tigeot struct radeon_device;
30926deccbSFrançois Tigeot 
31926deccbSFrançois Tigeot void radeon_atif_handler(struct radeon_device *rdev, UINT32 type);
32926deccbSFrançois Tigeot 
33926deccbSFrançois Tigeot /* AMD hw uses four ACPI control methods:
34926deccbSFrançois Tigeot  * 1. ATIF
35926deccbSFrançois Tigeot  * ARG0: (ACPI_INTEGER) function code
36926deccbSFrançois Tigeot  * ARG1: (ACPI_BUFFER) parameter buffer, 256 bytes
37926deccbSFrançois Tigeot  * OUTPUT: (ACPI_BUFFER) output buffer, 256 bytes
38926deccbSFrançois Tigeot  * ATIF provides an entry point for the gfx driver to interact with the sbios.
39926deccbSFrançois Tigeot  * The AMD ACPI notification mechanism uses Notify (VGA, 0x81) or a custom
40926deccbSFrançois Tigeot  * notification. Which notification is used as indicated by the ATIF Control
41926deccbSFrançois Tigeot  * Method GET_SYSTEM_PARAMETERS. When the driver receives Notify (VGA, 0x81) or
42926deccbSFrançois Tigeot  * a custom notification it invokes ATIF Control Method GET_SYSTEM_BIOS_REQUESTS
43926deccbSFrançois Tigeot  * to identify pending System BIOS requests and associated parameters. For
44926deccbSFrançois Tigeot  * example, if one of the pending requests is DISPLAY_SWITCH_REQUEST, the driver
45926deccbSFrançois Tigeot  * will perform display device detection and invoke ATIF Control Method
46926deccbSFrançois Tigeot  * SELECT_ACTIVE_DISPLAYS.
47926deccbSFrançois Tigeot  *
48926deccbSFrançois Tigeot  * 2. ATPX
49926deccbSFrançois Tigeot  * ARG0: (ACPI_INTEGER) function code
50926deccbSFrançois Tigeot  * ARG1: (ACPI_BUFFER) parameter buffer, 256 bytes
51926deccbSFrançois Tigeot  * OUTPUT: (ACPI_BUFFER) output buffer, 256 bytes
52926deccbSFrançois Tigeot  * ATPX methods are used on PowerXpress systems to handle mux switching and
53926deccbSFrançois Tigeot  * discrete GPU power control.
54926deccbSFrançois Tigeot  *
55926deccbSFrançois Tigeot  * 3. ATRM
56926deccbSFrançois Tigeot  * ARG0: (ACPI_INTEGER) offset of vbios rom data
57926deccbSFrançois Tigeot  * ARG1: (ACPI_BUFFER) size of the buffer to fill (up to 4K).
58926deccbSFrançois Tigeot  * OUTPUT: (ACPI_BUFFER) output buffer
59926deccbSFrançois Tigeot  * ATRM provides an interfacess to access the discrete GPU vbios image on
60926deccbSFrançois Tigeot  * PowerXpress systems with multiple GPUs.
61926deccbSFrançois Tigeot  *
62926deccbSFrançois Tigeot  * 4. ATCS
63926deccbSFrançois Tigeot  * ARG0: (ACPI_INTEGER) function code
64926deccbSFrançois Tigeot  * ARG1: (ACPI_BUFFER) parameter buffer, 256 bytes
65926deccbSFrançois Tigeot  * OUTPUT: (ACPI_BUFFER) output buffer, 256 bytes
66926deccbSFrançois Tigeot  * ATCS provides an interface to AMD chipset specific functionality.
67926deccbSFrançois Tigeot  *
68926deccbSFrançois Tigeot  */
69926deccbSFrançois Tigeot /* ATIF */
70926deccbSFrançois Tigeot #define ATIF_FUNCTION_VERIFY_INTERFACE                             0x0
71926deccbSFrançois Tigeot /* ARG0: ATIF_FUNCTION_VERIFY_INTERFACE
72926deccbSFrançois Tigeot  * ARG1: none
73926deccbSFrançois Tigeot  * OUTPUT:
74926deccbSFrançois Tigeot  * WORD  - structure size in bytes (includes size field)
75926deccbSFrançois Tigeot  * WORD  - version
76926deccbSFrançois Tigeot  * DWORD - supported notifications mask
77926deccbSFrançois Tigeot  * DWORD - supported functions bit vector
78926deccbSFrançois Tigeot  */
79926deccbSFrançois Tigeot /* Notifications mask */
80926deccbSFrançois Tigeot #       define ATIF_DISPLAY_SWITCH_REQUEST_SUPPORTED               (1 << 0)
81926deccbSFrançois Tigeot #       define ATIF_EXPANSION_MODE_CHANGE_REQUEST_SUPPORTED        (1 << 1)
82926deccbSFrançois Tigeot #       define ATIF_THERMAL_STATE_CHANGE_REQUEST_SUPPORTED         (1 << 2)
83926deccbSFrançois Tigeot #       define ATIF_FORCED_POWER_STATE_CHANGE_REQUEST_SUPPORTED    (1 << 3)
84926deccbSFrançois Tigeot #       define ATIF_SYSTEM_POWER_SOURCE_CHANGE_REQUEST_SUPPORTED   (1 << 4)
85926deccbSFrançois Tigeot #       define ATIF_DISPLAY_CONF_CHANGE_REQUEST_SUPPORTED          (1 << 5)
86926deccbSFrançois Tigeot #       define ATIF_PX_GFX_SWITCH_REQUEST_SUPPORTED                (1 << 6)
87926deccbSFrançois Tigeot #       define ATIF_PANEL_BRIGHTNESS_CHANGE_REQUEST_SUPPORTED      (1 << 7)
88926deccbSFrançois Tigeot #       define ATIF_DGPU_DISPLAY_EVENT_SUPPORTED                   (1 << 8)
89926deccbSFrançois Tigeot /* supported functions vector */
90926deccbSFrançois Tigeot #       define ATIF_GET_SYSTEM_PARAMETERS_SUPPORTED               (1 << 0)
91926deccbSFrançois Tigeot #       define ATIF_GET_SYSTEM_BIOS_REQUESTS_SUPPORTED            (1 << 1)
92926deccbSFrançois Tigeot #       define ATIF_SELECT_ACTIVE_DISPLAYS_SUPPORTED              (1 << 2)
93926deccbSFrançois Tigeot #       define ATIF_GET_LID_STATE_SUPPORTED                       (1 << 3)
94926deccbSFrançois Tigeot #       define ATIF_GET_TV_STANDARD_FROM_CMOS_SUPPORTED           (1 << 4)
95926deccbSFrançois Tigeot #       define ATIF_SET_TV_STANDARD_IN_CMOS_SUPPORTED             (1 << 5)
96926deccbSFrançois Tigeot #       define ATIF_GET_PANEL_EXPANSION_MODE_FROM_CMOS_SUPPORTED  (1 << 6)
97926deccbSFrançois Tigeot #       define ATIF_SET_PANEL_EXPANSION_MODE_IN_CMOS_SUPPORTED    (1 << 7)
98926deccbSFrançois Tigeot #       define ATIF_TEMPERATURE_CHANGE_NOTIFICATION_SUPPORTED     (1 << 12)
99926deccbSFrançois Tigeot #       define ATIF_GET_GRAPHICS_DEVICE_TYPES_SUPPORTED           (1 << 14)
100*a85cb24fSFrançois Tigeot #       define ATIF_GET_EXTERNAL_GPU_INFORMATION_SUPPORTED        (1 << 20)
101926deccbSFrançois Tigeot #define ATIF_FUNCTION_GET_SYSTEM_PARAMETERS                        0x1
102926deccbSFrançois Tigeot /* ARG0: ATIF_FUNCTION_GET_SYSTEM_PARAMETERS
103926deccbSFrançois Tigeot  * ARG1: none
104926deccbSFrançois Tigeot  * OUTPUT:
105926deccbSFrançois Tigeot  * WORD  - structure size in bytes (includes size field)
106926deccbSFrançois Tigeot  * DWORD - valid flags mask
107926deccbSFrançois Tigeot  * DWORD - flags
108926deccbSFrançois Tigeot  *
109926deccbSFrançois Tigeot  * OR
110926deccbSFrançois Tigeot  *
111926deccbSFrançois Tigeot  * WORD  - structure size in bytes (includes size field)
112926deccbSFrançois Tigeot  * DWORD - valid flags mask
113926deccbSFrançois Tigeot  * DWORD - flags
114926deccbSFrançois Tigeot  * BYTE  - notify command code
115926deccbSFrançois Tigeot  *
116926deccbSFrançois Tigeot  * flags
117926deccbSFrançois Tigeot  * bits 1:0:
118926deccbSFrançois Tigeot  * 0 - Notify(VGA, 0x81) is not used for notification
119926deccbSFrançois Tigeot  * 1 - Notify(VGA, 0x81) is used for notification
120926deccbSFrançois Tigeot  * 2 - Notify(VGA, n) is used for notification where
121926deccbSFrançois Tigeot  * n (0xd0-0xd9) is specified in notify command code.
122926deccbSFrançois Tigeot  * bit 2:
123926deccbSFrançois Tigeot  * 1 - lid changes not reported though int10
124926deccbSFrançois Tigeot  */
125926deccbSFrançois Tigeot #define ATIF_FUNCTION_GET_SYSTEM_BIOS_REQUESTS                     0x2
126926deccbSFrançois Tigeot /* ARG0: ATIF_FUNCTION_GET_SYSTEM_BIOS_REQUESTS
127926deccbSFrançois Tigeot  * ARG1: none
128926deccbSFrançois Tigeot  * OUTPUT:
129926deccbSFrançois Tigeot  * WORD  - structure size in bytes (includes size field)
130926deccbSFrançois Tigeot  * DWORD - pending sbios requests
131926deccbSFrançois Tigeot  * BYTE  - panel expansion mode
132926deccbSFrançois Tigeot  * BYTE  - thermal state: target gfx controller
133926deccbSFrançois Tigeot  * BYTE  - thermal state: state id (0: exit state, non-0: state)
134926deccbSFrançois Tigeot  * BYTE  - forced power state: target gfx controller
135926deccbSFrançois Tigeot  * BYTE  - forced power state: state id
136926deccbSFrançois Tigeot  * BYTE  - system power source
137926deccbSFrançois Tigeot  * BYTE  - panel backlight level (0-255)
138926deccbSFrançois Tigeot  */
139926deccbSFrançois Tigeot /* pending sbios requests */
140926deccbSFrançois Tigeot #       define ATIF_DISPLAY_SWITCH_REQUEST                         (1 << 0)
141926deccbSFrançois Tigeot #       define ATIF_EXPANSION_MODE_CHANGE_REQUEST                  (1 << 1)
142926deccbSFrançois Tigeot #       define ATIF_THERMAL_STATE_CHANGE_REQUEST                   (1 << 2)
143926deccbSFrançois Tigeot #       define ATIF_FORCED_POWER_STATE_CHANGE_REQUEST              (1 << 3)
144926deccbSFrançois Tigeot #       define ATIF_SYSTEM_POWER_SOURCE_CHANGE_REQUEST             (1 << 4)
145926deccbSFrançois Tigeot #       define ATIF_DISPLAY_CONF_CHANGE_REQUEST                    (1 << 5)
146926deccbSFrançois Tigeot #       define ATIF_PX_GFX_SWITCH_REQUEST                          (1 << 6)
147926deccbSFrançois Tigeot #       define ATIF_PANEL_BRIGHTNESS_CHANGE_REQUEST                (1 << 7)
148926deccbSFrançois Tigeot #       define ATIF_DGPU_DISPLAY_EVENT                             (1 << 8)
149926deccbSFrançois Tigeot /* panel expansion mode */
150926deccbSFrançois Tigeot #       define ATIF_PANEL_EXPANSION_DISABLE                        0
151926deccbSFrançois Tigeot #       define ATIF_PANEL_EXPANSION_FULL                           1
152926deccbSFrançois Tigeot #       define ATIF_PANEL_EXPANSION_ASPECT                         2
153926deccbSFrançois Tigeot /* target gfx controller */
154926deccbSFrançois Tigeot #       define ATIF_TARGET_GFX_SINGLE                              0
155926deccbSFrançois Tigeot #       define ATIF_TARGET_GFX_PX_IGPU                             1
156926deccbSFrançois Tigeot #       define ATIF_TARGET_GFX_PX_DGPU                             2
157926deccbSFrançois Tigeot /* system power source */
158926deccbSFrançois Tigeot #       define ATIF_POWER_SOURCE_AC                                1
159926deccbSFrançois Tigeot #       define ATIF_POWER_SOURCE_DC                                2
160926deccbSFrançois Tigeot #       define ATIF_POWER_SOURCE_RESTRICTED_AC_1                   3
161926deccbSFrançois Tigeot #       define ATIF_POWER_SOURCE_RESTRICTED_AC_2                   4
162926deccbSFrançois Tigeot #define ATIF_FUNCTION_SELECT_ACTIVE_DISPLAYS                       0x3
163926deccbSFrançois Tigeot /* ARG0: ATIF_FUNCTION_SELECT_ACTIVE_DISPLAYS
164926deccbSFrançois Tigeot  * ARG1:
165926deccbSFrançois Tigeot  * WORD  - structure size in bytes (includes size field)
166926deccbSFrançois Tigeot  * WORD  - selected displays
167926deccbSFrançois Tigeot  * WORD  - connected displays
168926deccbSFrançois Tigeot  * OUTPUT:
169926deccbSFrançois Tigeot  * WORD  - structure size in bytes (includes size field)
170926deccbSFrançois Tigeot  * WORD  - selected displays
171926deccbSFrançois Tigeot  */
172926deccbSFrançois Tigeot #       define ATIF_LCD1                                           (1 << 0)
173926deccbSFrançois Tigeot #       define ATIF_CRT1                                           (1 << 1)
174926deccbSFrançois Tigeot #       define ATIF_TV                                             (1 << 2)
175926deccbSFrançois Tigeot #       define ATIF_DFP1                                           (1 << 3)
176926deccbSFrançois Tigeot #       define ATIF_CRT2                                           (1 << 4)
177926deccbSFrançois Tigeot #       define ATIF_LCD2                                           (1 << 5)
178926deccbSFrançois Tigeot #       define ATIF_DFP2                                           (1 << 7)
179926deccbSFrançois Tigeot #       define ATIF_CV                                             (1 << 8)
180926deccbSFrançois Tigeot #       define ATIF_DFP3                                           (1 << 9)
181926deccbSFrançois Tigeot #       define ATIF_DFP4                                           (1 << 10)
182926deccbSFrançois Tigeot #       define ATIF_DFP5                                           (1 << 11)
183926deccbSFrançois Tigeot #       define ATIF_DFP6                                           (1 << 12)
184926deccbSFrançois Tigeot #define ATIF_FUNCTION_GET_LID_STATE                                0x4
185926deccbSFrançois Tigeot /* ARG0: ATIF_FUNCTION_GET_LID_STATE
186926deccbSFrançois Tigeot  * ARG1: none
187926deccbSFrançois Tigeot  * OUTPUT:
188926deccbSFrançois Tigeot  * WORD  - structure size in bytes (includes size field)
189926deccbSFrançois Tigeot  * BYTE  - lid state (0: open, 1: closed)
190926deccbSFrançois Tigeot  *
191926deccbSFrançois Tigeot  * GET_LID_STATE only works at boot and resume, for general lid
192926deccbSFrançois Tigeot  * status, use the kernel provided status
193926deccbSFrançois Tigeot  */
194926deccbSFrançois Tigeot #define ATIF_FUNCTION_GET_TV_STANDARD_FROM_CMOS                    0x5
195926deccbSFrançois Tigeot /* ARG0: ATIF_FUNCTION_GET_TV_STANDARD_FROM_CMOS
196926deccbSFrançois Tigeot  * ARG1: none
197926deccbSFrançois Tigeot  * OUTPUT:
198926deccbSFrançois Tigeot  * WORD  - structure size in bytes (includes size field)
199926deccbSFrançois Tigeot  * BYTE  - 0
200926deccbSFrançois Tigeot  * BYTE  - TV standard
201926deccbSFrançois Tigeot  */
202926deccbSFrançois Tigeot #       define ATIF_TV_STD_NTSC                                    0
203926deccbSFrançois Tigeot #       define ATIF_TV_STD_PAL                                     1
204926deccbSFrançois Tigeot #       define ATIF_TV_STD_PALM                                    2
205926deccbSFrançois Tigeot #       define ATIF_TV_STD_PAL60                                   3
206926deccbSFrançois Tigeot #       define ATIF_TV_STD_NTSCJ                                   4
207926deccbSFrançois Tigeot #       define ATIF_TV_STD_PALCN                                   5
208926deccbSFrançois Tigeot #       define ATIF_TV_STD_PALN                                    6
209926deccbSFrançois Tigeot #       define ATIF_TV_STD_SCART_RGB                               9
210926deccbSFrançois Tigeot #define ATIF_FUNCTION_SET_TV_STANDARD_IN_CMOS                      0x6
211926deccbSFrançois Tigeot /* ARG0: ATIF_FUNCTION_SET_TV_STANDARD_IN_CMOS
212926deccbSFrançois Tigeot  * ARG1:
213926deccbSFrançois Tigeot  * WORD  - structure size in bytes (includes size field)
214926deccbSFrançois Tigeot  * BYTE  - 0
215926deccbSFrançois Tigeot  * BYTE  - TV standard
216926deccbSFrançois Tigeot  * OUTPUT: none
217926deccbSFrançois Tigeot  */
218926deccbSFrançois Tigeot #define ATIF_FUNCTION_GET_PANEL_EXPANSION_MODE_FROM_CMOS           0x7
219926deccbSFrançois Tigeot /* ARG0: ATIF_FUNCTION_GET_PANEL_EXPANSION_MODE_FROM_CMOS
220926deccbSFrançois Tigeot  * ARG1: none
221926deccbSFrançois Tigeot  * OUTPUT:
222926deccbSFrançois Tigeot  * WORD  - structure size in bytes (includes size field)
223926deccbSFrançois Tigeot  * BYTE  - panel expansion mode
224926deccbSFrançois Tigeot  */
225926deccbSFrançois Tigeot #define ATIF_FUNCTION_SET_PANEL_EXPANSION_MODE_IN_CMOS             0x8
226926deccbSFrançois Tigeot /* ARG0: ATIF_FUNCTION_SET_PANEL_EXPANSION_MODE_IN_CMOS
227926deccbSFrançois Tigeot  * ARG1:
228926deccbSFrançois Tigeot  * WORD  - structure size in bytes (includes size field)
229926deccbSFrançois Tigeot  * BYTE  - panel expansion mode
230926deccbSFrançois Tigeot  * OUTPUT: none
231926deccbSFrançois Tigeot  */
232926deccbSFrançois Tigeot #define ATIF_FUNCTION_TEMPERATURE_CHANGE_NOTIFICATION              0xD
233926deccbSFrançois Tigeot /* ARG0: ATIF_FUNCTION_TEMPERATURE_CHANGE_NOTIFICATION
234926deccbSFrançois Tigeot  * ARG1:
235926deccbSFrançois Tigeot  * WORD  - structure size in bytes (includes size field)
236926deccbSFrançois Tigeot  * WORD  - gfx controller id
237926deccbSFrançois Tigeot  * BYTE  - current temperature (degress Celsius)
238926deccbSFrançois Tigeot  * OUTPUT: none
239926deccbSFrançois Tigeot  */
240926deccbSFrançois Tigeot #define ATIF_FUNCTION_GET_GRAPHICS_DEVICE_TYPES                    0xF
241926deccbSFrançois Tigeot /* ARG0: ATIF_FUNCTION_GET_GRAPHICS_DEVICE_TYPES
242926deccbSFrançois Tigeot  * ARG1: none
243926deccbSFrançois Tigeot  * OUTPUT:
244926deccbSFrançois Tigeot  * WORD  - number of gfx devices
245926deccbSFrançois Tigeot  * WORD  - device structure size in bytes (excludes device size field)
246926deccbSFrançois Tigeot  * DWORD - flags         \
247926deccbSFrançois Tigeot  * WORD  - bus number     } repeated structure
248926deccbSFrançois Tigeot  * WORD  - device number /
249926deccbSFrançois Tigeot  */
250926deccbSFrançois Tigeot /* flags */
251926deccbSFrançois Tigeot #       define ATIF_PX_REMOVABLE_GRAPHICS_DEVICE                   (1 << 0)
252926deccbSFrançois Tigeot #       define ATIF_XGP_PORT                                       (1 << 1)
253926deccbSFrançois Tigeot #       define ATIF_VGA_ENABLED_GRAPHICS_DEVICE                    (1 << 2)
254926deccbSFrançois Tigeot #       define ATIF_XGP_PORT_IN_DOCK                               (1 << 3)
255*a85cb24fSFrançois Tigeot #define ATIF_FUNCTION_GET_EXTERNAL_GPU_INFORMATION                 0x15
256*a85cb24fSFrançois Tigeot /* ARG0: ATIF_FUNCTION_GET_EXTERNAL_GPU_INFORMATION
257*a85cb24fSFrançois Tigeot  * ARG1: none
258*a85cb24fSFrançois Tigeot  * OUTPUT:
259*a85cb24fSFrançois Tigeot  * WORD  - number of reported external gfx devices
260*a85cb24fSFrançois Tigeot  * WORD  - device structure size in bytes (excludes device size field)
261*a85cb24fSFrançois Tigeot  * WORD  - flags         \
262*a85cb24fSFrançois Tigeot  * WORD  - bus number    / repeated structure
263*a85cb24fSFrançois Tigeot  */
264*a85cb24fSFrançois Tigeot /* flags */
265*a85cb24fSFrançois Tigeot #       define ATIF_EXTERNAL_GRAPHICS_PORT                         (1 << 0)
266926deccbSFrançois Tigeot 
267926deccbSFrançois Tigeot /* ATPX */
268926deccbSFrançois Tigeot #define ATPX_FUNCTION_VERIFY_INTERFACE                             0x0
269926deccbSFrançois Tigeot /* ARG0: ATPX_FUNCTION_VERIFY_INTERFACE
270926deccbSFrançois Tigeot  * ARG1: none
271926deccbSFrançois Tigeot  * OUTPUT:
272926deccbSFrançois Tigeot  * WORD  - structure size in bytes (includes size field)
273926deccbSFrançois Tigeot  * WORD  - version
274926deccbSFrançois Tigeot  * DWORD - supported functions bit vector
275926deccbSFrançois Tigeot  */
276926deccbSFrançois Tigeot /* supported functions vector */
277926deccbSFrançois Tigeot #       define ATPX_GET_PX_PARAMETERS_SUPPORTED                    (1 << 0)
278926deccbSFrançois Tigeot #       define ATPX_POWER_CONTROL_SUPPORTED                        (1 << 1)
279926deccbSFrançois Tigeot #       define ATPX_DISPLAY_MUX_CONTROL_SUPPORTED                  (1 << 2)
280926deccbSFrançois Tigeot #       define ATPX_I2C_MUX_CONTROL_SUPPORTED                      (1 << 3)
281926deccbSFrançois Tigeot #       define ATPX_GRAPHICS_DEVICE_SWITCH_START_NOTIFICATION_SUPPORTED (1 << 4)
282926deccbSFrançois Tigeot #       define ATPX_GRAPHICS_DEVICE_SWITCH_END_NOTIFICATION_SUPPORTED   (1 << 5)
283926deccbSFrançois Tigeot #       define ATPX_GET_DISPLAY_CONNECTORS_MAPPING_SUPPORTED       (1 << 7)
284926deccbSFrançois Tigeot #       define ATPX_GET_DISPLAY_DETECTION_PORTS_SUPPORTED          (1 << 8)
285926deccbSFrançois Tigeot #define ATPX_FUNCTION_GET_PX_PARAMETERS                            0x1
286926deccbSFrançois Tigeot /* ARG0: ATPX_FUNCTION_GET_PX_PARAMETERS
287926deccbSFrançois Tigeot  * ARG1: none
288926deccbSFrançois Tigeot  * OUTPUT:
289926deccbSFrançois Tigeot  * WORD  - structure size in bytes (includes size field)
290926deccbSFrançois Tigeot  * DWORD - valid flags mask
291926deccbSFrançois Tigeot  * DWORD - flags
292926deccbSFrançois Tigeot  */
293926deccbSFrançois Tigeot /* flags */
294926deccbSFrançois Tigeot #       define ATPX_LVDS_I2C_AVAILABLE_TO_BOTH_GPUS                (1 << 0)
295926deccbSFrançois Tigeot #       define ATPX_CRT1_I2C_AVAILABLE_TO_BOTH_GPUS                (1 << 1)
296926deccbSFrançois Tigeot #       define ATPX_DVI1_I2C_AVAILABLE_TO_BOTH_GPUS                (1 << 2)
297926deccbSFrançois Tigeot #       define ATPX_CRT1_RGB_SIGNAL_MUXED                          (1 << 3)
298926deccbSFrançois Tigeot #       define ATPX_TV_SIGNAL_MUXED                                (1 << 4)
299926deccbSFrançois Tigeot #       define ATPX_DFP_SIGNAL_MUXED                               (1 << 5)
300926deccbSFrançois Tigeot #       define ATPX_SEPARATE_MUX_FOR_I2C                           (1 << 6)
301926deccbSFrançois Tigeot #       define ATPX_DYNAMIC_PX_SUPPORTED                           (1 << 7)
302926deccbSFrançois Tigeot #       define ATPX_ACF_NOT_SUPPORTED                              (1 << 8)
303926deccbSFrançois Tigeot #       define ATPX_FIXED_NOT_SUPPORTED                            (1 << 9)
304926deccbSFrançois Tigeot #       define ATPX_DYNAMIC_DGPU_POWER_OFF_SUPPORTED               (1 << 10)
305926deccbSFrançois Tigeot #       define ATPX_DGPU_REQ_POWER_FOR_DISPLAYS                    (1 << 11)
306d78d3a22SFrançois Tigeot #       define ATPX_DGPU_CAN_DRIVE_DISPLAYS                        (1 << 12)
307d78d3a22SFrançois Tigeot #       define ATPX_MS_HYBRID_GFX_SUPPORTED                        (1 << 14)
308926deccbSFrançois Tigeot #define ATPX_FUNCTION_POWER_CONTROL                                0x2
309926deccbSFrançois Tigeot /* ARG0: ATPX_FUNCTION_POWER_CONTROL
310926deccbSFrançois Tigeot  * ARG1:
311926deccbSFrançois Tigeot  * WORD  - structure size in bytes (includes size field)
312926deccbSFrançois Tigeot  * BYTE  - dGPU power state (0: power off, 1: power on)
313926deccbSFrançois Tigeot  * OUTPUT: none
314926deccbSFrançois Tigeot  */
315926deccbSFrançois Tigeot #define ATPX_FUNCTION_DISPLAY_MUX_CONTROL                          0x3
316926deccbSFrançois Tigeot /* ARG0: ATPX_FUNCTION_DISPLAY_MUX_CONTROL
317926deccbSFrançois Tigeot  * ARG1:
318926deccbSFrançois Tigeot  * WORD  - structure size in bytes (includes size field)
319926deccbSFrançois Tigeot  * WORD  - display mux control (0: iGPU, 1: dGPU)
320926deccbSFrançois Tigeot  * OUTPUT: none
321926deccbSFrançois Tigeot  */
322926deccbSFrançois Tigeot #       define ATPX_INTEGRATED_GPU                                 0
323926deccbSFrançois Tigeot #       define ATPX_DISCRETE_GPU                                   1
324926deccbSFrançois Tigeot #define ATPX_FUNCTION_I2C_MUX_CONTROL                              0x4
325926deccbSFrançois Tigeot /* ARG0: ATPX_FUNCTION_I2C_MUX_CONTROL
326926deccbSFrançois Tigeot  * ARG1:
327926deccbSFrançois Tigeot  * WORD  - structure size in bytes (includes size field)
328926deccbSFrançois Tigeot  * WORD  - i2c/aux/hpd mux control (0: iGPU, 1: dGPU)
329926deccbSFrançois Tigeot  * OUTPUT: none
330926deccbSFrançois Tigeot  */
331926deccbSFrançois Tigeot #define ATPX_FUNCTION_GRAPHICS_DEVICE_SWITCH_START_NOTIFICATION    0x5
332926deccbSFrançois Tigeot /* ARG0: ATPX_FUNCTION_GRAPHICS_DEVICE_SWITCH_START_NOTIFICATION
333926deccbSFrançois Tigeot  * ARG1:
334926deccbSFrançois Tigeot  * WORD  - structure size in bytes (includes size field)
335926deccbSFrançois Tigeot  * WORD  - target gpu (0: iGPU, 1: dGPU)
336926deccbSFrançois Tigeot  * OUTPUT: none
337926deccbSFrançois Tigeot  */
338926deccbSFrançois Tigeot #define ATPX_FUNCTION_GRAPHICS_DEVICE_SWITCH_END_NOTIFICATION      0x6
339926deccbSFrançois Tigeot /* ARG0: ATPX_FUNCTION_GRAPHICS_DEVICE_SWITCH_END_NOTIFICATION
340926deccbSFrançois Tigeot  * ARG1:
341926deccbSFrançois Tigeot  * WORD  - structure size in bytes (includes size field)
342926deccbSFrançois Tigeot  * WORD  - target gpu (0: iGPU, 1: dGPU)
343926deccbSFrançois Tigeot  * OUTPUT: none
344926deccbSFrançois Tigeot  */
345926deccbSFrançois Tigeot #define ATPX_FUNCTION_GET_DISPLAY_CONNECTORS_MAPPING               0x8
346926deccbSFrançois Tigeot /* ARG0: ATPX_FUNCTION_GET_DISPLAY_CONNECTORS_MAPPING
347926deccbSFrançois Tigeot  * ARG1: none
348926deccbSFrançois Tigeot  * OUTPUT:
349926deccbSFrançois Tigeot  * WORD  - number of display connectors
350926deccbSFrançois Tigeot  * WORD  - connector structure size in bytes (excludes connector size field)
351926deccbSFrançois Tigeot  * BYTE  - flags                                                     \
352926deccbSFrançois Tigeot  * BYTE  - ATIF display vector bit position                           } repeated
353926deccbSFrançois Tigeot  * BYTE  - adapter id (0: iGPU, 1-n: dGPU ordered by pcie bus number) } structure
354926deccbSFrançois Tigeot  * WORD  - connector ACPI id                                         /
355926deccbSFrançois Tigeot  */
356926deccbSFrançois Tigeot /* flags */
357926deccbSFrançois Tigeot #       define ATPX_DISPLAY_OUTPUT_SUPPORTED_BY_ADAPTER_ID_DEVICE  (1 << 0)
358926deccbSFrançois Tigeot #       define ATPX_DISPLAY_HPD_SUPPORTED_BY_ADAPTER_ID_DEVICE     (1 << 1)
359926deccbSFrançois Tigeot #       define ATPX_DISPLAY_I2C_SUPPORTED_BY_ADAPTER_ID_DEVICE     (1 << 2)
360926deccbSFrançois Tigeot #define ATPX_FUNCTION_GET_DISPLAY_DETECTION_PORTS                  0x9
361926deccbSFrançois Tigeot /* ARG0: ATPX_FUNCTION_GET_DISPLAY_DETECTION_PORTS
362926deccbSFrançois Tigeot  * ARG1: none
363926deccbSFrançois Tigeot  * OUTPUT:
364926deccbSFrançois Tigeot  * WORD  - number of HPD/DDC ports
365926deccbSFrançois Tigeot  * WORD  - port structure size in bytes (excludes port size field)
366926deccbSFrançois Tigeot  * BYTE  - ATIF display vector bit position \
367926deccbSFrançois Tigeot  * BYTE  - hpd id                            } reapeated structure
368926deccbSFrançois Tigeot  * BYTE  - ddc id                           /
369926deccbSFrançois Tigeot  *
370926deccbSFrançois Tigeot  * available on A+A systems only
371926deccbSFrançois Tigeot  */
372926deccbSFrançois Tigeot /* hpd id */
373926deccbSFrançois Tigeot #       define ATPX_HPD_NONE                                       0
374926deccbSFrançois Tigeot #       define ATPX_HPD1                                           1
375926deccbSFrançois Tigeot #       define ATPX_HPD2                                           2
376926deccbSFrançois Tigeot #       define ATPX_HPD3                                           3
377926deccbSFrançois Tigeot #       define ATPX_HPD4                                           4
378926deccbSFrançois Tigeot #       define ATPX_HPD5                                           5
379926deccbSFrançois Tigeot #       define ATPX_HPD6                                           6
380926deccbSFrançois Tigeot /* ddc id */
381926deccbSFrançois Tigeot #       define ATPX_DDC_NONE                                       0
382926deccbSFrançois Tigeot #       define ATPX_DDC1                                           1
383926deccbSFrançois Tigeot #       define ATPX_DDC2                                           2
384926deccbSFrançois Tigeot #       define ATPX_DDC3                                           3
385926deccbSFrançois Tigeot #       define ATPX_DDC4                                           4
386926deccbSFrançois Tigeot #       define ATPX_DDC5                                           5
387926deccbSFrançois Tigeot #       define ATPX_DDC6                                           6
388926deccbSFrançois Tigeot #       define ATPX_DDC7                                           7
389926deccbSFrançois Tigeot #       define ATPX_DDC8                                           8
390926deccbSFrançois Tigeot 
391926deccbSFrançois Tigeot /* ATCS */
392926deccbSFrançois Tigeot #define ATCS_FUNCTION_VERIFY_INTERFACE                             0x0
393926deccbSFrançois Tigeot /* ARG0: ATCS_FUNCTION_VERIFY_INTERFACE
394926deccbSFrançois Tigeot  * ARG1: none
395926deccbSFrançois Tigeot  * OUTPUT:
396926deccbSFrançois Tigeot  * WORD  - structure size in bytes (includes size field)
397926deccbSFrançois Tigeot  * WORD  - version
398926deccbSFrançois Tigeot  * DWORD - supported functions bit vector
399926deccbSFrançois Tigeot  */
400926deccbSFrançois Tigeot /* supported functions vector */
401926deccbSFrançois Tigeot #       define ATCS_GET_EXTERNAL_STATE_SUPPORTED                   (1 << 0)
402926deccbSFrançois Tigeot #       define ATCS_PCIE_PERFORMANCE_REQUEST_SUPPORTED             (1 << 1)
403926deccbSFrançois Tigeot #       define ATCS_PCIE_DEVICE_READY_NOTIFICATION_SUPPORTED       (1 << 2)
404926deccbSFrançois Tigeot #       define ATCS_SET_PCIE_BUS_WIDTH_SUPPORTED                   (1 << 3)
405926deccbSFrançois Tigeot #define ATCS_FUNCTION_GET_EXTERNAL_STATE                           0x1
406926deccbSFrançois Tigeot /* ARG0: ATCS_FUNCTION_GET_EXTERNAL_STATE
407926deccbSFrançois Tigeot  * ARG1: none
408926deccbSFrançois Tigeot  * OUTPUT:
409926deccbSFrançois Tigeot  * WORD  - structure size in bytes (includes size field)
410926deccbSFrançois Tigeot  * DWORD - valid flags mask
411926deccbSFrançois Tigeot  * DWORD - flags (0: undocked, 1: docked)
412926deccbSFrançois Tigeot  */
413926deccbSFrançois Tigeot /* flags */
414926deccbSFrançois Tigeot #       define ATCS_DOCKED                                         (1 << 0)
415926deccbSFrançois Tigeot #define ATCS_FUNCTION_PCIE_PERFORMANCE_REQUEST                     0x2
416926deccbSFrançois Tigeot /* ARG0: ATCS_FUNCTION_PCIE_PERFORMANCE_REQUEST
417926deccbSFrançois Tigeot  * ARG1:
418926deccbSFrançois Tigeot  * WORD  - structure size in bytes (includes size field)
419926deccbSFrançois Tigeot  * WORD  - client id (bit 2-0: func num, 7-3: dev num, 15-8: bus num)
420926deccbSFrançois Tigeot  * WORD  - valid flags mask
421926deccbSFrançois Tigeot  * WORD  - flags
422926deccbSFrançois Tigeot  * BYTE  - request type
423926deccbSFrançois Tigeot  * BYTE  - performance request
424926deccbSFrançois Tigeot  * OUTPUT:
425926deccbSFrançois Tigeot  * WORD  - structure size in bytes (includes size field)
426926deccbSFrançois Tigeot  * BYTE  - return value
427926deccbSFrançois Tigeot  */
428926deccbSFrançois Tigeot /* flags */
429926deccbSFrançois Tigeot #       define ATCS_ADVERTISE_CAPS                                 (1 << 0)
430926deccbSFrançois Tigeot #       define ATCS_WAIT_FOR_COMPLETION                            (1 << 1)
431926deccbSFrançois Tigeot /* request type */
432926deccbSFrançois Tigeot #       define ATCS_PCIE_LINK_SPEED                                1
433926deccbSFrançois Tigeot /* performance request */
434926deccbSFrançois Tigeot #       define ATCS_REMOVE                                         0
435926deccbSFrançois Tigeot #       define ATCS_FORCE_LOW_POWER                                1
436926deccbSFrançois Tigeot #       define ATCS_PERF_LEVEL_1                                   2 /* PCIE Gen 1 */
437926deccbSFrançois Tigeot #       define ATCS_PERF_LEVEL_2                                   3 /* PCIE Gen 2 */
438926deccbSFrançois Tigeot #       define ATCS_PERF_LEVEL_3                                   4 /* PCIE Gen 3 */
439926deccbSFrançois Tigeot /* return value */
440926deccbSFrançois Tigeot #       define ATCS_REQUEST_REFUSED                                1
441926deccbSFrançois Tigeot #       define ATCS_REQUEST_COMPLETE                               2
442926deccbSFrançois Tigeot #       define ATCS_REQUEST_IN_PROGRESS                            3
443926deccbSFrançois Tigeot #define ATCS_FUNCTION_PCIE_DEVICE_READY_NOTIFICATION               0x3
444926deccbSFrançois Tigeot /* ARG0: ATCS_FUNCTION_PCIE_DEVICE_READY_NOTIFICATION
445926deccbSFrançois Tigeot  * ARG1: none
446926deccbSFrançois Tigeot  * OUTPUT: none
447926deccbSFrançois Tigeot  */
448926deccbSFrançois Tigeot #define ATCS_FUNCTION_SET_PCIE_BUS_WIDTH                           0x4
449926deccbSFrançois Tigeot /* ARG0: ATCS_FUNCTION_SET_PCIE_BUS_WIDTH
450926deccbSFrançois Tigeot  * ARG1:
451926deccbSFrançois Tigeot  * WORD  - structure size in bytes (includes size field)
452926deccbSFrançois Tigeot  * WORD  - client id (bit 2-0: func num, 7-3: dev num, 15-8: bus num)
453926deccbSFrançois Tigeot  * BYTE  - number of active lanes
454926deccbSFrançois Tigeot  * OUTPUT:
455926deccbSFrançois Tigeot  * WORD  - structure size in bytes (includes size field)
456926deccbSFrançois Tigeot  * BYTE  - number of active lanes
457926deccbSFrançois Tigeot  */
458926deccbSFrançois Tigeot 
459926deccbSFrançois Tigeot #endif
460