g84.c 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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. g84_vfetch_sources[] = {
  27. { 0x400c0c, (const struct nvkm_specmux[]) {
  28. { 0x3, 0, "unk0" },
  29. {}
  30. }, "pgraph_vfetch_unk0c" },
  31. {}
  32. };
  33. static const struct nvkm_specsrc
  34. g84_prop_sources[] = {
  35. { 0x408e50, (const struct nvkm_specmux[]) {
  36. { 0x1f, 0, "sel", true },
  37. {}
  38. }, "pgraph_tpc0_prop_pm_mux" },
  39. {}
  40. };
  41. static const struct nvkm_specsrc
  42. g84_crop_sources[] = {
  43. { 0x407008, (const struct nvkm_specmux[]) {
  44. { 0xf, 0, "sel0", true },
  45. { 0x7, 16, "sel1", true },
  46. {}
  47. }, "pgraph_rop0_crop_pm_mux" },
  48. {}
  49. };
  50. static const struct nvkm_specsrc
  51. g84_tex_sources[] = {
  52. { 0x408808, (const struct nvkm_specmux[]) {
  53. { 0xfffff, 0, "unk0" },
  54. {}
  55. }, "pgraph_tpc0_tex_unk08" },
  56. {}
  57. };
  58. static const struct nvkm_specdom
  59. g84_pm[] = {
  60. { 0x20, (const struct nvkm_specsig[]) {
  61. {}
  62. }, &nv40_perfctr_func },
  63. { 0xf0, (const struct nvkm_specsig[]) {
  64. { 0xbd, "pc01_gr_idle" },
  65. { 0x5e, "pc01_strmout_00" },
  66. { 0x5f, "pc01_strmout_01" },
  67. { 0xd2, "pc01_trast_00" },
  68. { 0xd3, "pc01_trast_01" },
  69. { 0xd4, "pc01_trast_02" },
  70. { 0xd5, "pc01_trast_03" },
  71. { 0xd8, "pc01_trast_04" },
  72. { 0xd9, "pc01_trast_05" },
  73. { 0x5c, "pc01_vattr_00" },
  74. { 0x5d, "pc01_vattr_01" },
  75. { 0x66, "pc01_vfetch_00", g84_vfetch_sources },
  76. { 0x67, "pc01_vfetch_01", g84_vfetch_sources },
  77. { 0x68, "pc01_vfetch_02", g84_vfetch_sources },
  78. { 0x69, "pc01_vfetch_03", g84_vfetch_sources },
  79. { 0x6a, "pc01_vfetch_04", g84_vfetch_sources },
  80. { 0x6b, "pc01_vfetch_05", g84_vfetch_sources },
  81. { 0x6c, "pc01_vfetch_06", g84_vfetch_sources },
  82. { 0x6d, "pc01_vfetch_07", g84_vfetch_sources },
  83. { 0x6e, "pc01_vfetch_08", g84_vfetch_sources },
  84. { 0x6f, "pc01_vfetch_09", g84_vfetch_sources },
  85. { 0x70, "pc01_vfetch_0a", g84_vfetch_sources },
  86. { 0x71, "pc01_vfetch_0b", g84_vfetch_sources },
  87. { 0x72, "pc01_vfetch_0c", g84_vfetch_sources },
  88. { 0x73, "pc01_vfetch_0d", g84_vfetch_sources },
  89. { 0x74, "pc01_vfetch_0e", g84_vfetch_sources },
  90. { 0x75, "pc01_vfetch_0f", g84_vfetch_sources },
  91. { 0x76, "pc01_vfetch_10", g84_vfetch_sources },
  92. { 0x77, "pc01_vfetch_11", g84_vfetch_sources },
  93. { 0x78, "pc01_vfetch_12", g84_vfetch_sources },
  94. { 0x79, "pc01_vfetch_13", g84_vfetch_sources },
  95. { 0x7a, "pc01_vfetch_14", g84_vfetch_sources },
  96. { 0x7b, "pc01_vfetch_15", g84_vfetch_sources },
  97. { 0x7c, "pc01_vfetch_16", g84_vfetch_sources },
  98. { 0x7d, "pc01_vfetch_17", g84_vfetch_sources },
  99. { 0x7e, "pc01_vfetch_18", g84_vfetch_sources },
  100. { 0x7f, "pc01_vfetch_19", g84_vfetch_sources },
  101. { 0x07, "pc01_zcull_00", nv50_zcull_sources },
  102. { 0x08, "pc01_zcull_01", nv50_zcull_sources },
  103. { 0x09, "pc01_zcull_02", nv50_zcull_sources },
  104. { 0x0a, "pc01_zcull_03", nv50_zcull_sources },
  105. { 0x0b, "pc01_zcull_04", nv50_zcull_sources },
  106. { 0x0c, "pc01_zcull_05", nv50_zcull_sources },
  107. { 0xa4, "pc01_unk00" },
  108. { 0xec, "pc01_trailer" },
  109. {}
  110. }, &nv40_perfctr_func },
  111. { 0xa0, (const struct nvkm_specsig[]) {
  112. { 0x30, "pc02_crop_00", g84_crop_sources },
  113. { 0x31, "pc02_crop_01", g84_crop_sources },
  114. { 0x32, "pc02_crop_02", g84_crop_sources },
  115. { 0x33, "pc02_crop_03", g84_crop_sources },
  116. { 0x00, "pc02_prop_00", g84_prop_sources },
  117. { 0x01, "pc02_prop_01", g84_prop_sources },
  118. { 0x02, "pc02_prop_02", g84_prop_sources },
  119. { 0x03, "pc02_prop_03", g84_prop_sources },
  120. { 0x04, "pc02_prop_04", g84_prop_sources },
  121. { 0x05, "pc02_prop_05", g84_prop_sources },
  122. { 0x06, "pc02_prop_06", g84_prop_sources },
  123. { 0x07, "pc02_prop_07", g84_prop_sources },
  124. { 0x48, "pc02_tex_00", g84_tex_sources },
  125. { 0x49, "pc02_tex_01", g84_tex_sources },
  126. { 0x4a, "pc02_tex_02", g84_tex_sources },
  127. { 0x4b, "pc02_tex_03", g84_tex_sources },
  128. { 0x1a, "pc02_tex_04", g84_tex_sources },
  129. { 0x1b, "pc02_tex_05", g84_tex_sources },
  130. { 0x1c, "pc02_tex_06", g84_tex_sources },
  131. { 0x44, "pc02_zrop_00", nv50_zrop_sources },
  132. { 0x45, "pc02_zrop_01", nv50_zrop_sources },
  133. { 0x46, "pc02_zrop_02", nv50_zrop_sources },
  134. { 0x47, "pc02_zrop_03", nv50_zrop_sources },
  135. { 0x8c, "pc02_trailer" },
  136. {}
  137. }, &nv40_perfctr_func },
  138. { 0x20, (const struct nvkm_specsig[]) {
  139. {}
  140. }, &nv40_perfctr_func },
  141. { 0x20, (const struct nvkm_specsig[]) {
  142. {}
  143. }, &nv40_perfctr_func },
  144. { 0x20, (const struct nvkm_specsig[]) {
  145. {}
  146. }, &nv40_perfctr_func },
  147. { 0x20, (const struct nvkm_specsig[]) {
  148. {}
  149. }, &nv40_perfctr_func },
  150. { 0x20, (const struct nvkm_specsig[]) {
  151. {}
  152. }, &nv40_perfctr_func },
  153. {}
  154. };
  155. int
  156. g84_pm_new(struct nvkm_device *device, int index, struct nvkm_pm **ppm)
  157. {
  158. return nv40_pm_new_(g84_pm, device, index, ppm);
  159. }