1 1.2 riastrad /* $NetBSD: radeon_acpi.h,v 1.3 2021/12/18 23:45:43 riastradh Exp $ */ 2 1.2 riastrad 3 1.1 riastrad /* 4 1.1 riastrad * Copyright 2012 Advanced Micro Devices, Inc. 5 1.1 riastrad * 6 1.1 riastrad * Permission is hereby granted, free of charge, to any person obtaining a 7 1.1 riastrad * copy of this software and associated documentation files (the "Software"), 8 1.1 riastrad * to deal in the Software without restriction, including without limitation 9 1.1 riastrad * the rights to use, copy, modify, merge, publish, distribute, sublicense, 10 1.1 riastrad * and/or sell copies of the Software, and to permit persons to whom the 11 1.1 riastrad * Software is furnished to do so, subject to the following conditions: 12 1.1 riastrad * 13 1.1 riastrad * The above copyright notice and this permission notice shall be included in 14 1.1 riastrad * all copies or substantial portions of the Software. 15 1.1 riastrad * 16 1.1 riastrad * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 1.1 riastrad * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 1.1 riastrad * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 19 1.1 riastrad * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 1.1 riastrad * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 1.1 riastrad * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 1.1 riastrad * OTHER DEALINGS IN THE SOFTWARE. 23 1.1 riastrad * 24 1.1 riastrad */ 25 1.1 riastrad 26 1.1 riastrad #ifndef RADEON_ACPI_H 27 1.1 riastrad #define RADEON_ACPI_H 28 1.1 riastrad 29 1.1 riastrad struct radeon_device; 30 1.1 riastrad struct acpi_bus_event; 31 1.1 riastrad 32 1.1 riastrad /* AMD hw uses four ACPI control methods: 33 1.1 riastrad * 1. ATIF 34 1.1 riastrad * ARG0: (ACPI_INTEGER) function code 35 1.1 riastrad * ARG1: (ACPI_BUFFER) parameter buffer, 256 bytes 36 1.1 riastrad * OUTPUT: (ACPI_BUFFER) output buffer, 256 bytes 37 1.1 riastrad * ATIF provides an entry point for the gfx driver to interact with the sbios. 38 1.1 riastrad * The AMD ACPI notification mechanism uses Notify (VGA, 0x81) or a custom 39 1.1 riastrad * notification. Which notification is used as indicated by the ATIF Control 40 1.1 riastrad * Method GET_SYSTEM_PARAMETERS. When the driver receives Notify (VGA, 0x81) or 41 1.1 riastrad * a custom notification it invokes ATIF Control Method GET_SYSTEM_BIOS_REQUESTS 42 1.1 riastrad * to identify pending System BIOS requests and associated parameters. For 43 1.1 riastrad * example, if one of the pending requests is DISPLAY_SWITCH_REQUEST, the driver 44 1.1 riastrad * will perform display device detection and invoke ATIF Control Method 45 1.1 riastrad * SELECT_ACTIVE_DISPLAYS. 46 1.1 riastrad * 47 1.1 riastrad * 2. ATPX 48 1.1 riastrad * ARG0: (ACPI_INTEGER) function code 49 1.1 riastrad * ARG1: (ACPI_BUFFER) parameter buffer, 256 bytes 50 1.1 riastrad * OUTPUT: (ACPI_BUFFER) output buffer, 256 bytes 51 1.1 riastrad * ATPX methods are used on PowerXpress systems to handle mux switching and 52 1.1 riastrad * discrete GPU power control. 53 1.1 riastrad * 54 1.1 riastrad * 3. ATRM 55 1.1 riastrad * ARG0: (ACPI_INTEGER) offset of vbios rom data 56 1.1 riastrad * ARG1: (ACPI_BUFFER) size of the buffer to fill (up to 4K). 57 1.1 riastrad * OUTPUT: (ACPI_BUFFER) output buffer 58 1.1 riastrad * ATRM provides an interfacess to access the discrete GPU vbios image on 59 1.1 riastrad * PowerXpress systems with multiple GPUs. 60 1.1 riastrad * 61 1.1 riastrad * 4. ATCS 62 1.1 riastrad * ARG0: (ACPI_INTEGER) function code 63 1.1 riastrad * ARG1: (ACPI_BUFFER) parameter buffer, 256 bytes 64 1.1 riastrad * OUTPUT: (ACPI_BUFFER) output buffer, 256 bytes 65 1.1 riastrad * ATCS provides an interface to AMD chipset specific functionality. 66 1.1 riastrad * 67 1.1 riastrad */ 68 1.1 riastrad /* ATIF */ 69 1.1 riastrad #define ATIF_FUNCTION_VERIFY_INTERFACE 0x0 70 1.1 riastrad /* ARG0: ATIF_FUNCTION_VERIFY_INTERFACE 71 1.1 riastrad * ARG1: none 72 1.1 riastrad * OUTPUT: 73 1.1 riastrad * WORD - structure size in bytes (includes size field) 74 1.1 riastrad * WORD - version 75 1.1 riastrad * DWORD - supported notifications mask 76 1.1 riastrad * DWORD - supported functions bit vector 77 1.1 riastrad */ 78 1.1 riastrad /* Notifications mask */ 79 1.1 riastrad # define ATIF_DISPLAY_SWITCH_REQUEST_SUPPORTED (1 << 0) 80 1.1 riastrad # define ATIF_EXPANSION_MODE_CHANGE_REQUEST_SUPPORTED (1 << 1) 81 1.1 riastrad # define ATIF_THERMAL_STATE_CHANGE_REQUEST_SUPPORTED (1 << 2) 82 1.1 riastrad # define ATIF_FORCED_POWER_STATE_CHANGE_REQUEST_SUPPORTED (1 << 3) 83 1.1 riastrad # define ATIF_SYSTEM_POWER_SOURCE_CHANGE_REQUEST_SUPPORTED (1 << 4) 84 1.1 riastrad # define ATIF_DISPLAY_CONF_CHANGE_REQUEST_SUPPORTED (1 << 5) 85 1.1 riastrad # define ATIF_PX_GFX_SWITCH_REQUEST_SUPPORTED (1 << 6) 86 1.1 riastrad # define ATIF_PANEL_BRIGHTNESS_CHANGE_REQUEST_SUPPORTED (1 << 7) 87 1.1 riastrad # define ATIF_DGPU_DISPLAY_EVENT_SUPPORTED (1 << 8) 88 1.1 riastrad /* supported functions vector */ 89 1.1 riastrad # define ATIF_GET_SYSTEM_PARAMETERS_SUPPORTED (1 << 0) 90 1.1 riastrad # define ATIF_GET_SYSTEM_BIOS_REQUESTS_SUPPORTED (1 << 1) 91 1.1 riastrad # define ATIF_SELECT_ACTIVE_DISPLAYS_SUPPORTED (1 << 2) 92 1.1 riastrad # define ATIF_GET_LID_STATE_SUPPORTED (1 << 3) 93 1.1 riastrad # define ATIF_GET_TV_STANDARD_FROM_CMOS_SUPPORTED (1 << 4) 94 1.1 riastrad # define ATIF_SET_TV_STANDARD_IN_CMOS_SUPPORTED (1 << 5) 95 1.1 riastrad # define ATIF_GET_PANEL_EXPANSION_MODE_FROM_CMOS_SUPPORTED (1 << 6) 96 1.1 riastrad # define ATIF_SET_PANEL_EXPANSION_MODE_IN_CMOS_SUPPORTED (1 << 7) 97 1.1 riastrad # define ATIF_TEMPERATURE_CHANGE_NOTIFICATION_SUPPORTED (1 << 12) 98 1.1 riastrad # define ATIF_GET_GRAPHICS_DEVICE_TYPES_SUPPORTED (1 << 14) 99 1.3 riastrad # define ATIF_GET_EXTERNAL_GPU_INFORMATION_SUPPORTED (1 << 20) 100 1.1 riastrad #define ATIF_FUNCTION_GET_SYSTEM_PARAMETERS 0x1 101 1.1 riastrad /* ARG0: ATIF_FUNCTION_GET_SYSTEM_PARAMETERS 102 1.1 riastrad * ARG1: none 103 1.1 riastrad * OUTPUT: 104 1.1 riastrad * WORD - structure size in bytes (includes size field) 105 1.1 riastrad * DWORD - valid flags mask 106 1.1 riastrad * DWORD - flags 107 1.1 riastrad * 108 1.1 riastrad * OR 109 1.1 riastrad * 110 1.1 riastrad * WORD - structure size in bytes (includes size field) 111 1.1 riastrad * DWORD - valid flags mask 112 1.1 riastrad * DWORD - flags 113 1.1 riastrad * BYTE - notify command code 114 1.1 riastrad * 115 1.1 riastrad * flags 116 1.1 riastrad * bits 1:0: 117 1.1 riastrad * 0 - Notify(VGA, 0x81) is not used for notification 118 1.1 riastrad * 1 - Notify(VGA, 0x81) is used for notification 119 1.1 riastrad * 2 - Notify(VGA, n) is used for notification where 120 1.1 riastrad * n (0xd0-0xd9) is specified in notify command code. 121 1.1 riastrad * bit 2: 122 1.1 riastrad * 1 - lid changes not reported though int10 123 1.1 riastrad */ 124 1.1 riastrad #define ATIF_FUNCTION_GET_SYSTEM_BIOS_REQUESTS 0x2 125 1.1 riastrad /* ARG0: ATIF_FUNCTION_GET_SYSTEM_BIOS_REQUESTS 126 1.1 riastrad * ARG1: none 127 1.1 riastrad * OUTPUT: 128 1.1 riastrad * WORD - structure size in bytes (includes size field) 129 1.1 riastrad * DWORD - pending sbios requests 130 1.1 riastrad * BYTE - panel expansion mode 131 1.1 riastrad * BYTE - thermal state: target gfx controller 132 1.1 riastrad * BYTE - thermal state: state id (0: exit state, non-0: state) 133 1.1 riastrad * BYTE - forced power state: target gfx controller 134 1.1 riastrad * BYTE - forced power state: state id 135 1.1 riastrad * BYTE - system power source 136 1.1 riastrad * BYTE - panel backlight level (0-255) 137 1.1 riastrad */ 138 1.1 riastrad /* pending sbios requests */ 139 1.1 riastrad # define ATIF_DISPLAY_SWITCH_REQUEST (1 << 0) 140 1.1 riastrad # define ATIF_EXPANSION_MODE_CHANGE_REQUEST (1 << 1) 141 1.1 riastrad # define ATIF_THERMAL_STATE_CHANGE_REQUEST (1 << 2) 142 1.1 riastrad # define ATIF_FORCED_POWER_STATE_CHANGE_REQUEST (1 << 3) 143 1.1 riastrad # define ATIF_SYSTEM_POWER_SOURCE_CHANGE_REQUEST (1 << 4) 144 1.1 riastrad # define ATIF_DISPLAY_CONF_CHANGE_REQUEST (1 << 5) 145 1.1 riastrad # define ATIF_PX_GFX_SWITCH_REQUEST (1 << 6) 146 1.1 riastrad # define ATIF_PANEL_BRIGHTNESS_CHANGE_REQUEST (1 << 7) 147 1.1 riastrad # define ATIF_DGPU_DISPLAY_EVENT (1 << 8) 148 1.1 riastrad /* panel expansion mode */ 149 1.1 riastrad # define ATIF_PANEL_EXPANSION_DISABLE 0 150 1.1 riastrad # define ATIF_PANEL_EXPANSION_FULL 1 151 1.1 riastrad # define ATIF_PANEL_EXPANSION_ASPECT 2 152 1.1 riastrad /* target gfx controller */ 153 1.1 riastrad # define ATIF_TARGET_GFX_SINGLE 0 154 1.1 riastrad # define ATIF_TARGET_GFX_PX_IGPU 1 155 1.1 riastrad # define ATIF_TARGET_GFX_PX_DGPU 2 156 1.1 riastrad /* system power source */ 157 1.1 riastrad # define ATIF_POWER_SOURCE_AC 1 158 1.1 riastrad # define ATIF_POWER_SOURCE_DC 2 159 1.1 riastrad # define ATIF_POWER_SOURCE_RESTRICTED_AC_1 3 160 1.1 riastrad # define ATIF_POWER_SOURCE_RESTRICTED_AC_2 4 161 1.1 riastrad #define ATIF_FUNCTION_SELECT_ACTIVE_DISPLAYS 0x3 162 1.1 riastrad /* ARG0: ATIF_FUNCTION_SELECT_ACTIVE_DISPLAYS 163 1.1 riastrad * ARG1: 164 1.1 riastrad * WORD - structure size in bytes (includes size field) 165 1.1 riastrad * WORD - selected displays 166 1.1 riastrad * WORD - connected displays 167 1.1 riastrad * OUTPUT: 168 1.1 riastrad * WORD - structure size in bytes (includes size field) 169 1.1 riastrad * WORD - selected displays 170 1.1 riastrad */ 171 1.1 riastrad # define ATIF_LCD1 (1 << 0) 172 1.1 riastrad # define ATIF_CRT1 (1 << 1) 173 1.1 riastrad # define ATIF_TV (1 << 2) 174 1.1 riastrad # define ATIF_DFP1 (1 << 3) 175 1.1 riastrad # define ATIF_CRT2 (1 << 4) 176 1.1 riastrad # define ATIF_LCD2 (1 << 5) 177 1.1 riastrad # define ATIF_DFP2 (1 << 7) 178 1.1 riastrad # define ATIF_CV (1 << 8) 179 1.1 riastrad # define ATIF_DFP3 (1 << 9) 180 1.1 riastrad # define ATIF_DFP4 (1 << 10) 181 1.1 riastrad # define ATIF_DFP5 (1 << 11) 182 1.1 riastrad # define ATIF_DFP6 (1 << 12) 183 1.1 riastrad #define ATIF_FUNCTION_GET_LID_STATE 0x4 184 1.1 riastrad /* ARG0: ATIF_FUNCTION_GET_LID_STATE 185 1.1 riastrad * ARG1: none 186 1.1 riastrad * OUTPUT: 187 1.1 riastrad * WORD - structure size in bytes (includes size field) 188 1.1 riastrad * BYTE - lid state (0: open, 1: closed) 189 1.1 riastrad * 190 1.1 riastrad * GET_LID_STATE only works at boot and resume, for general lid 191 1.1 riastrad * status, use the kernel provided status 192 1.1 riastrad */ 193 1.1 riastrad #define ATIF_FUNCTION_GET_TV_STANDARD_FROM_CMOS 0x5 194 1.1 riastrad /* ARG0: ATIF_FUNCTION_GET_TV_STANDARD_FROM_CMOS 195 1.1 riastrad * ARG1: none 196 1.1 riastrad * OUTPUT: 197 1.1 riastrad * WORD - structure size in bytes (includes size field) 198 1.1 riastrad * BYTE - 0 199 1.1 riastrad * BYTE - TV standard 200 1.1 riastrad */ 201 1.1 riastrad # define ATIF_TV_STD_NTSC 0 202 1.1 riastrad # define ATIF_TV_STD_PAL 1 203 1.1 riastrad # define ATIF_TV_STD_PALM 2 204 1.1 riastrad # define ATIF_TV_STD_PAL60 3 205 1.1 riastrad # define ATIF_TV_STD_NTSCJ 4 206 1.1 riastrad # define ATIF_TV_STD_PALCN 5 207 1.1 riastrad # define ATIF_TV_STD_PALN 6 208 1.1 riastrad # define ATIF_TV_STD_SCART_RGB 9 209 1.1 riastrad #define ATIF_FUNCTION_SET_TV_STANDARD_IN_CMOS 0x6 210 1.1 riastrad /* ARG0: ATIF_FUNCTION_SET_TV_STANDARD_IN_CMOS 211 1.1 riastrad * ARG1: 212 1.1 riastrad * WORD - structure size in bytes (includes size field) 213 1.1 riastrad * BYTE - 0 214 1.1 riastrad * BYTE - TV standard 215 1.1 riastrad * OUTPUT: none 216 1.1 riastrad */ 217 1.1 riastrad #define ATIF_FUNCTION_GET_PANEL_EXPANSION_MODE_FROM_CMOS 0x7 218 1.1 riastrad /* ARG0: ATIF_FUNCTION_GET_PANEL_EXPANSION_MODE_FROM_CMOS 219 1.1 riastrad * ARG1: none 220 1.1 riastrad * OUTPUT: 221 1.1 riastrad * WORD - structure size in bytes (includes size field) 222 1.1 riastrad * BYTE - panel expansion mode 223 1.1 riastrad */ 224 1.1 riastrad #define ATIF_FUNCTION_SET_PANEL_EXPANSION_MODE_IN_CMOS 0x8 225 1.1 riastrad /* ARG0: ATIF_FUNCTION_SET_PANEL_EXPANSION_MODE_IN_CMOS 226 1.1 riastrad * ARG1: 227 1.1 riastrad * WORD - structure size in bytes (includes size field) 228 1.1 riastrad * BYTE - panel expansion mode 229 1.1 riastrad * OUTPUT: none 230 1.1 riastrad */ 231 1.1 riastrad #define ATIF_FUNCTION_TEMPERATURE_CHANGE_NOTIFICATION 0xD 232 1.1 riastrad /* ARG0: ATIF_FUNCTION_TEMPERATURE_CHANGE_NOTIFICATION 233 1.1 riastrad * ARG1: 234 1.1 riastrad * WORD - structure size in bytes (includes size field) 235 1.1 riastrad * WORD - gfx controller id 236 1.1 riastrad * BYTE - current temperature (degress Celsius) 237 1.1 riastrad * OUTPUT: none 238 1.1 riastrad */ 239 1.1 riastrad #define ATIF_FUNCTION_GET_GRAPHICS_DEVICE_TYPES 0xF 240 1.1 riastrad /* ARG0: ATIF_FUNCTION_GET_GRAPHICS_DEVICE_TYPES 241 1.1 riastrad * ARG1: none 242 1.1 riastrad * OUTPUT: 243 1.1 riastrad * WORD - number of gfx devices 244 1.1 riastrad * WORD - device structure size in bytes (excludes device size field) 245 1.1 riastrad * DWORD - flags \ 246 1.1 riastrad * WORD - bus number } repeated structure 247 1.1 riastrad * WORD - device number / 248 1.1 riastrad */ 249 1.1 riastrad /* flags */ 250 1.1 riastrad # define ATIF_PX_REMOVABLE_GRAPHICS_DEVICE (1 << 0) 251 1.1 riastrad # define ATIF_XGP_PORT (1 << 1) 252 1.1 riastrad # define ATIF_VGA_ENABLED_GRAPHICS_DEVICE (1 << 2) 253 1.1 riastrad # define ATIF_XGP_PORT_IN_DOCK (1 << 3) 254 1.3 riastrad #define ATIF_FUNCTION_GET_EXTERNAL_GPU_INFORMATION 0x15 255 1.3 riastrad /* ARG0: ATIF_FUNCTION_GET_EXTERNAL_GPU_INFORMATION 256 1.3 riastrad * ARG1: none 257 1.3 riastrad * OUTPUT: 258 1.3 riastrad * WORD - number of reported external gfx devices 259 1.3 riastrad * WORD - device structure size in bytes (excludes device size field) 260 1.3 riastrad * WORD - flags \ 261 1.3 riastrad * WORD - bus number / repeated structure 262 1.3 riastrad */ 263 1.3 riastrad /* flags */ 264 1.3 riastrad # define ATIF_EXTERNAL_GRAPHICS_PORT (1 << 0) 265 1.1 riastrad 266 1.1 riastrad /* ATPX */ 267 1.1 riastrad #define ATPX_FUNCTION_VERIFY_INTERFACE 0x0 268 1.1 riastrad /* ARG0: ATPX_FUNCTION_VERIFY_INTERFACE 269 1.1 riastrad * ARG1: none 270 1.1 riastrad * OUTPUT: 271 1.1 riastrad * WORD - structure size in bytes (includes size field) 272 1.1 riastrad * WORD - version 273 1.1 riastrad * DWORD - supported functions bit vector 274 1.1 riastrad */ 275 1.1 riastrad /* supported functions vector */ 276 1.1 riastrad # define ATPX_GET_PX_PARAMETERS_SUPPORTED (1 << 0) 277 1.1 riastrad # define ATPX_POWER_CONTROL_SUPPORTED (1 << 1) 278 1.1 riastrad # define ATPX_DISPLAY_MUX_CONTROL_SUPPORTED (1 << 2) 279 1.1 riastrad # define ATPX_I2C_MUX_CONTROL_SUPPORTED (1 << 3) 280 1.1 riastrad # define ATPX_GRAPHICS_DEVICE_SWITCH_START_NOTIFICATION_SUPPORTED (1 << 4) 281 1.1 riastrad # define ATPX_GRAPHICS_DEVICE_SWITCH_END_NOTIFICATION_SUPPORTED (1 << 5) 282 1.1 riastrad # define ATPX_GET_DISPLAY_CONNECTORS_MAPPING_SUPPORTED (1 << 7) 283 1.1 riastrad # define ATPX_GET_DISPLAY_DETECTION_PORTS_SUPPORTED (1 << 8) 284 1.1 riastrad #define ATPX_FUNCTION_GET_PX_PARAMETERS 0x1 285 1.1 riastrad /* ARG0: ATPX_FUNCTION_GET_PX_PARAMETERS 286 1.1 riastrad * ARG1: none 287 1.1 riastrad * OUTPUT: 288 1.1 riastrad * WORD - structure size in bytes (includes size field) 289 1.1 riastrad * DWORD - valid flags mask 290 1.1 riastrad * DWORD - flags 291 1.1 riastrad */ 292 1.1 riastrad /* flags */ 293 1.1 riastrad # define ATPX_LVDS_I2C_AVAILABLE_TO_BOTH_GPUS (1 << 0) 294 1.1 riastrad # define ATPX_CRT1_I2C_AVAILABLE_TO_BOTH_GPUS (1 << 1) 295 1.1 riastrad # define ATPX_DVI1_I2C_AVAILABLE_TO_BOTH_GPUS (1 << 2) 296 1.1 riastrad # define ATPX_CRT1_RGB_SIGNAL_MUXED (1 << 3) 297 1.1 riastrad # define ATPX_TV_SIGNAL_MUXED (1 << 4) 298 1.1 riastrad # define ATPX_DFP_SIGNAL_MUXED (1 << 5) 299 1.1 riastrad # define ATPX_SEPARATE_MUX_FOR_I2C (1 << 6) 300 1.1 riastrad # define ATPX_DYNAMIC_PX_SUPPORTED (1 << 7) 301 1.1 riastrad # define ATPX_ACF_NOT_SUPPORTED (1 << 8) 302 1.1 riastrad # define ATPX_FIXED_NOT_SUPPORTED (1 << 9) 303 1.1 riastrad # define ATPX_DYNAMIC_DGPU_POWER_OFF_SUPPORTED (1 << 10) 304 1.1 riastrad # define ATPX_DGPU_REQ_POWER_FOR_DISPLAYS (1 << 11) 305 1.3 riastrad # define ATPX_DGPU_CAN_DRIVE_DISPLAYS (1 << 12) 306 1.3 riastrad # define ATPX_MS_HYBRID_GFX_SUPPORTED (1 << 14) 307 1.1 riastrad #define ATPX_FUNCTION_POWER_CONTROL 0x2 308 1.1 riastrad /* ARG0: ATPX_FUNCTION_POWER_CONTROL 309 1.1 riastrad * ARG1: 310 1.1 riastrad * WORD - structure size in bytes (includes size field) 311 1.1 riastrad * BYTE - dGPU power state (0: power off, 1: power on) 312 1.1 riastrad * OUTPUT: none 313 1.1 riastrad */ 314 1.1 riastrad #define ATPX_FUNCTION_DISPLAY_MUX_CONTROL 0x3 315 1.1 riastrad /* ARG0: ATPX_FUNCTION_DISPLAY_MUX_CONTROL 316 1.1 riastrad * ARG1: 317 1.1 riastrad * WORD - structure size in bytes (includes size field) 318 1.1 riastrad * WORD - display mux control (0: iGPU, 1: dGPU) 319 1.1 riastrad * OUTPUT: none 320 1.1 riastrad */ 321 1.1 riastrad # define ATPX_INTEGRATED_GPU 0 322 1.1 riastrad # define ATPX_DISCRETE_GPU 1 323 1.1 riastrad #define ATPX_FUNCTION_I2C_MUX_CONTROL 0x4 324 1.1 riastrad /* ARG0: ATPX_FUNCTION_I2C_MUX_CONTROL 325 1.1 riastrad * ARG1: 326 1.1 riastrad * WORD - structure size in bytes (includes size field) 327 1.1 riastrad * WORD - i2c/aux/hpd mux control (0: iGPU, 1: dGPU) 328 1.1 riastrad * OUTPUT: none 329 1.1 riastrad */ 330 1.1 riastrad #define ATPX_FUNCTION_GRAPHICS_DEVICE_SWITCH_START_NOTIFICATION 0x5 331 1.1 riastrad /* ARG0: ATPX_FUNCTION_GRAPHICS_DEVICE_SWITCH_START_NOTIFICATION 332 1.1 riastrad * ARG1: 333 1.1 riastrad * WORD - structure size in bytes (includes size field) 334 1.1 riastrad * WORD - target gpu (0: iGPU, 1: dGPU) 335 1.1 riastrad * OUTPUT: none 336 1.1 riastrad */ 337 1.1 riastrad #define ATPX_FUNCTION_GRAPHICS_DEVICE_SWITCH_END_NOTIFICATION 0x6 338 1.1 riastrad /* ARG0: ATPX_FUNCTION_GRAPHICS_DEVICE_SWITCH_END_NOTIFICATION 339 1.1 riastrad * ARG1: 340 1.1 riastrad * WORD - structure size in bytes (includes size field) 341 1.1 riastrad * WORD - target gpu (0: iGPU, 1: dGPU) 342 1.1 riastrad * OUTPUT: none 343 1.1 riastrad */ 344 1.1 riastrad #define ATPX_FUNCTION_GET_DISPLAY_CONNECTORS_MAPPING 0x8 345 1.1 riastrad /* ARG0: ATPX_FUNCTION_GET_DISPLAY_CONNECTORS_MAPPING 346 1.1 riastrad * ARG1: none 347 1.1 riastrad * OUTPUT: 348 1.1 riastrad * WORD - number of display connectors 349 1.1 riastrad * WORD - connector structure size in bytes (excludes connector size field) 350 1.1 riastrad * BYTE - flags \ 351 1.1 riastrad * BYTE - ATIF display vector bit position } repeated 352 1.1 riastrad * BYTE - adapter id (0: iGPU, 1-n: dGPU ordered by pcie bus number) } structure 353 1.1 riastrad * WORD - connector ACPI id / 354 1.1 riastrad */ 355 1.1 riastrad /* flags */ 356 1.1 riastrad # define ATPX_DISPLAY_OUTPUT_SUPPORTED_BY_ADAPTER_ID_DEVICE (1 << 0) 357 1.1 riastrad # define ATPX_DISPLAY_HPD_SUPPORTED_BY_ADAPTER_ID_DEVICE (1 << 1) 358 1.1 riastrad # define ATPX_DISPLAY_I2C_SUPPORTED_BY_ADAPTER_ID_DEVICE (1 << 2) 359 1.1 riastrad #define ATPX_FUNCTION_GET_DISPLAY_DETECTION_PORTS 0x9 360 1.1 riastrad /* ARG0: ATPX_FUNCTION_GET_DISPLAY_DETECTION_PORTS 361 1.1 riastrad * ARG1: none 362 1.1 riastrad * OUTPUT: 363 1.1 riastrad * WORD - number of HPD/DDC ports 364 1.1 riastrad * WORD - port structure size in bytes (excludes port size field) 365 1.1 riastrad * BYTE - ATIF display vector bit position \ 366 1.1 riastrad * BYTE - hpd id } reapeated structure 367 1.1 riastrad * BYTE - ddc id / 368 1.1 riastrad * 369 1.1 riastrad * available on A+A systems only 370 1.1 riastrad */ 371 1.1 riastrad /* hpd id */ 372 1.1 riastrad # define ATPX_HPD_NONE 0 373 1.1 riastrad # define ATPX_HPD1 1 374 1.1 riastrad # define ATPX_HPD2 2 375 1.1 riastrad # define ATPX_HPD3 3 376 1.1 riastrad # define ATPX_HPD4 4 377 1.1 riastrad # define ATPX_HPD5 5 378 1.1 riastrad # define ATPX_HPD6 6 379 1.1 riastrad /* ddc id */ 380 1.1 riastrad # define ATPX_DDC_NONE 0 381 1.1 riastrad # define ATPX_DDC1 1 382 1.1 riastrad # define ATPX_DDC2 2 383 1.1 riastrad # define ATPX_DDC3 3 384 1.1 riastrad # define ATPX_DDC4 4 385 1.1 riastrad # define ATPX_DDC5 5 386 1.1 riastrad # define ATPX_DDC6 6 387 1.1 riastrad # define ATPX_DDC7 7 388 1.1 riastrad # define ATPX_DDC8 8 389 1.1 riastrad 390 1.1 riastrad /* ATCS */ 391 1.1 riastrad #define ATCS_FUNCTION_VERIFY_INTERFACE 0x0 392 1.1 riastrad /* ARG0: ATCS_FUNCTION_VERIFY_INTERFACE 393 1.1 riastrad * ARG1: none 394 1.1 riastrad * OUTPUT: 395 1.1 riastrad * WORD - structure size in bytes (includes size field) 396 1.1 riastrad * WORD - version 397 1.1 riastrad * DWORD - supported functions bit vector 398 1.1 riastrad */ 399 1.1 riastrad /* supported functions vector */ 400 1.1 riastrad # define ATCS_GET_EXTERNAL_STATE_SUPPORTED (1 << 0) 401 1.1 riastrad # define ATCS_PCIE_PERFORMANCE_REQUEST_SUPPORTED (1 << 1) 402 1.1 riastrad # define ATCS_PCIE_DEVICE_READY_NOTIFICATION_SUPPORTED (1 << 2) 403 1.1 riastrad # define ATCS_SET_PCIE_BUS_WIDTH_SUPPORTED (1 << 3) 404 1.1 riastrad #define ATCS_FUNCTION_GET_EXTERNAL_STATE 0x1 405 1.1 riastrad /* ARG0: ATCS_FUNCTION_GET_EXTERNAL_STATE 406 1.1 riastrad * ARG1: none 407 1.1 riastrad * OUTPUT: 408 1.1 riastrad * WORD - structure size in bytes (includes size field) 409 1.1 riastrad * DWORD - valid flags mask 410 1.1 riastrad * DWORD - flags (0: undocked, 1: docked) 411 1.1 riastrad */ 412 1.1 riastrad /* flags */ 413 1.1 riastrad # define ATCS_DOCKED (1 << 0) 414 1.1 riastrad #define ATCS_FUNCTION_PCIE_PERFORMANCE_REQUEST 0x2 415 1.1 riastrad /* ARG0: ATCS_FUNCTION_PCIE_PERFORMANCE_REQUEST 416 1.1 riastrad * ARG1: 417 1.1 riastrad * WORD - structure size in bytes (includes size field) 418 1.1 riastrad * WORD - client id (bit 2-0: func num, 7-3: dev num, 15-8: bus num) 419 1.1 riastrad * WORD - valid flags mask 420 1.1 riastrad * WORD - flags 421 1.1 riastrad * BYTE - request type 422 1.1 riastrad * BYTE - performance request 423 1.1 riastrad * OUTPUT: 424 1.1 riastrad * WORD - structure size in bytes (includes size field) 425 1.1 riastrad * BYTE - return value 426 1.1 riastrad */ 427 1.1 riastrad /* flags */ 428 1.1 riastrad # define ATCS_ADVERTISE_CAPS (1 << 0) 429 1.1 riastrad # define ATCS_WAIT_FOR_COMPLETION (1 << 1) 430 1.1 riastrad /* request type */ 431 1.1 riastrad # define ATCS_PCIE_LINK_SPEED 1 432 1.1 riastrad /* performance request */ 433 1.1 riastrad # define ATCS_REMOVE 0 434 1.1 riastrad # define ATCS_FORCE_LOW_POWER 1 435 1.1 riastrad # define ATCS_PERF_LEVEL_1 2 /* PCIE Gen 1 */ 436 1.1 riastrad # define ATCS_PERF_LEVEL_2 3 /* PCIE Gen 2 */ 437 1.1 riastrad # define ATCS_PERF_LEVEL_3 4 /* PCIE Gen 3 */ 438 1.1 riastrad /* return value */ 439 1.1 riastrad # define ATCS_REQUEST_REFUSED 1 440 1.1 riastrad # define ATCS_REQUEST_COMPLETE 2 441 1.1 riastrad # define ATCS_REQUEST_IN_PROGRESS 3 442 1.1 riastrad #define ATCS_FUNCTION_PCIE_DEVICE_READY_NOTIFICATION 0x3 443 1.1 riastrad /* ARG0: ATCS_FUNCTION_PCIE_DEVICE_READY_NOTIFICATION 444 1.1 riastrad * ARG1: none 445 1.1 riastrad * OUTPUT: none 446 1.1 riastrad */ 447 1.1 riastrad #define ATCS_FUNCTION_SET_PCIE_BUS_WIDTH 0x4 448 1.1 riastrad /* ARG0: ATCS_FUNCTION_SET_PCIE_BUS_WIDTH 449 1.1 riastrad * ARG1: 450 1.1 riastrad * WORD - structure size in bytes (includes size field) 451 1.1 riastrad * WORD - client id (bit 2-0: func num, 7-3: dev num, 15-8: bus num) 452 1.1 riastrad * BYTE - number of active lanes 453 1.1 riastrad * OUTPUT: 454 1.1 riastrad * WORD - structure size in bytes (includes size field) 455 1.1 riastrad * BYTE - number of active lanes 456 1.1 riastrad */ 457 1.1 riastrad 458 1.1 riastrad #endif 459