11b255f1cSBen Skeggs /* SPDX-License-Identifier: MIT */ 21b255f1cSBen Skeggs #ifndef __NVIF_IF0012_H__ 31b255f1cSBen Skeggs #define __NVIF_IF0012_H__ 41b255f1cSBen Skeggs 525feda6fSKees Cook #include <drm/display/drm_dp.h> 625feda6fSKees Cook 71b255f1cSBen Skeggs union nvif_outp_args { 81b255f1cSBen Skeggs struct nvif_outp_v0 { 91b255f1cSBen Skeggs __u8 version; 101b255f1cSBen Skeggs __u8 id; /* DCB device index. */ 111b255f1cSBen Skeggs __u8 pad02[6]; 121b255f1cSBen Skeggs } v0; 131b255f1cSBen Skeggs }; 14dfc4005fSBen Skeggs 15a69eeb37SBen Skeggs #define NVIF_OUTP_V0_DETECT 0x00 160cd7e071SBen Skeggs #define NVIF_OUTP_V0_EDID_GET 0x01 17a69eeb37SBen Skeggs 181b477f42SLyude Paul #define NVIF_OUTP_V0_INHERIT 0x10 1921636b1aSBen Skeggs #define NVIF_OUTP_V0_ACQUIRE 0x11 2021636b1aSBen Skeggs #define NVIF_OUTP_V0_RELEASE 0x12 2121636b1aSBen Skeggs 2221636b1aSBen Skeggs #define NVIF_OUTP_V0_LOAD_DETECT 0x20 2321636b1aSBen Skeggs 24*6c6abab2SBen Skeggs #define NVIF_OUTP_V0_HDMI 0x50 25*6c6abab2SBen Skeggs 2621636b1aSBen Skeggs #define NVIF_OUTP_V0_INFOFRAME 0x60 2721636b1aSBen Skeggs #define NVIF_OUTP_V0_HDA_ELD 0x61 2821636b1aSBen Skeggs 2921636b1aSBen Skeggs #define NVIF_OUTP_V0_DP_AUX_PWR 0x70 3021636b1aSBen Skeggs #define NVIF_OUTP_V0_DP_RETRAIN 0x73 3121636b1aSBen Skeggs #define NVIF_OUTP_V0_DP_MST_VCPI 0x78 32dfc4005fSBen Skeggs 33a69eeb37SBen Skeggs union nvif_outp_detect_args { 34a69eeb37SBen Skeggs struct nvif_outp_detect_v0 { 35a69eeb37SBen Skeggs __u8 version; 36a69eeb37SBen Skeggs #define NVIF_OUTP_DETECT_V0_NOT_PRESENT 0x00 37a69eeb37SBen Skeggs #define NVIF_OUTP_DETECT_V0_PRESENT 0x01 38a69eeb37SBen Skeggs #define NVIF_OUTP_DETECT_V0_UNKNOWN 0x02 39a69eeb37SBen Skeggs __u8 status; 40a69eeb37SBen Skeggs } v0; 41a69eeb37SBen Skeggs }; 42a69eeb37SBen Skeggs 430cd7e071SBen Skeggs union nvif_outp_edid_get_args { 440cd7e071SBen Skeggs struct nvif_outp_edid_get_v0 { 450cd7e071SBen Skeggs __u8 version; 460cd7e071SBen Skeggs __u8 pad01; 470cd7e071SBen Skeggs __u16 size; 480cd7e071SBen Skeggs __u8 data[2048]; 490cd7e071SBen Skeggs } v0; 500cd7e071SBen Skeggs }; 510cd7e071SBen Skeggs 52dfc4005fSBen Skeggs union nvif_outp_load_detect_args { 53dfc4005fSBen Skeggs struct nvif_outp_load_detect_v0 { 54dfc4005fSBen Skeggs __u8 version; 55dfc4005fSBen Skeggs __u8 load; 56dfc4005fSBen Skeggs __u8 pad02[2]; 57dfc4005fSBen Skeggs __u32 data; /*TODO: move vbios loadval parsing into nvkm */ 58dfc4005fSBen Skeggs } v0; 59dfc4005fSBen Skeggs }; 60ea6143a8SBen Skeggs 61ea6143a8SBen Skeggs union nvif_outp_acquire_args { 62ea6143a8SBen Skeggs struct nvif_outp_acquire_v0 { 63ea6143a8SBen Skeggs __u8 version; 64724e0f3bSBen Skeggs #define NVIF_OUTP_ACQUIRE_V0_DAC 0x00 65cefc3c14SBen Skeggs #define NVIF_OUTP_ACQUIRE_V0_SOR 0x01 66cefc3c14SBen Skeggs #define NVIF_OUTP_ACQUIRE_V0_PIOR 0x02 67ea6143a8SBen Skeggs #define NVIF_OUTP_ACQUIRE_V0_LVDS 0x03 68ea6143a8SBen Skeggs #define NVIF_OUTP_ACQUIRE_V0_DP 0x04 69724e0f3bSBen Skeggs __u8 type; 70ea6143a8SBen Skeggs __u8 or; 71ea6143a8SBen Skeggs __u8 link; 72ea6143a8SBen Skeggs __u8 pad04[4]; 73ea6143a8SBen Skeggs union { 74ea6143a8SBen Skeggs struct { 75cefc3c14SBen Skeggs __u8 hda; 76cefc3c14SBen Skeggs } sor; 77cefc3c14SBen Skeggs struct { 789793083fSBen Skeggs __u8 dual; 799793083fSBen Skeggs __u8 bpc8; 809793083fSBen Skeggs __u8 pad02[6]; 819793083fSBen Skeggs } lvds; 829793083fSBen Skeggs struct { 8381344372SBen Skeggs __u8 link_nr; /* 0 = highest possible. */ 8481344372SBen Skeggs __u8 link_bw; /* 0 = highest possible, DP BW code otherwise. */ 85ea6143a8SBen Skeggs __u8 hda; 8681344372SBen Skeggs __u8 mst; 8781344372SBen Skeggs __u8 pad04[4]; 8825feda6fSKees Cook __u8 dpcd[DP_RECEIVER_CAP_SIZE]; 89ea6143a8SBen Skeggs } dp; 90ea6143a8SBen Skeggs }; 91ea6143a8SBen Skeggs } v0; 92ea6143a8SBen Skeggs }; 93ea6143a8SBen Skeggs 941b477f42SLyude Paul union nvif_outp_inherit_args { 951b477f42SLyude Paul struct nvif_outp_inherit_v0 { 961b477f42SLyude Paul __u8 version; 971b477f42SLyude Paul #define NVIF_OUTP_INHERIT_V0_RGB_CRT 0x00 981b477f42SLyude Paul #define NVIF_OUTP_INHERIT_V0_TV 0x01 991b477f42SLyude Paul #define NVIF_OUTP_INHERIT_V0_TMDS 0x02 1001b477f42SLyude Paul #define NVIF_OUTP_INHERIT_V0_LVDS 0x03 1011b477f42SLyude Paul #define NVIF_OUTP_INHERIT_V0_DP 0x04 1021b477f42SLyude Paul // In/out. Input is one of the above values, output is the actual hw protocol 1031b477f42SLyude Paul __u8 proto; 1041b477f42SLyude Paul __u8 or; 1051b477f42SLyude Paul __u8 link; 1061b477f42SLyude Paul __u8 head; 1071b477f42SLyude Paul union { 1081b477f42SLyude Paul struct { 1091b477f42SLyude Paul // TODO: Figure out padding, and whether we even want this field 1101b477f42SLyude Paul __u8 hda; 1111b477f42SLyude Paul } tmds; 1121b477f42SLyude Paul }; 1131b477f42SLyude Paul } v0; 1141b477f42SLyude Paul }; 1151b477f42SLyude Paul 116ea6143a8SBen Skeggs union nvif_outp_release_args { 117ea6143a8SBen Skeggs struct nvif_outp_release_vn { 118ea6143a8SBen Skeggs } vn; 119ea6143a8SBen Skeggs }; 120f530bc60SBen Skeggs 121*6c6abab2SBen Skeggs union nvif_outp_hdmi_args { 122*6c6abab2SBen Skeggs struct nvif_outp_hdmi_v0 { 123*6c6abab2SBen Skeggs __u8 version; 124*6c6abab2SBen Skeggs __u8 head; 125*6c6abab2SBen Skeggs __u8 enable; 126*6c6abab2SBen Skeggs __u8 max_ac_packet; 127*6c6abab2SBen Skeggs __u8 rekey; 128*6c6abab2SBen Skeggs __u8 scdc; 129*6c6abab2SBen Skeggs __u8 scdc_scrambling; 130*6c6abab2SBen Skeggs __u8 scdc_low_rates; 131*6c6abab2SBen Skeggs __u32 khz; 132*6c6abab2SBen Skeggs } v0; 133*6c6abab2SBen Skeggs }; 134*6c6abab2SBen Skeggs 135f530bc60SBen Skeggs union nvif_outp_infoframe_args { 136f530bc60SBen Skeggs struct nvif_outp_infoframe_v0 { 137f530bc60SBen Skeggs __u8 version; 138f530bc60SBen Skeggs #define NVIF_OUTP_INFOFRAME_V0_AVI 0 139f530bc60SBen Skeggs #define NVIF_OUTP_INFOFRAME_V0_VSI 1 140f530bc60SBen Skeggs __u8 type; 141f530bc60SBen Skeggs __u8 head; 142f530bc60SBen Skeggs __u8 pad03[5]; 143f530bc60SBen Skeggs __u8 data[]; 144f530bc60SBen Skeggs } v0; 145f530bc60SBen Skeggs }; 146a9f5d772SBen Skeggs 147a9f5d772SBen Skeggs union nvif_outp_hda_eld_args { 148a9f5d772SBen Skeggs struct nvif_outp_hda_eld_v0 { 149a9f5d772SBen Skeggs __u8 version; 150a9f5d772SBen Skeggs __u8 head; 151a9f5d772SBen Skeggs __u8 pad02[6]; 152a9f5d772SBen Skeggs __u8 data[]; 153a9f5d772SBen Skeggs } v0; 154a9f5d772SBen Skeggs }; 155a62b7493SBen Skeggs 156a62b7493SBen Skeggs union nvif_outp_dp_aux_pwr_args { 157a62b7493SBen Skeggs struct nvif_outp_dp_aux_pwr_v0 { 158a62b7493SBen Skeggs __u8 version; 159a62b7493SBen Skeggs __u8 state; 160a62b7493SBen Skeggs __u8 pad02[6]; 161a62b7493SBen Skeggs } v0; 162a62b7493SBen Skeggs }; 1638bb30c88SBen Skeggs 1648bb30c88SBen Skeggs union nvif_outp_dp_retrain_args { 1658bb30c88SBen Skeggs struct nvif_outp_dp_retrain_vn { 1668bb30c88SBen Skeggs } vn; 1678bb30c88SBen Skeggs }; 1688c7d980dSBen Skeggs 1698c7d980dSBen Skeggs union nvif_outp_dp_mst_vcpi_args { 1708c7d980dSBen Skeggs struct nvif_outp_dp_mst_vcpi_v0 { 1718c7d980dSBen Skeggs __u8 version; 1728c7d980dSBen Skeggs __u8 head; 1738c7d980dSBen Skeggs __u8 start_slot; 1748c7d980dSBen Skeggs __u8 num_slots; 1758c7d980dSBen Skeggs __u16 pbn; 1768c7d980dSBen Skeggs __u16 aligned_pbn; 1778c7d980dSBen Skeggs } v0; 1788c7d980dSBen Skeggs }; 1791b255f1cSBen Skeggs #endif 180