1 #ifndef __NVIF_CLASS_H__
2 #define __NVIF_CLASS_H__
4 /* these class numbers are made up by us, and not nvidia-assigned */
5 #define NVIF_CLASS_CONTROL -1
6 #define NVIF_CLASS_PERFMON -2
7 #define NVIF_CLASS_PERFDOM -3
8 #define NVIF_CLASS_SW_NV04 -4
9 #define NVIF_CLASS_SW_NV10 -5
10 #define NVIF_CLASS_SW_NV50 -6
11 #define NVIF_CLASS_SW_GF100 -7
13 /* the below match nvidia-assigned (either in hw, or sw) class numbers */
14 #define NV_DEVICE 0x00000080
16 #define NV_DMA_FROM_MEMORY 0x00000002
17 #define NV_DMA_TO_MEMORY 0x00000003
18 #define NV_DMA_IN_MEMORY 0x0000003d
20 #define FERMI_TWOD_A 0x0000902d
22 #define FERMI_MEMORY_TO_MEMORY_FORMAT_A 0x00009039
24 #define KEPLER_INLINE_TO_MEMORY_A 0x0000a040
25 #define KEPLER_INLINE_TO_MEMORY_B 0x0000a140
27 #define NV04_DISP 0x00000046
29 #define NV03_CHANNEL_DMA 0x0000006b
30 #define NV10_CHANNEL_DMA 0x0000006e
31 #define NV17_CHANNEL_DMA 0x0000176e
32 #define NV40_CHANNEL_DMA 0x0000406e
33 #define NV50_CHANNEL_DMA 0x0000506e
34 #define G82_CHANNEL_DMA 0x0000826e
36 #define NV50_CHANNEL_GPFIFO 0x0000506f
37 #define G82_CHANNEL_GPFIFO 0x0000826f
38 #define FERMI_CHANNEL_GPFIFO 0x0000906f
39 #define KEPLER_CHANNEL_GPFIFO_A 0x0000a06f
40 #define MAXWELL_CHANNEL_GPFIFO_A 0x0000b06f
42 #define NV50_DISP 0x00005070
43 #define G82_DISP 0x00008270
44 #define GT200_DISP 0x00008370
45 #define GT214_DISP 0x00008570
46 #define GT206_DISP 0x00008870
47 #define GF110_DISP 0x00009070
48 #define GK104_DISP 0x00009170
49 #define GK110_DISP 0x00009270
50 #define GM107_DISP 0x00009470
51 #define GM204_DISP 0x00009570
53 #define NV31_MPEG 0x00003174
54 #define G82_MPEG 0x00008274
56 #define NV74_VP2 0x00007476
58 #define NV50_DISP_CURSOR 0x0000507a
59 #define G82_DISP_CURSOR 0x0000827a
60 #define GT214_DISP_CURSOR 0x0000857a
61 #define GF110_DISP_CURSOR 0x0000907a
62 #define GK104_DISP_CURSOR 0x0000917a
64 #define NV50_DISP_OVERLAY 0x0000507b
65 #define G82_DISP_OVERLAY 0x0000827b
66 #define GT214_DISP_OVERLAY 0x0000857b
67 #define GF110_DISP_OVERLAY 0x0000907b
68 #define GK104_DISP_OVERLAY 0x0000917b
70 #define NV50_DISP_BASE_CHANNEL_DMA 0x0000507c
71 #define G82_DISP_BASE_CHANNEL_DMA 0x0000827c
72 #define GT200_DISP_BASE_CHANNEL_DMA 0x0000837c
73 #define GT214_DISP_BASE_CHANNEL_DMA 0x0000857c
74 #define GF110_DISP_BASE_CHANNEL_DMA 0x0000907c
75 #define GK104_DISP_BASE_CHANNEL_DMA 0x0000917c
76 #define GK110_DISP_BASE_CHANNEL_DMA 0x0000927c
78 #define NV50_DISP_CORE_CHANNEL_DMA 0x0000507d
79 #define G82_DISP_CORE_CHANNEL_DMA 0x0000827d
80 #define GT200_DISP_CORE_CHANNEL_DMA 0x0000837d
81 #define GT214_DISP_CORE_CHANNEL_DMA 0x0000857d
82 #define GT206_DISP_CORE_CHANNEL_DMA 0x0000887d
83 #define GF110_DISP_CORE_CHANNEL_DMA 0x0000907d
84 #define GK104_DISP_CORE_CHANNEL_DMA 0x0000917d
85 #define GK110_DISP_CORE_CHANNEL_DMA 0x0000927d
86 #define GM107_DISP_CORE_CHANNEL_DMA 0x0000947d
87 #define GM204_DISP_CORE_CHANNEL_DMA 0x0000957d
89 #define NV50_DISP_OVERLAY_CHANNEL_DMA 0x0000507e
90 #define G82_DISP_OVERLAY_CHANNEL_DMA 0x0000827e
91 #define GT200_DISP_OVERLAY_CHANNEL_DMA 0x0000837e
92 #define GT214_DISP_OVERLAY_CHANNEL_DMA 0x0000857e
93 #define GF110_DISP_OVERLAY_CONTROL_DMA 0x0000907e
94 #define GK104_DISP_OVERLAY_CONTROL_DMA 0x0000917e
96 #define FERMI_A 0x00009097
97 #define FERMI_B 0x00009197
98 #define FERMI_C 0x00009297
100 #define KEPLER_A 0x0000a097
101 #define KEPLER_B 0x0000a197
102 #define KEPLER_C 0x0000a297
104 #define MAXWELL_A 0x0000b097
105 #define MAXWELL_B 0x0000b197
107 #define NV74_BSP 0x000074b0
109 #define GT212_MSVLD 0x000085b1
110 #define IGT21A_MSVLD 0x000086b1
111 #define G98_MSVLD 0x000088b1
112 #define GF100_MSVLD 0x000090b1
113 #define GK104_MSVLD 0x000095b1
115 #define GT212_MSPDEC 0x000085b2
116 #define G98_MSPDEC 0x000088b2
117 #define GF100_MSPDEC 0x000090b2
118 #define GK104_MSPDEC 0x000095b2
120 #define GT212_MSPPP 0x000085b3
121 #define G98_MSPPP 0x000088b3
122 #define GF100_MSPPP 0x000090b3
124 #define G98_SEC 0x000088b4
126 #define GT212_DMA 0x000085b5
127 #define FERMI_DMA 0x000090b5
128 #define KEPLER_DMA_COPY_A 0x0000a0b5
129 #define MAXWELL_DMA_COPY_A 0x0000b0b5
131 #define FERMI_DECOMPRESS 0x000090b8
133 #define FERMI_COMPUTE_A 0x000090c0
134 #define FERMI_COMPUTE_B 0x000091c0
135 #define KEPLER_COMPUTE_A 0x0000a0c0
136 #define KEPLER_COMPUTE_B 0x0000a1c0
137 #define MAXWELL_COMPUTE_A 0x0000b0c0
138 #define MAXWELL_COMPUTE_B 0x0000b1c0
140 #define NV74_CIPHER 0x000074c1
142 /*******************************************************************************
144 ******************************************************************************/
146 #define NV_CLIENT_DEVLIST 0x00
148 struct nv_client_devlist_v0
{
156 /*******************************************************************************
158 ******************************************************************************/
160 struct nv_device_v0
{
163 __u64 device
; /* device identifier, ~0 for client default */
166 #define NV_DEVICE_V0_INFO 0x00
167 #define NV_DEVICE_V0_TIME 0x01
169 struct nv_device_info_v0
{
171 #define NV_DEVICE_INFO_V0_IGP 0x00
172 #define NV_DEVICE_INFO_V0_PCI 0x01
173 #define NV_DEVICE_INFO_V0_AGP 0x02
174 #define NV_DEVICE_INFO_V0_PCIE 0x03
175 #define NV_DEVICE_INFO_V0_SOC 0x04
177 __u16 chipset
; /* from NV_PMC_BOOT_0 */
178 __u8 revision
; /* from NV_PMC_BOOT_0 */
179 #define NV_DEVICE_INFO_V0_TNT 0x01
180 #define NV_DEVICE_INFO_V0_CELSIUS 0x02
181 #define NV_DEVICE_INFO_V0_KELVIN 0x03
182 #define NV_DEVICE_INFO_V0_RANKINE 0x04
183 #define NV_DEVICE_INFO_V0_CURIE 0x05
184 #define NV_DEVICE_INFO_V0_TESLA 0x06
185 #define NV_DEVICE_INFO_V0_FERMI 0x07
186 #define NV_DEVICE_INFO_V0_KEPLER 0x08
187 #define NV_DEVICE_INFO_V0_MAXWELL 0x09
196 struct nv_device_time_v0
{
203 /*******************************************************************************
205 ******************************************************************************/
209 #define NV_DMA_V0_TARGET_VM 0x00
210 #define NV_DMA_V0_TARGET_VRAM 0x01
211 #define NV_DMA_V0_TARGET_PCI 0x02
212 #define NV_DMA_V0_TARGET_PCI_US 0x03
213 #define NV_DMA_V0_TARGET_AGP 0x04
215 #define NV_DMA_V0_ACCESS_VM 0x00
216 #define NV_DMA_V0_ACCESS_RD 0x01
217 #define NV_DMA_V0_ACCESS_WR 0x02
218 #define NV_DMA_V0_ACCESS_RDWR (NV_DMA_V0_ACCESS_RD | NV_DMA_V0_ACCESS_WR)
223 /* ... chipset-specific class data */
228 #define NV50_DMA_V0_PRIV_VM 0x00
229 #define NV50_DMA_V0_PRIV_US 0x01
230 #define NV50_DMA_V0_PRIV__S 0x02
232 #define NV50_DMA_V0_PART_VM 0x00
233 #define NV50_DMA_V0_PART_256 0x01
234 #define NV50_DMA_V0_PART_1KB 0x02
236 #define NV50_DMA_V0_COMP_NONE 0x00
237 #define NV50_DMA_V0_COMP_1 0x01
238 #define NV50_DMA_V0_COMP_2 0x02
239 #define NV50_DMA_V0_COMP_VM 0x03
241 #define NV50_DMA_V0_KIND_PITCH 0x00
242 #define NV50_DMA_V0_KIND_VM 0x7f
247 struct gf100_dma_v0
{
249 #define GF100_DMA_V0_PRIV_VM 0x00
250 #define GF100_DMA_V0_PRIV_US 0x01
251 #define GF100_DMA_V0_PRIV__S 0x02
253 #define GF100_DMA_V0_KIND_PITCH 0x00
254 #define GF100_DMA_V0_KIND_VM 0xff
259 struct gf119_dma_v0
{
261 #define GF119_DMA_V0_PAGE_LP 0x00
262 #define GF119_DMA_V0_PAGE_SP 0x01
264 #define GF119_DMA_V0_KIND_PITCH 0x00
265 #define GF119_DMA_V0_KIND_VM 0xff
271 /*******************************************************************************
273 ******************************************************************************/
275 #define NVIF_PERFMON_V0_QUERY_DOMAIN 0x00
276 #define NVIF_PERFMON_V0_QUERY_SIGNAL 0x01
277 #define NVIF_PERFMON_V0_QUERY_SOURCE 0x02
279 struct nvif_perfmon_query_domain_v0
{
289 struct nvif_perfmon_query_signal_v0
{
299 struct nvif_perfmon_query_source_v0
{
311 /*******************************************************************************
313 ******************************************************************************/
315 struct nvif_perfdom_v0
{
327 #define NVIF_PERFDOM_V0_INIT 0x00
328 #define NVIF_PERFDOM_V0_SAMPLE 0x01
329 #define NVIF_PERFDOM_V0_READ 0x02
331 struct nvif_perfdom_init
{
334 struct nvif_perfdom_sample
{
337 struct nvif_perfdom_read_v0
{
346 /*******************************************************************************
348 ******************************************************************************/
350 #define NVIF_CONTROL_PSTATE_INFO 0x00
351 #define NVIF_CONTROL_PSTATE_ATTR 0x01
352 #define NVIF_CONTROL_PSTATE_USER 0x02
354 struct nvif_control_pstate_info_v0
{
356 __u8 count
; /* out: number of power states */
357 #define NVIF_CONTROL_PSTATE_INFO_V0_USTATE_DISABLE (-1)
358 #define NVIF_CONTROL_PSTATE_INFO_V0_USTATE_PERFMON (-2)
359 __s8 ustate_ac
; /* out: target pstate index */
360 __s8 ustate_dc
; /* out: target pstate index */
361 __s8 pwrsrc
; /* out: current power source */
362 #define NVIF_CONTROL_PSTATE_INFO_V0_PSTATE_UNKNOWN (-1)
363 #define NVIF_CONTROL_PSTATE_INFO_V0_PSTATE_PERFMON (-2)
364 __s8 pstate
; /* out: current pstate index */
368 struct nvif_control_pstate_attr_v0
{
370 #define NVIF_CONTROL_PSTATE_ATTR_V0_STATE_CURRENT (-1)
371 __s8 state
; /* in: index of pstate to query
372 * out: pstate identifier
374 __u8 index
; /* in: index of attribute to query
375 * out: index of next attribute, or 0 if no more
384 struct nvif_control_pstate_user_v0
{
386 #define NVIF_CONTROL_PSTATE_USER_V0_STATE_UNKNOWN (-1)
387 #define NVIF_CONTROL_PSTATE_USER_V0_STATE_PERFMON (-2)
388 __s8 ustate
; /* in: pstate identifier */
389 __s8 pwrsrc
; /* in: target power source */
394 /*******************************************************************************
396 ******************************************************************************/
398 struct nv03_channel_dma_v0
{
406 struct nv50_channel_dma_v0
{
415 #define G82_CHANNEL_DMA_V0_NTFY_UEVENT 0x00
417 /*******************************************************************************
419 ******************************************************************************/
421 struct nv50_channel_gpfifo_v0
{
431 struct fermi_channel_gpfifo_v0
{
440 struct kepler_channel_gpfifo_a_v0
{
442 #define KEPLER_CHANNEL_GPFIFO_A_V0_ENGINE_GR 0x01
443 #define KEPLER_CHANNEL_GPFIFO_A_V0_ENGINE_MSPDEC 0x02
444 #define KEPLER_CHANNEL_GPFIFO_A_V0_ENGINE_MSPPP 0x04
445 #define KEPLER_CHANNEL_GPFIFO_A_V0_ENGINE_MSVLD 0x08
446 #define KEPLER_CHANNEL_GPFIFO_A_V0_ENGINE_CE0 0x10
447 #define KEPLER_CHANNEL_GPFIFO_A_V0_ENGINE_CE1 0x20
448 #define KEPLER_CHANNEL_GPFIFO_A_V0_ENGINE_ENC 0x40
456 /*******************************************************************************
458 ******************************************************************************/
460 #define NV04_DISP_NTFY_VBLANK 0x00
461 #define NV04_DISP_NTFY_CONN 0x01
463 struct nv04_disp_mthd_v0
{
465 #define NV04_DISP_SCANOUTPOS 0x00
471 struct nv04_disp_scanoutpos_v0
{
485 /*******************************************************************************
487 ******************************************************************************/
489 #define NV50_DISP_MTHD 0x00
491 struct nv50_disp_mthd_v0
{
493 #define NV50_DISP_SCANOUTPOS 0x00
499 struct nv50_disp_mthd_v1
{
501 #define NV50_DISP_MTHD_V1_DAC_PWR 0x10
502 #define NV50_DISP_MTHD_V1_DAC_LOAD 0x11
503 #define NV50_DISP_MTHD_V1_SOR_PWR 0x20
504 #define NV50_DISP_MTHD_V1_SOR_HDA_ELD 0x21
505 #define NV50_DISP_MTHD_V1_SOR_HDMI_PWR 0x22
506 #define NV50_DISP_MTHD_V1_SOR_LVDS_SCRIPT 0x23
507 #define NV50_DISP_MTHD_V1_SOR_DP_PWR 0x24
508 #define NV50_DISP_MTHD_V1_PIOR_PWR 0x30
515 struct nv50_disp_dac_pwr_v0
{
524 struct nv50_disp_dac_load_v0
{
531 struct nv50_disp_sor_pwr_v0
{
537 struct nv50_disp_sor_hda_eld_v0
{
543 struct nv50_disp_sor_hdmi_pwr_v0
{
551 struct nv50_disp_sor_lvds_script_v0
{
558 struct nv50_disp_sor_dp_pwr_v0
{
564 struct nv50_disp_pior_pwr_v0
{
572 struct nv50_disp_core_channel_dma_v0
{
578 #define NV50_DISP_CORE_CHANNEL_DMA_V0_NTFY_UEVENT 0x00
580 /* cursor immediate */
581 struct nv50_disp_cursor_v0
{
587 #define NV50_DISP_CURSOR_V0_NTFY_UEVENT 0x00
590 struct nv50_disp_base_channel_dma_v0
{
597 #define NV50_DISP_BASE_CHANNEL_DMA_V0_NTFY_UEVENT 0x00
600 struct nv50_disp_overlay_channel_dma_v0
{
607 #define NV50_DISP_OVERLAY_CHANNEL_DMA_V0_NTFY_UEVENT 0x00
609 /* overlay immediate */
610 struct nv50_disp_overlay_v0
{
616 #define NV50_DISP_OVERLAY_V0_NTFY_UEVENT 0x00
618 /*******************************************************************************
620 ******************************************************************************/
622 #define NVSW_NTFY_UEVENT 0x00
624 #define NV04_NVSW_GET_REF 0x00
626 struct nv04_nvsw_get_ref_v0
{
632 /*******************************************************************************
634 ******************************************************************************/
636 #define FERMI_A_ZBC_COLOR 0x00
637 #define FERMI_A_ZBC_DEPTH 0x01
639 struct fermi_a_zbc_color_v0
{
641 #define FERMI_A_ZBC_COLOR_V0_FMT_ZERO 0x01
642 #define FERMI_A_ZBC_COLOR_V0_FMT_UNORM_ONE 0x02
643 #define FERMI_A_ZBC_COLOR_V0_FMT_RF32_GF32_BF32_AF32 0x04
644 #define FERMI_A_ZBC_COLOR_V0_FMT_R16_G16_B16_A16 0x08
645 #define FERMI_A_ZBC_COLOR_V0_FMT_RN16_GN16_BN16_AN16 0x0c
646 #define FERMI_A_ZBC_COLOR_V0_FMT_RS16_GS16_BS16_AS16 0x10
647 #define FERMI_A_ZBC_COLOR_V0_FMT_RU16_GU16_BU16_AU16 0x14
648 #define FERMI_A_ZBC_COLOR_V0_FMT_RF16_GF16_BF16_AF16 0x16
649 #define FERMI_A_ZBC_COLOR_V0_FMT_A8R8G8B8 0x18
650 #define FERMI_A_ZBC_COLOR_V0_FMT_A8RL8GL8BL8 0x1c
651 #define FERMI_A_ZBC_COLOR_V0_FMT_A2B10G10R10 0x20
652 #define FERMI_A_ZBC_COLOR_V0_FMT_AU2BU10GU10RU10 0x24
653 #define FERMI_A_ZBC_COLOR_V0_FMT_A8B8G8R8 0x28
654 #define FERMI_A_ZBC_COLOR_V0_FMT_A8BL8GL8RL8 0x2c
655 #define FERMI_A_ZBC_COLOR_V0_FMT_AN8BN8GN8RN8 0x30
656 #define FERMI_A_ZBC_COLOR_V0_FMT_AS8BS8GS8RS8 0x34
657 #define FERMI_A_ZBC_COLOR_V0_FMT_AU8BU8GU8RU8 0x38
658 #define FERMI_A_ZBC_COLOR_V0_FMT_A2R10G10B10 0x3c
659 #define FERMI_A_ZBC_COLOR_V0_FMT_BF10GF11RF11 0x40
667 struct fermi_a_zbc_depth_v0
{
669 #define FERMI_A_ZBC_DEPTH_V0_FMT_FP32 0x01