1 #ifndef __NVIF_CLASS_H__
2 #define __NVIF_CLASS_H__
4 /*******************************************************************************
6 ******************************************************************************/
8 /* the below match nvidia-assigned (either in hw, or sw) class numbers */
9 #define NV_DEVICE 0x00000080
11 #define NV_DMA_FROM_MEMORY 0x00000002
12 #define NV_DMA_TO_MEMORY 0x00000003
13 #define NV_DMA_IN_MEMORY 0x0000003d
15 #define FERMI_TWOD_A 0x0000902d
17 #define FERMI_MEMORY_TO_MEMORY_FORMAT_A 0x00009039
19 #define KEPLER_INLINE_TO_MEMORY_A 0x0000a040
20 #define KEPLER_INLINE_TO_MEMORY_B 0x0000a140
22 #define NV04_DISP 0x00000046
24 #define NV03_CHANNEL_DMA 0x0000006b
25 #define NV10_CHANNEL_DMA 0x0000006e
26 #define NV17_CHANNEL_DMA 0x0000176e
27 #define NV40_CHANNEL_DMA 0x0000406e
28 #define NV50_CHANNEL_DMA 0x0000506e
29 #define G82_CHANNEL_DMA 0x0000826e
31 #define NV50_CHANNEL_GPFIFO 0x0000506f
32 #define G82_CHANNEL_GPFIFO 0x0000826f
33 #define FERMI_CHANNEL_GPFIFO 0x0000906f
34 #define KEPLER_CHANNEL_GPFIFO_A 0x0000a06f
35 #define MAXWELL_CHANNEL_GPFIFO_A 0x0000b06f
37 #define NV50_DISP 0x00005070
38 #define G82_DISP 0x00008270
39 #define GT200_DISP 0x00008370
40 #define GT214_DISP 0x00008570
41 #define GT206_DISP 0x00008870
42 #define GF110_DISP 0x00009070
43 #define GK104_DISP 0x00009170
44 #define GK110_DISP 0x00009270
45 #define GM107_DISP 0x00009470
46 #define GM204_DISP 0x00009570
48 #define NV74_VP2 0x00007476
50 #define NV50_DISP_CURSOR 0x0000507a
51 #define G82_DISP_CURSOR 0x0000827a
52 #define GT214_DISP_CURSOR 0x0000857a
53 #define GF110_DISP_CURSOR 0x0000907a
54 #define GK104_DISP_CURSOR 0x0000917a
56 #define NV50_DISP_OVERLAY 0x0000507b
57 #define G82_DISP_OVERLAY 0x0000827b
58 #define GT214_DISP_OVERLAY 0x0000857b
59 #define GF110_DISP_OVERLAY 0x0000907b
60 #define GK104_DISP_OVERLAY 0x0000917b
62 #define NV50_DISP_BASE_CHANNEL_DMA 0x0000507c
63 #define G82_DISP_BASE_CHANNEL_DMA 0x0000827c
64 #define GT200_DISP_BASE_CHANNEL_DMA 0x0000837c
65 #define GT214_DISP_BASE_CHANNEL_DMA 0x0000857c
66 #define GF110_DISP_BASE_CHANNEL_DMA 0x0000907c
67 #define GK104_DISP_BASE_CHANNEL_DMA 0x0000917c
68 #define GK110_DISP_BASE_CHANNEL_DMA 0x0000927c
70 #define NV50_DISP_CORE_CHANNEL_DMA 0x0000507d
71 #define G82_DISP_CORE_CHANNEL_DMA 0x0000827d
72 #define GT200_DISP_CORE_CHANNEL_DMA 0x0000837d
73 #define GT214_DISP_CORE_CHANNEL_DMA 0x0000857d
74 #define GT206_DISP_CORE_CHANNEL_DMA 0x0000887d
75 #define GF110_DISP_CORE_CHANNEL_DMA 0x0000907d
76 #define GK104_DISP_CORE_CHANNEL_DMA 0x0000917d
77 #define GK110_DISP_CORE_CHANNEL_DMA 0x0000927d
78 #define GM107_DISP_CORE_CHANNEL_DMA 0x0000947d
79 #define GM204_DISP_CORE_CHANNEL_DMA 0x0000957d
81 #define NV50_DISP_OVERLAY_CHANNEL_DMA 0x0000507e
82 #define G82_DISP_OVERLAY_CHANNEL_DMA 0x0000827e
83 #define GT200_DISP_OVERLAY_CHANNEL_DMA 0x0000837e
84 #define GT214_DISP_OVERLAY_CHANNEL_DMA 0x0000857e
85 #define GF110_DISP_OVERLAY_CONTROL_DMA 0x0000907e
86 #define GK104_DISP_OVERLAY_CONTROL_DMA 0x0000917e
88 #define FERMI_A 0x00009097
89 #define FERMI_B 0x00009197
90 #define FERMI_C 0x00009297
92 #define KEPLER_A 0x0000a097
93 #define KEPLER_B 0x0000a197
94 #define KEPLER_C 0x0000a297
96 #define MAXWELL_A 0x0000b097
97 #define MAXWELL_B 0x0000b197
99 #define NV74_BSP 0x000074b0
101 #define GT212_MSVLD 0x000085b1
102 #define IGT21A_MSVLD 0x000086b1
103 #define G98_MSVLD 0x000088b1
104 #define GF100_MSVLD 0x000090b1
105 #define GK104_MSVLD 0x000095b1
107 #define GT212_MSPDEC 0x000085b2
108 #define G98_MSPDEC 0x000088b2
109 #define GF100_MSPDEC 0x000090b2
110 #define GK104_MSPDEC 0x000095b2
112 #define GT212_MSPPP 0x000085b3
113 #define G98_MSPPP 0x000088b3
114 #define GF100_MSPPP 0x000090b3
116 #define G98_SEC 0x000088b4
118 #define GT212_DMA 0x000085b5
119 #define FERMI_DMA 0x000090b5
120 #define KEPLER_DMA_COPY_A 0x0000a0b5
121 #define MAXWELL_DMA_COPY_A 0x0000b0b5
123 #define FERMI_DECOMPRESS 0x000090b8
125 #define FERMI_COMPUTE_A 0x000090c0
126 #define FERMI_COMPUTE_B 0x000091c0
128 #define KEPLER_COMPUTE_A 0x0000a0c0
129 #define KEPLER_COMPUTE_B 0x0000a1c0
131 #define MAXWELL_COMPUTE_A 0x0000b0c0
132 #define MAXWELL_COMPUTE_B 0x0000b1c0
135 /*******************************************************************************
137 ******************************************************************************/
139 #define NV_CLIENT_DEVLIST 0x00
141 struct nv_client_devlist_v0
{
149 /*******************************************************************************
151 ******************************************************************************/
153 struct nv_device_v0
{
156 __u64 device
; /* device identifier, ~0 for client default */
159 #define NV_DEVICE_V0_INFO 0x00
160 #define NV_DEVICE_V0_TIME 0x01
162 struct nv_device_info_v0
{
164 #define NV_DEVICE_INFO_V0_IGP 0x00
165 #define NV_DEVICE_INFO_V0_PCI 0x01
166 #define NV_DEVICE_INFO_V0_AGP 0x02
167 #define NV_DEVICE_INFO_V0_PCIE 0x03
168 #define NV_DEVICE_INFO_V0_SOC 0x04
170 __u16 chipset
; /* from NV_PMC_BOOT_0 */
171 __u8 revision
; /* from NV_PMC_BOOT_0 */
172 #define NV_DEVICE_INFO_V0_TNT 0x01
173 #define NV_DEVICE_INFO_V0_CELSIUS 0x02
174 #define NV_DEVICE_INFO_V0_KELVIN 0x03
175 #define NV_DEVICE_INFO_V0_RANKINE 0x04
176 #define NV_DEVICE_INFO_V0_CURIE 0x05
177 #define NV_DEVICE_INFO_V0_TESLA 0x06
178 #define NV_DEVICE_INFO_V0_FERMI 0x07
179 #define NV_DEVICE_INFO_V0_KEPLER 0x08
180 #define NV_DEVICE_INFO_V0_MAXWELL 0x09
189 struct nv_device_time_v0
{
196 /*******************************************************************************
198 ******************************************************************************/
202 #define NV_DMA_V0_TARGET_VM 0x00
203 #define NV_DMA_V0_TARGET_VRAM 0x01
204 #define NV_DMA_V0_TARGET_PCI 0x02
205 #define NV_DMA_V0_TARGET_PCI_US 0x03
206 #define NV_DMA_V0_TARGET_AGP 0x04
208 #define NV_DMA_V0_ACCESS_VM 0x00
209 #define NV_DMA_V0_ACCESS_RD 0x01
210 #define NV_DMA_V0_ACCESS_WR 0x02
211 #define NV_DMA_V0_ACCESS_RDWR (NV_DMA_V0_ACCESS_RD | NV_DMA_V0_ACCESS_WR)
216 /* ... chipset-specific class data */
221 #define NV50_DMA_V0_PRIV_VM 0x00
222 #define NV50_DMA_V0_PRIV_US 0x01
223 #define NV50_DMA_V0_PRIV__S 0x02
225 #define NV50_DMA_V0_PART_VM 0x00
226 #define NV50_DMA_V0_PART_256 0x01
227 #define NV50_DMA_V0_PART_1KB 0x02
229 #define NV50_DMA_V0_COMP_NONE 0x00
230 #define NV50_DMA_V0_COMP_1 0x01
231 #define NV50_DMA_V0_COMP_2 0x02
232 #define NV50_DMA_V0_COMP_VM 0x03
234 #define NV50_DMA_V0_KIND_PITCH 0x00
235 #define NV50_DMA_V0_KIND_VM 0x7f
240 struct gf100_dma_v0
{
242 #define GF100_DMA_V0_PRIV_VM 0x00
243 #define GF100_DMA_V0_PRIV_US 0x01
244 #define GF100_DMA_V0_PRIV__S 0x02
246 #define GF100_DMA_V0_KIND_PITCH 0x00
247 #define GF100_DMA_V0_KIND_VM 0xff
252 struct gf110_dma_v0
{
254 #define GF110_DMA_V0_PAGE_LP 0x00
255 #define GF110_DMA_V0_PAGE_SP 0x01
257 #define GF110_DMA_V0_KIND_PITCH 0x00
258 #define GF110_DMA_V0_KIND_VM 0xff
264 /*******************************************************************************
266 ******************************************************************************/
268 #define NVIF_PERFMON_V0_QUERY_DOMAIN 0x00
269 #define NVIF_PERFMON_V0_QUERY_SIGNAL 0x01
270 #define NVIF_PERFMON_V0_QUERY_SOURCE 0x02
272 struct nvif_perfmon_query_domain_v0
{
282 struct nvif_perfmon_query_signal_v0
{
292 struct nvif_perfmon_query_source_v0
{
304 /*******************************************************************************
306 ******************************************************************************/
308 struct nvif_perfdom_v0
{
320 #define NVIF_PERFDOM_V0_INIT 0x00
321 #define NVIF_PERFDOM_V0_SAMPLE 0x01
322 #define NVIF_PERFDOM_V0_READ 0x02
324 struct nvif_perfdom_init
{
327 struct nvif_perfdom_sample
{
330 struct nvif_perfdom_read_v0
{
339 /*******************************************************************************
341 ******************************************************************************/
343 #define NVIF_CONTROL_PSTATE_INFO 0x00
344 #define NVIF_CONTROL_PSTATE_ATTR 0x01
345 #define NVIF_CONTROL_PSTATE_USER 0x02
347 struct nvif_control_pstate_info_v0
{
349 __u8 count
; /* out: number of power states */
350 #define NVIF_CONTROL_PSTATE_INFO_V0_USTATE_DISABLE (-1)
351 #define NVIF_CONTROL_PSTATE_INFO_V0_USTATE_PERFMON (-2)
352 __s8 ustate_ac
; /* out: target pstate index */
353 __s8 ustate_dc
; /* out: target pstate index */
354 __s8 pwrsrc
; /* out: current power source */
355 #define NVIF_CONTROL_PSTATE_INFO_V0_PSTATE_UNKNOWN (-1)
356 #define NVIF_CONTROL_PSTATE_INFO_V0_PSTATE_PERFMON (-2)
357 __s8 pstate
; /* out: current pstate index */
361 struct nvif_control_pstate_attr_v0
{
363 #define NVIF_CONTROL_PSTATE_ATTR_V0_STATE_CURRENT (-1)
364 __s8 state
; /* in: index of pstate to query
365 * out: pstate identifier
367 __u8 index
; /* in: index of attribute to query
368 * out: index of next attribute, or 0 if no more
377 struct nvif_control_pstate_user_v0
{
379 #define NVIF_CONTROL_PSTATE_USER_V0_STATE_UNKNOWN (-1)
380 #define NVIF_CONTROL_PSTATE_USER_V0_STATE_PERFMON (-2)
381 __s8 ustate
; /* in: pstate identifier */
382 __s8 pwrsrc
; /* in: target power source */
387 /*******************************************************************************
389 ******************************************************************************/
391 struct nv03_channel_dma_v0
{
399 struct nv50_channel_dma_v0
{
408 #define G82_CHANNEL_DMA_V0_NTFY_UEVENT 0x00
410 /*******************************************************************************
412 ******************************************************************************/
414 struct nv50_channel_gpfifo_v0
{
424 struct fermi_channel_gpfifo_v0
{
433 struct kepler_channel_gpfifo_a_v0
{
435 #define KEPLER_CHANNEL_GPFIFO_A_V0_ENGINE_GR 0x01
436 #define KEPLER_CHANNEL_GPFIFO_A_V0_ENGINE_MSPDEC 0x02
437 #define KEPLER_CHANNEL_GPFIFO_A_V0_ENGINE_MSPPP 0x04
438 #define KEPLER_CHANNEL_GPFIFO_A_V0_ENGINE_MSVLD 0x08
439 #define KEPLER_CHANNEL_GPFIFO_A_V0_ENGINE_CE0 0x10
440 #define KEPLER_CHANNEL_GPFIFO_A_V0_ENGINE_CE1 0x20
441 #define KEPLER_CHANNEL_GPFIFO_A_V0_ENGINE_ENC 0x40
449 /*******************************************************************************
451 ******************************************************************************/
453 #define NV04_DISP_NTFY_VBLANK 0x00
454 #define NV04_DISP_NTFY_CONN 0x01
456 struct nv04_disp_mthd_v0
{
458 #define NV04_DISP_SCANOUTPOS 0x00
464 struct nv04_disp_scanoutpos_v0
{
478 /*******************************************************************************
480 ******************************************************************************/
482 #define NV50_DISP_MTHD 0x00
484 struct nv50_disp_mthd_v0
{
486 #define NV50_DISP_SCANOUTPOS 0x00
492 struct nv50_disp_mthd_v1
{
494 #define NV50_DISP_MTHD_V1_DAC_PWR 0x10
495 #define NV50_DISP_MTHD_V1_DAC_LOAD 0x11
496 #define NV50_DISP_MTHD_V1_SOR_PWR 0x20
497 #define NV50_DISP_MTHD_V1_SOR_HDA_ELD 0x21
498 #define NV50_DISP_MTHD_V1_SOR_HDMI_PWR 0x22
499 #define NV50_DISP_MTHD_V1_SOR_LVDS_SCRIPT 0x23
500 #define NV50_DISP_MTHD_V1_SOR_DP_PWR 0x24
501 #define NV50_DISP_MTHD_V1_PIOR_PWR 0x30
508 struct nv50_disp_dac_pwr_v0
{
517 struct nv50_disp_dac_load_v0
{
524 struct nv50_disp_sor_pwr_v0
{
530 struct nv50_disp_sor_hda_eld_v0
{
536 struct nv50_disp_sor_hdmi_pwr_v0
{
544 struct nv50_disp_sor_lvds_script_v0
{
551 struct nv50_disp_sor_dp_pwr_v0
{
557 struct nv50_disp_pior_pwr_v0
{
565 struct nv50_disp_core_channel_dma_v0
{
571 #define NV50_DISP_CORE_CHANNEL_DMA_V0_NTFY_UEVENT 0x00
573 /* cursor immediate */
574 struct nv50_disp_cursor_v0
{
580 #define NV50_DISP_CURSOR_V0_NTFY_UEVENT 0x00
583 struct nv50_disp_base_channel_dma_v0
{
590 #define NV50_DISP_BASE_CHANNEL_DMA_V0_NTFY_UEVENT 0x00
593 struct nv50_disp_overlay_channel_dma_v0
{
600 #define NV50_DISP_OVERLAY_CHANNEL_DMA_V0_NTFY_UEVENT 0x00
602 /* overlay immediate */
603 struct nv50_disp_overlay_v0
{
609 #define NV50_DISP_OVERLAY_V0_NTFY_UEVENT 0x00
611 /*******************************************************************************
613 ******************************************************************************/
615 #define NVSW_NTFY_UEVENT 0x00
617 #define NV04_NVSW_GET_REF 0x00
619 struct nv04_nvsw_get_ref_v0
{
625 /*******************************************************************************
627 ******************************************************************************/
629 #define FERMI_A_ZBC_COLOR 0x00
630 #define FERMI_A_ZBC_DEPTH 0x01
632 struct fermi_a_zbc_color_v0
{
634 #define FERMI_A_ZBC_COLOR_V0_FMT_ZERO 0x01
635 #define FERMI_A_ZBC_COLOR_V0_FMT_UNORM_ONE 0x02
636 #define FERMI_A_ZBC_COLOR_V0_FMT_RF32_GF32_BF32_AF32 0x04
637 #define FERMI_A_ZBC_COLOR_V0_FMT_R16_G16_B16_A16 0x08
638 #define FERMI_A_ZBC_COLOR_V0_FMT_RN16_GN16_BN16_AN16 0x0c
639 #define FERMI_A_ZBC_COLOR_V0_FMT_RS16_GS16_BS16_AS16 0x10
640 #define FERMI_A_ZBC_COLOR_V0_FMT_RU16_GU16_BU16_AU16 0x14
641 #define FERMI_A_ZBC_COLOR_V0_FMT_RF16_GF16_BF16_AF16 0x16
642 #define FERMI_A_ZBC_COLOR_V0_FMT_A8R8G8B8 0x18
643 #define FERMI_A_ZBC_COLOR_V0_FMT_A8RL8GL8BL8 0x1c
644 #define FERMI_A_ZBC_COLOR_V0_FMT_A2B10G10R10 0x20
645 #define FERMI_A_ZBC_COLOR_V0_FMT_AU2BU10GU10RU10 0x24
646 #define FERMI_A_ZBC_COLOR_V0_FMT_A8B8G8R8 0x28
647 #define FERMI_A_ZBC_COLOR_V0_FMT_A8BL8GL8RL8 0x2c
648 #define FERMI_A_ZBC_COLOR_V0_FMT_AN8BN8GN8RN8 0x30
649 #define FERMI_A_ZBC_COLOR_V0_FMT_AS8BS8GS8RS8 0x34
650 #define FERMI_A_ZBC_COLOR_V0_FMT_AU8BU8GU8RU8 0x38
651 #define FERMI_A_ZBC_COLOR_V0_FMT_A2R10G10B10 0x3c
652 #define FERMI_A_ZBC_COLOR_V0_FMT_BF10GF11RF11 0x40
660 struct fermi_a_zbc_depth_v0
{
662 #define FERMI_A_ZBC_DEPTH_V0_FMT_FP32 0x01