nv50.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. #ifndef __NV50_DISP_H__
  2. #define __NV50_DISP_H__
  3. #define nv50_disp(p) container_of((p), struct nv50_disp, base)
  4. #include "priv.h"
  5. struct nvkm_output;
  6. struct nvkm_output_dp;
  7. #define NV50_DISP_MTHD_ struct nvkm_object *object, \
  8. struct nv50_disp *disp, void *data, u32 size
  9. #define NV50_DISP_MTHD_V0 NV50_DISP_MTHD_, int head
  10. #define NV50_DISP_MTHD_V1 NV50_DISP_MTHD_, int head, struct nvkm_output *outp
  11. struct nv50_disp {
  12. const struct nv50_disp_func *func;
  13. struct nvkm_disp base;
  14. struct work_struct supervisor;
  15. u32 super;
  16. struct nvkm_event uevent;
  17. struct {
  18. u32 lvdsconf;
  19. } sor;
  20. struct {
  21. u8 type[3];
  22. } pior;
  23. struct nv50_disp_chan *chan[17];
  24. };
  25. int nv50_disp_root_scanoutpos(NV50_DISP_MTHD_V0);
  26. int gf119_disp_root_scanoutpos(NV50_DISP_MTHD_V0);
  27. int nv50_dac_power(NV50_DISP_MTHD_V1);
  28. int nv50_dac_sense(NV50_DISP_MTHD_V1);
  29. int gt215_hda_eld(NV50_DISP_MTHD_V1);
  30. int gf119_hda_eld(NV50_DISP_MTHD_V1);
  31. int g84_hdmi_ctrl(NV50_DISP_MTHD_V1);
  32. int gt215_hdmi_ctrl(NV50_DISP_MTHD_V1);
  33. int gf119_hdmi_ctrl(NV50_DISP_MTHD_V1);
  34. int gk104_hdmi_ctrl(NV50_DISP_MTHD_V1);
  35. int nv50_sor_power(NV50_DISP_MTHD_V1);
  36. int nv50_pior_power(NV50_DISP_MTHD_V1);
  37. int nv50_disp_new_(const struct nv50_disp_func *, struct nvkm_device *,
  38. int index, int heads, struct nvkm_disp **);
  39. int gf119_disp_new_(const struct nv50_disp_func *, struct nvkm_device *,
  40. int index, struct nvkm_disp **);
  41. struct nv50_disp_func_outp {
  42. int (* crt)(struct nvkm_disp *, int index, struct dcb_output *,
  43. struct nvkm_output **);
  44. int (* tv)(struct nvkm_disp *, int index, struct dcb_output *,
  45. struct nvkm_output **);
  46. int (*tmds)(struct nvkm_disp *, int index, struct dcb_output *,
  47. struct nvkm_output **);
  48. int (*lvds)(struct nvkm_disp *, int index, struct dcb_output *,
  49. struct nvkm_output **);
  50. int (* dp)(struct nvkm_disp *, int index, struct dcb_output *,
  51. struct nvkm_output **);
  52. };
  53. struct nv50_disp_func {
  54. void (*intr)(struct nv50_disp *);
  55. void (*intr_error)(struct nv50_disp *, int chid);
  56. const struct nvkm_event_func *uevent;
  57. void (*super)(struct work_struct *);
  58. const struct nvkm_disp_oclass *root;
  59. struct {
  60. void (*vblank_init)(struct nv50_disp *, int head);
  61. void (*vblank_fini)(struct nv50_disp *, int head);
  62. int (*scanoutpos)(NV50_DISP_MTHD_V0);
  63. } head;
  64. struct {
  65. const struct nv50_disp_func_outp internal;
  66. const struct nv50_disp_func_outp external;
  67. } outp;
  68. struct {
  69. int nr;
  70. int (*power)(NV50_DISP_MTHD_V1);
  71. int (*sense)(NV50_DISP_MTHD_V1);
  72. } dac;
  73. struct {
  74. int nr;
  75. int (*power)(NV50_DISP_MTHD_V1);
  76. int (*hda_eld)(NV50_DISP_MTHD_V1);
  77. int (*hdmi)(NV50_DISP_MTHD_V1);
  78. void (*magic)(struct nvkm_output *);
  79. } sor;
  80. struct {
  81. int nr;
  82. int (*power)(NV50_DISP_MTHD_V1);
  83. } pior;
  84. };
  85. void nv50_disp_vblank_init(struct nv50_disp *, int);
  86. void nv50_disp_vblank_fini(struct nv50_disp *, int);
  87. void nv50_disp_intr(struct nv50_disp *);
  88. void nv50_disp_intr_supervisor(struct work_struct *);
  89. void gf119_disp_vblank_init(struct nv50_disp *, int);
  90. void gf119_disp_vblank_fini(struct nv50_disp *, int);
  91. void gf119_disp_intr(struct nv50_disp *);
  92. void gf119_disp_intr_supervisor(struct work_struct *);
  93. void gf119_disp_intr_error(struct nv50_disp *, int);
  94. #endif