nv50.c 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  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
  23. */
  24. #include "nv40.h"
  25. const struct nvkm_specsrc
  26. nv50_zcull_sources[] = {
  27. { 0x402ca4, (const struct nvkm_specmux[]) {
  28. { 0x7fff, 0, "unk0" },
  29. {}
  30. }, "pgraph_zcull_pm_unka4" },
  31. {}
  32. };
  33. const struct nvkm_specsrc
  34. nv50_zrop_sources[] = {
  35. { 0x40708c, (const struct nvkm_specmux[]) {
  36. { 0xf, 0, "sel0", true },
  37. { 0xf, 16, "sel1", true },
  38. {}
  39. }, "pgraph_rop0_zrop_pm_mux" },
  40. {}
  41. };
  42. static const struct nvkm_specsrc
  43. nv50_prop_sources[] = {
  44. { 0x40be50, (const struct nvkm_specmux[]) {
  45. { 0x1f, 0, "sel", true },
  46. {}
  47. }, "pgraph_tpc3_prop_pm_mux" },
  48. {}
  49. };
  50. static const struct nvkm_specsrc
  51. nv50_crop_sources[] = {
  52. { 0x407008, (const struct nvkm_specmux[]) {
  53. { 0x7, 0, "sel0", true },
  54. { 0x7, 16, "sel1", true },
  55. {}
  56. }, "pgraph_rop0_crop_pm_mux" },
  57. {}
  58. };
  59. static const struct nvkm_specsrc
  60. nv50_tex_sources[] = {
  61. { 0x40b808, (const struct nvkm_specmux[]) {
  62. { 0x3fff, 0, "unk0" },
  63. {}
  64. }, "pgraph_tpc3_tex_unk08" },
  65. {}
  66. };
  67. static const struct nvkm_specsrc
  68. nv50_vfetch_sources[] = {
  69. { 0x400c0c, (const struct nvkm_specmux[]) {
  70. { 0x1, 0, "unk0" },
  71. {}
  72. }, "pgraph_vfetch_unk0c" },
  73. {}
  74. };
  75. static const struct nvkm_specdom
  76. nv50_pm[] = {
  77. { 0x20, (const struct nvkm_specsig[]) {
  78. {}
  79. }, &nv40_perfctr_func },
  80. { 0xf0, (const struct nvkm_specsig[]) {
  81. { 0xc8, "pc01_gr_idle" },
  82. { 0x7f, "pc01_strmout_00" },
  83. { 0x80, "pc01_strmout_01" },
  84. { 0xdc, "pc01_trast_00" },
  85. { 0xdd, "pc01_trast_01" },
  86. { 0xde, "pc01_trast_02" },
  87. { 0xdf, "pc01_trast_03" },
  88. { 0xe2, "pc01_trast_04" },
  89. { 0xe3, "pc01_trast_05" },
  90. { 0x7c, "pc01_vattr_00" },
  91. { 0x7d, "pc01_vattr_01" },
  92. { 0x26, "pc01_vfetch_00", nv50_vfetch_sources },
  93. { 0x27, "pc01_vfetch_01", nv50_vfetch_sources },
  94. { 0x28, "pc01_vfetch_02", nv50_vfetch_sources },
  95. { 0x29, "pc01_vfetch_03", nv50_vfetch_sources },
  96. { 0x2a, "pc01_vfetch_04", nv50_vfetch_sources },
  97. { 0x2b, "pc01_vfetch_05", nv50_vfetch_sources },
  98. { 0x2c, "pc01_vfetch_06", nv50_vfetch_sources },
  99. { 0x2d, "pc01_vfetch_07", nv50_vfetch_sources },
  100. { 0x2e, "pc01_vfetch_08", nv50_vfetch_sources },
  101. { 0x2f, "pc01_vfetch_09", nv50_vfetch_sources },
  102. { 0x30, "pc01_vfetch_0a", nv50_vfetch_sources },
  103. { 0x31, "pc01_vfetch_0b", nv50_vfetch_sources },
  104. { 0x32, "pc01_vfetch_0c", nv50_vfetch_sources },
  105. { 0x33, "pc01_vfetch_0d", nv50_vfetch_sources },
  106. { 0x34, "pc01_vfetch_0e", nv50_vfetch_sources },
  107. { 0x35, "pc01_vfetch_0f", nv50_vfetch_sources },
  108. { 0x36, "pc01_vfetch_10", nv50_vfetch_sources },
  109. { 0x37, "pc01_vfetch_11", nv50_vfetch_sources },
  110. { 0x38, "pc01_vfetch_12", nv50_vfetch_sources },
  111. { 0x39, "pc01_vfetch_13", nv50_vfetch_sources },
  112. { 0x3a, "pc01_vfetch_14", nv50_vfetch_sources },
  113. { 0x3b, "pc01_vfetch_15", nv50_vfetch_sources },
  114. { 0x3c, "pc01_vfetch_16", nv50_vfetch_sources },
  115. { 0x3d, "pc01_vfetch_17", nv50_vfetch_sources },
  116. { 0x3e, "pc01_vfetch_18", nv50_vfetch_sources },
  117. { 0x3f, "pc01_vfetch_19", nv50_vfetch_sources },
  118. { 0x20, "pc01_zcull_00", nv50_zcull_sources },
  119. { 0x21, "pc01_zcull_01", nv50_zcull_sources },
  120. { 0x22, "pc01_zcull_02", nv50_zcull_sources },
  121. { 0x23, "pc01_zcull_03", nv50_zcull_sources },
  122. { 0x24, "pc01_zcull_04", nv50_zcull_sources },
  123. { 0x25, "pc01_zcull_05", nv50_zcull_sources },
  124. { 0xae, "pc01_unk00" },
  125. { 0xee, "pc01_trailer" },
  126. {}
  127. }, &nv40_perfctr_func },
  128. { 0xf0, (const struct nvkm_specsig[]) {
  129. { 0x52, "pc02_crop_00", nv50_crop_sources },
  130. { 0x53, "pc02_crop_01", nv50_crop_sources },
  131. { 0x54, "pc02_crop_02", nv50_crop_sources },
  132. { 0x55, "pc02_crop_03", nv50_crop_sources },
  133. { 0x00, "pc02_prop_00", nv50_prop_sources },
  134. { 0x01, "pc02_prop_01", nv50_prop_sources },
  135. { 0x02, "pc02_prop_02", nv50_prop_sources },
  136. { 0x03, "pc02_prop_03", nv50_prop_sources },
  137. { 0x04, "pc02_prop_04", nv50_prop_sources },
  138. { 0x05, "pc02_prop_05", nv50_prop_sources },
  139. { 0x06, "pc02_prop_06", nv50_prop_sources },
  140. { 0x07, "pc02_prop_07", nv50_prop_sources },
  141. { 0x70, "pc02_tex_00", nv50_tex_sources },
  142. { 0x71, "pc02_tex_01", nv50_tex_sources },
  143. { 0x72, "pc02_tex_02", nv50_tex_sources },
  144. { 0x73, "pc02_tex_03", nv50_tex_sources },
  145. { 0x40, "pc02_tex_04", nv50_tex_sources },
  146. { 0x41, "pc02_tex_05", nv50_tex_sources },
  147. { 0x42, "pc02_tex_06", nv50_tex_sources },
  148. { 0x6c, "pc02_zrop_00", nv50_zrop_sources },
  149. { 0x6d, "pc02_zrop_01", nv50_zrop_sources },
  150. { 0x6e, "pc02_zrop_02", nv50_zrop_sources },
  151. { 0x6f, "pc02_zrop_03", nv50_zrop_sources },
  152. { 0xee, "pc02_trailer" },
  153. {}
  154. }, &nv40_perfctr_func },
  155. { 0x20, (const struct nvkm_specsig[]) {
  156. {}
  157. }, &nv40_perfctr_func },
  158. { 0x20, (const struct nvkm_specsig[]) {
  159. {}
  160. }, &nv40_perfctr_func },
  161. {}
  162. };
  163. int
  164. nv50_pm_new(struct nvkm_device *device, int index, struct nvkm_pm **ppm)
  165. {
  166. return nv40_pm_new_(nv50_pm, device, index, ppm);
  167. }