channv50.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. #ifndef __NV50_DISP_CHAN_H__
  2. #define __NV50_DISP_CHAN_H__
  3. #define nv50_disp_chan(p) container_of((p), struct nv50_disp_chan, object)
  4. #include "nv50.h"
  5. struct nv50_disp_chan {
  6. const struct nv50_disp_chan_func *func;
  7. const struct nv50_disp_chan_mthd *mthd;
  8. struct nv50_disp_root *root;
  9. struct {
  10. int ctrl;
  11. int user;
  12. } chid;
  13. int head;
  14. struct nvkm_object object;
  15. };
  16. struct nv50_disp_chan_func {
  17. void *(*dtor)(struct nv50_disp_chan *);
  18. int (*init)(struct nv50_disp_chan *);
  19. void (*fini)(struct nv50_disp_chan *);
  20. int (*child_get)(struct nv50_disp_chan *, int index,
  21. struct nvkm_oclass *);
  22. int (*child_new)(struct nv50_disp_chan *, const struct nvkm_oclass *,
  23. void *data, u32 size, struct nvkm_object **);
  24. };
  25. int nv50_disp_chan_ctor(const struct nv50_disp_chan_func *,
  26. const struct nv50_disp_chan_mthd *,
  27. struct nv50_disp_root *, int ctrl, int user, int head,
  28. const struct nvkm_oclass *, struct nv50_disp_chan *);
  29. int nv50_disp_chan_new_(const struct nv50_disp_chan_func *,
  30. const struct nv50_disp_chan_mthd *,
  31. struct nv50_disp_root *, int ctrl, int user, int head,
  32. const struct nvkm_oclass *, struct nvkm_object **);
  33. extern const struct nv50_disp_chan_func nv50_disp_pioc_func;
  34. extern const struct nv50_disp_chan_func gf119_disp_pioc_func;
  35. extern const struct nvkm_event_func nv50_disp_chan_uevent;
  36. int nv50_disp_chan_uevent_ctor(struct nvkm_object *, void *, u32,
  37. struct nvkm_notify *);
  38. void nv50_disp_chan_uevent_send(struct nv50_disp *, int);
  39. extern const struct nvkm_event_func gf119_disp_chan_uevent;
  40. struct nv50_disp_mthd_list {
  41. u32 mthd;
  42. u32 addr;
  43. struct {
  44. u32 mthd;
  45. u32 addr;
  46. const char *name;
  47. } data[];
  48. };
  49. struct nv50_disp_chan_mthd {
  50. const char *name;
  51. u32 addr;
  52. s32 prev;
  53. struct {
  54. const char *name;
  55. int nr;
  56. const struct nv50_disp_mthd_list *mthd;
  57. } data[];
  58. };
  59. void nv50_disp_chan_mthd(struct nv50_disp_chan *, int debug);
  60. extern const struct nv50_disp_mthd_list nv50_disp_core_mthd_base;
  61. extern const struct nv50_disp_mthd_list nv50_disp_core_mthd_sor;
  62. extern const struct nv50_disp_mthd_list nv50_disp_core_mthd_pior;
  63. extern const struct nv50_disp_mthd_list nv50_disp_base_mthd_image;
  64. extern const struct nv50_disp_chan_mthd g84_disp_core_chan_mthd;
  65. extern const struct nv50_disp_mthd_list g84_disp_core_mthd_dac;
  66. extern const struct nv50_disp_mthd_list g84_disp_core_mthd_head;
  67. extern const struct nv50_disp_chan_mthd g84_disp_base_chan_mthd;
  68. extern const struct nv50_disp_chan_mthd g84_disp_ovly_chan_mthd;
  69. extern const struct nv50_disp_chan_mthd g94_disp_core_chan_mthd;
  70. extern const struct nv50_disp_mthd_list gf119_disp_core_mthd_base;
  71. extern const struct nv50_disp_mthd_list gf119_disp_core_mthd_dac;
  72. extern const struct nv50_disp_mthd_list gf119_disp_core_mthd_sor;
  73. extern const struct nv50_disp_mthd_list gf119_disp_core_mthd_pior;
  74. extern const struct nv50_disp_chan_mthd gf119_disp_base_chan_mthd;
  75. extern const struct nv50_disp_chan_mthd gk104_disp_core_chan_mthd;
  76. extern const struct nv50_disp_chan_mthd gk104_disp_ovly_chan_mthd;
  77. struct nv50_disp_pioc_oclass {
  78. int (*ctor)(const struct nv50_disp_chan_func *,
  79. const struct nv50_disp_chan_mthd *,
  80. struct nv50_disp_root *, int ctrl, int user,
  81. const struct nvkm_oclass *, void *data, u32 size,
  82. struct nvkm_object **);
  83. struct nvkm_sclass base;
  84. const struct nv50_disp_chan_func *func;
  85. const struct nv50_disp_chan_mthd *mthd;
  86. struct {
  87. int ctrl;
  88. int user;
  89. } chid;
  90. };
  91. extern const struct nv50_disp_pioc_oclass nv50_disp_oimm_oclass;
  92. extern const struct nv50_disp_pioc_oclass nv50_disp_curs_oclass;
  93. extern const struct nv50_disp_pioc_oclass g84_disp_oimm_oclass;
  94. extern const struct nv50_disp_pioc_oclass g84_disp_curs_oclass;
  95. extern const struct nv50_disp_pioc_oclass gt215_disp_oimm_oclass;
  96. extern const struct nv50_disp_pioc_oclass gt215_disp_curs_oclass;
  97. extern const struct nv50_disp_pioc_oclass gf119_disp_oimm_oclass;
  98. extern const struct nv50_disp_pioc_oclass gf119_disp_curs_oclass;
  99. extern const struct nv50_disp_pioc_oclass gk104_disp_oimm_oclass;
  100. extern const struct nv50_disp_pioc_oclass gk104_disp_curs_oclass;
  101. extern const struct nv50_disp_pioc_oclass gp102_disp_oimm_oclass;
  102. extern const struct nv50_disp_pioc_oclass gp102_disp_curs_oclass;
  103. int nv50_disp_curs_new(const struct nv50_disp_chan_func *,
  104. const struct nv50_disp_chan_mthd *,
  105. struct nv50_disp_root *, int ctrl, int user,
  106. const struct nvkm_oclass *, void *data, u32 size,
  107. struct nvkm_object **);
  108. int nv50_disp_oimm_new(const struct nv50_disp_chan_func *,
  109. const struct nv50_disp_chan_mthd *,
  110. struct nv50_disp_root *, int ctrl, int user,
  111. const struct nvkm_oclass *, void *data, u32 size,
  112. struct nvkm_object **);
  113. #endif