ctxgf104.c 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /*
  2. * Copyright 2013 Red Hat Inc.
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  17. * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
  18. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  19. * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  20. * OTHER DEALINGS IN THE SOFTWARE.
  21. *
  22. * Authors: Ben Skeggs <bskeggs@redhat.com>
  23. */
  24. #include "ctxgf100.h"
  25. /*******************************************************************************
  26. * PGRAPH context register lists
  27. ******************************************************************************/
  28. const struct gf100_gr_init
  29. gf104_grctx_init_tex_0[] = {
  30. { 0x419a00, 1, 0x04, 0x000001f0 },
  31. { 0x419a04, 1, 0x04, 0x00000001 },
  32. { 0x419a08, 1, 0x04, 0x00000023 },
  33. { 0x419a0c, 1, 0x04, 0x00020000 },
  34. { 0x419a10, 1, 0x04, 0x00000000 },
  35. { 0x419a14, 1, 0x04, 0x00000200 },
  36. { 0x419a1c, 1, 0x04, 0x00000000 },
  37. { 0x419a20, 1, 0x04, 0x00000800 },
  38. { 0x419ac4, 1, 0x04, 0x0007f440 },
  39. {}
  40. };
  41. const struct gf100_gr_init
  42. gf104_grctx_init_l1c_0[] = {
  43. { 0x419cb0, 1, 0x04, 0x00020048 },
  44. { 0x419ce8, 1, 0x04, 0x00000000 },
  45. { 0x419cf4, 1, 0x04, 0x00000183 },
  46. {}
  47. };
  48. const struct gf100_gr_init
  49. gf104_grctx_init_sm_0[] = {
  50. { 0x419e04, 3, 0x04, 0x00000000 },
  51. { 0x419e10, 1, 0x04, 0x00000002 },
  52. { 0x419e44, 1, 0x04, 0x001beff2 },
  53. { 0x419e48, 1, 0x04, 0x00000000 },
  54. { 0x419e4c, 1, 0x04, 0x0000000f },
  55. { 0x419e50, 17, 0x04, 0x00000000 },
  56. { 0x419e98, 1, 0x04, 0x00000000 },
  57. { 0x419ee0, 1, 0x04, 0x00011110 },
  58. { 0x419f30, 11, 0x04, 0x00000000 },
  59. {}
  60. };
  61. static const struct gf100_gr_pack
  62. gf104_grctx_pack_tpc[] = {
  63. { gf100_grctx_init_pe_0 },
  64. { gf104_grctx_init_tex_0 },
  65. { gf100_grctx_init_wwdx_0 },
  66. { gf100_grctx_init_mpc_0 },
  67. { gf104_grctx_init_l1c_0 },
  68. { gf100_grctx_init_tpccs_0 },
  69. { gf104_grctx_init_sm_0 },
  70. {}
  71. };
  72. /*******************************************************************************
  73. * PGRAPH context implementation
  74. ******************************************************************************/
  75. const struct gf100_grctx_func
  76. gf104_grctx = {
  77. .main = gf100_grctx_generate_main,
  78. .unkn = gf100_grctx_generate_unkn,
  79. .hub = gf100_grctx_pack_hub,
  80. .gpc = gf100_grctx_pack_gpc,
  81. .zcull = gf100_grctx_pack_zcull,
  82. .tpc = gf104_grctx_pack_tpc,
  83. .icmd = gf100_grctx_pack_icmd,
  84. .mthd = gf100_grctx_pack_mthd,
  85. .bundle = gf100_grctx_generate_bundle,
  86. .bundle_size = 0x1800,
  87. .pagepool = gf100_grctx_generate_pagepool,
  88. .pagepool_size = 0x8000,
  89. .attrib = gf100_grctx_generate_attrib,
  90. .attrib_nr_max = 0x324,
  91. .attrib_nr = 0x218,
  92. };