channv50.h 4.3 KB

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