ctxgf100.h 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. #ifndef __NVKM_GRCTX_NVC0_H__
  2. #define __NVKM_GRCTX_NVC0_H__
  3. #include "gf100.h"
  4. struct gf100_grctx {
  5. struct gf100_gr *gr;
  6. struct gf100_gr_data *data;
  7. struct gf100_gr_mmio *mmio;
  8. int buffer_nr;
  9. u64 buffer[4];
  10. u64 addr;
  11. };
  12. int gf100_grctx_mmio_data(struct gf100_grctx *, u32 size, u32 align, u32 access);
  13. void gf100_grctx_mmio_item(struct gf100_grctx *, u32 addr, u32 data, int s, int);
  14. #define mmio_vram(a,b,c,d) gf100_grctx_mmio_data((a), (b), (c), (d))
  15. #define mmio_refn(a,b,c,d,e) gf100_grctx_mmio_item((a), (b), (c), (d), (e))
  16. #define mmio_skip(a,b,c) mmio_refn((a), (b), (c), -1, -1)
  17. #define mmio_wr32(a,b,c) mmio_refn((a), (b), (c), 0, -1)
  18. struct gf100_grctx_func {
  19. /* main context generation function */
  20. void (*main)(struct gf100_gr *, struct gf100_grctx *);
  21. /* context-specific modify-on-first-load list generation function */
  22. void (*unkn)(struct gf100_gr *);
  23. /* mmio context data */
  24. const struct gf100_gr_pack *hub;
  25. const struct gf100_gr_pack *gpc;
  26. const struct gf100_gr_pack *zcull;
  27. const struct gf100_gr_pack *tpc;
  28. const struct gf100_gr_pack *ppc;
  29. /* indirect context data, generated with icmds/mthds */
  30. const struct gf100_gr_pack *icmd;
  31. const struct gf100_gr_pack *mthd;
  32. /* bundle circular buffer */
  33. void (*bundle)(struct gf100_grctx *);
  34. u32 bundle_size;
  35. u32 bundle_min_gpm_fifo_depth;
  36. u32 bundle_token_limit;
  37. /* pagepool */
  38. void (*pagepool)(struct gf100_grctx *);
  39. u32 pagepool_size;
  40. /* attribute(/alpha) circular buffer */
  41. void (*attrib)(struct gf100_grctx *);
  42. u32 attrib_nr_max;
  43. u32 attrib_nr;
  44. u32 alpha_nr_max;
  45. u32 alpha_nr;
  46. };
  47. extern const struct gf100_grctx_func gf100_grctx;
  48. int gf100_grctx_generate(struct gf100_gr *);
  49. void gf100_grctx_generate_main(struct gf100_gr *, struct gf100_grctx *);
  50. void gf100_grctx_generate_bundle(struct gf100_grctx *);
  51. void gf100_grctx_generate_pagepool(struct gf100_grctx *);
  52. void gf100_grctx_generate_attrib(struct gf100_grctx *);
  53. void gf100_grctx_generate_unkn(struct gf100_gr *);
  54. void gf100_grctx_generate_tpcid(struct gf100_gr *);
  55. void gf100_grctx_generate_r406028(struct gf100_gr *);
  56. void gf100_grctx_generate_r4060a8(struct gf100_gr *);
  57. void gf100_grctx_generate_r418bb8(struct gf100_gr *);
  58. void gf100_grctx_generate_r406800(struct gf100_gr *);
  59. extern const struct gf100_grctx_func gf108_grctx;
  60. void gf108_grctx_generate_attrib(struct gf100_grctx *);
  61. void gf108_grctx_generate_unkn(struct gf100_gr *);
  62. extern const struct gf100_grctx_func gf104_grctx;
  63. extern const struct gf100_grctx_func gf110_grctx;
  64. extern const struct gf100_grctx_func gf117_grctx;
  65. void gf117_grctx_generate_attrib(struct gf100_grctx *);
  66. extern const struct gf100_grctx_func gf119_grctx;
  67. extern const struct gf100_grctx_func gk104_grctx;
  68. extern const struct gf100_grctx_func gk20a_grctx;
  69. void gk104_grctx_generate_main(struct gf100_gr *, struct gf100_grctx *);
  70. void gk104_grctx_generate_bundle(struct gf100_grctx *);
  71. void gk104_grctx_generate_pagepool(struct gf100_grctx *);
  72. void gk104_grctx_generate_unkn(struct gf100_gr *);
  73. void gk104_grctx_generate_r418bb8(struct gf100_gr *);
  74. void gk104_grctx_generate_rop_active_fbps(struct gf100_gr *);
  75. void gm107_grctx_generate_bundle(struct gf100_grctx *);
  76. void gm107_grctx_generate_pagepool(struct gf100_grctx *);
  77. void gm107_grctx_generate_attrib(struct gf100_grctx *);
  78. extern const struct gf100_grctx_func gk110_grctx;
  79. extern const struct gf100_grctx_func gk110b_grctx;
  80. extern const struct gf100_grctx_func gk208_grctx;
  81. extern const struct gf100_grctx_func gm107_grctx;
  82. void gm107_grctx_generate_bundle(struct gf100_grctx *);
  83. void gm107_grctx_generate_pagepool(struct gf100_grctx *);
  84. void gm107_grctx_generate_attrib(struct gf100_grctx *);
  85. extern const struct gf100_grctx_func gm204_grctx;
  86. void gm204_grctx_generate_main(struct gf100_gr *, struct gf100_grctx *);
  87. void gm204_grctx_generate_tpcid(struct gf100_gr *);
  88. void gm204_grctx_generate_405b60(struct gf100_gr *);
  89. extern const struct gf100_grctx_func gm206_grctx;
  90. extern const struct gf100_grctx_func gm20b_grctx;
  91. /* context init value lists */
  92. extern const struct gf100_gr_pack gf100_grctx_pack_icmd[];
  93. extern const struct gf100_gr_pack gf100_grctx_pack_mthd[];
  94. extern const struct gf100_gr_init gf100_grctx_init_902d_0[];
  95. extern const struct gf100_gr_init gf100_grctx_init_9039_0[];
  96. extern const struct gf100_gr_init gf100_grctx_init_90c0_0[];
  97. extern const struct gf100_gr_pack gf100_grctx_pack_hub[];
  98. extern const struct gf100_gr_init gf100_grctx_init_main_0[];
  99. extern const struct gf100_gr_init gf100_grctx_init_fe_0[];
  100. extern const struct gf100_gr_init gf100_grctx_init_pri_0[];
  101. extern const struct gf100_gr_init gf100_grctx_init_memfmt_0[];
  102. extern const struct gf100_gr_init gf100_grctx_init_rstr2d_0[];
  103. extern const struct gf100_gr_init gf100_grctx_init_scc_0[];
  104. extern const struct gf100_gr_pack gf100_grctx_pack_gpc[];
  105. extern const struct gf100_gr_init gf100_grctx_init_gpc_unk_0[];
  106. extern const struct gf100_gr_init gf100_grctx_init_prop_0[];
  107. extern const struct gf100_gr_init gf100_grctx_init_gpc_unk_1[];
  108. extern const struct gf100_gr_init gf100_grctx_init_zcull_0[];
  109. extern const struct gf100_gr_init gf100_grctx_init_crstr_0[];
  110. extern const struct gf100_gr_init gf100_grctx_init_gpm_0[];
  111. extern const struct gf100_gr_init gf100_grctx_init_gcc_0[];
  112. extern const struct gf100_gr_pack gf100_grctx_pack_zcull[];
  113. extern const struct gf100_gr_pack gf100_grctx_pack_tpc[];
  114. extern const struct gf100_gr_init gf100_grctx_init_pe_0[];
  115. extern const struct gf100_gr_init gf100_grctx_init_wwdx_0[];
  116. extern const struct gf100_gr_init gf100_grctx_init_mpc_0[];
  117. extern const struct gf100_gr_init gf100_grctx_init_tpccs_0[];
  118. extern const struct gf100_gr_init gf104_grctx_init_tex_0[];
  119. extern const struct gf100_gr_init gf104_grctx_init_l1c_0[];
  120. extern const struct gf100_gr_init gf104_grctx_init_sm_0[];
  121. extern const struct gf100_gr_init gf108_grctx_init_9097_0[];
  122. extern const struct gf100_gr_init gf108_grctx_init_gpm_0[];
  123. extern const struct gf100_gr_init gf108_grctx_init_pe_0[];
  124. extern const struct gf100_gr_init gf108_grctx_init_wwdx_0[];
  125. extern const struct gf100_gr_init gf108_grctx_init_tpccs_0[];
  126. extern const struct gf100_gr_init gf110_grctx_init_9197_0[];
  127. extern const struct gf100_gr_init gf110_grctx_init_9297_0[];
  128. extern const struct gf100_gr_pack gf119_grctx_pack_icmd[];
  129. extern const struct gf100_gr_pack gf119_grctx_pack_mthd[];
  130. extern const struct gf100_gr_init gf119_grctx_init_fe_0[];
  131. extern const struct gf100_gr_init gf119_grctx_init_be_0[];
  132. extern const struct gf100_gr_init gf119_grctx_init_prop_0[];
  133. extern const struct gf100_gr_init gf119_grctx_init_gpc_unk_1[];
  134. extern const struct gf100_gr_init gf119_grctx_init_crstr_0[];
  135. extern const struct gf100_gr_init gf119_grctx_init_sm_0[];
  136. extern const struct gf100_gr_init gf117_grctx_init_pe_0[];
  137. extern const struct gf100_gr_init gf117_grctx_init_wwdx_0[];
  138. extern const struct gf100_gr_init gk104_grctx_init_memfmt_0[];
  139. extern const struct gf100_gr_init gk104_grctx_init_ds_0[];
  140. extern const struct gf100_gr_init gk104_grctx_init_scc_0[];
  141. extern const struct gf100_gr_init gk104_grctx_init_gpm_0[];
  142. extern const struct gf100_gr_init gk104_grctx_init_pes_0[];
  143. extern const struct gf100_gr_pack gk104_grctx_pack_hub[];
  144. extern const struct gf100_gr_pack gk104_grctx_pack_gpc[];
  145. extern const struct gf100_gr_pack gk104_grctx_pack_tpc[];
  146. extern const struct gf100_gr_pack gk104_grctx_pack_ppc[];
  147. extern const struct gf100_gr_pack gk104_grctx_pack_icmd[];
  148. extern const struct gf100_gr_init gk104_grctx_init_a097_0[];
  149. extern const struct gf100_gr_pack gk110_grctx_pack_icmd[];
  150. extern const struct gf100_gr_pack gk110_grctx_pack_mthd[];
  151. extern const struct gf100_gr_pack gk110_grctx_pack_hub[];
  152. extern const struct gf100_gr_init gk110_grctx_init_pri_0[];
  153. extern const struct gf100_gr_init gk110_grctx_init_cwd_0[];
  154. extern const struct gf100_gr_pack gk110_grctx_pack_gpc[];
  155. extern const struct gf100_gr_init gk110_grctx_init_gpc_unk_2[];
  156. extern const struct gf100_gr_init gk110_grctx_init_tex_0[];
  157. extern const struct gf100_gr_init gk110_grctx_init_mpc_0[];
  158. extern const struct gf100_gr_init gk110_grctx_init_l1c_0[];
  159. extern const struct gf100_gr_pack gk110_grctx_pack_ppc[];
  160. extern const struct gf100_gr_init gk208_grctx_init_rstr2d_0[];
  161. extern const struct gf100_gr_init gk208_grctx_init_prop_0[];
  162. extern const struct gf100_gr_init gk208_grctx_init_crstr_0[];
  163. extern const struct gf100_gr_init gm107_grctx_init_gpc_unk_0[];
  164. extern const struct gf100_gr_init gm107_grctx_init_wwdx_0[];
  165. extern const struct gf100_gr_pack gm204_grctx_pack_icmd[];
  166. extern const struct gf100_gr_pack gm204_grctx_pack_mthd[];
  167. extern const struct gf100_gr_pack gm204_grctx_pack_hub[];
  168. extern const struct gf100_gr_init gm204_grctx_init_prop_0[];
  169. extern const struct gf100_gr_init gm204_grctx_init_setup_0[];
  170. extern const struct gf100_gr_init gm204_grctx_init_gpm_0[];
  171. extern const struct gf100_gr_init gm204_grctx_init_gpc_unk_2[];
  172. extern const struct gf100_gr_pack gm204_grctx_pack_tpc[];
  173. extern const struct gf100_gr_pack gm204_grctx_pack_ppc[];
  174. #endif