radeon_asic.c 82 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694
  1. /*
  2. * Copyright 2008 Advanced Micro Devices, Inc.
  3. * Copyright 2008 Red Hat Inc.
  4. * Copyright 2009 Jerome Glisse.
  5. *
  6. * Permission is hereby granted, free of charge, to any person obtaining a
  7. * copy of this software and associated documentation files (the "Software"),
  8. * to deal in the Software without restriction, including without limitation
  9. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  10. * and/or sell copies of the Software, and to permit persons to whom the
  11. * Software is furnished to do so, subject to the following conditions:
  12. *
  13. * The above copyright notice and this permission notice shall be included in
  14. * all copies or substantial portions of the Software.
  15. *
  16. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  19. * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
  20. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  21. * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  22. * OTHER DEALINGS IN THE SOFTWARE.
  23. *
  24. * Authors: Dave Airlie
  25. * Alex Deucher
  26. * Jerome Glisse
  27. */
  28. #include <linux/console.h>
  29. #include <drm/drmP.h>
  30. #include <drm/drm_crtc_helper.h>
  31. #include <drm/radeon_drm.h>
  32. #include <linux/vgaarb.h>
  33. #include "radeon_reg.h"
  34. #include "radeon.h"
  35. #include "radeon_asic.h"
  36. #include "atom.h"
  37. /*
  38. * Registers accessors functions.
  39. */
  40. /**
  41. * radeon_invalid_rreg - dummy reg read function
  42. *
  43. * @rdev: radeon device pointer
  44. * @reg: offset of register
  45. *
  46. * Dummy register read function. Used for register blocks
  47. * that certain asics don't have (all asics).
  48. * Returns the value in the register.
  49. */
  50. static uint32_t radeon_invalid_rreg(struct radeon_device *rdev, uint32_t reg)
  51. {
  52. DRM_ERROR("Invalid callback to read register 0x%04X\n", reg);
  53. BUG_ON(1);
  54. return 0;
  55. }
  56. /**
  57. * radeon_invalid_wreg - dummy reg write function
  58. *
  59. * @rdev: radeon device pointer
  60. * @reg: offset of register
  61. * @v: value to write to the register
  62. *
  63. * Dummy register read function. Used for register blocks
  64. * that certain asics don't have (all asics).
  65. */
  66. static void radeon_invalid_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v)
  67. {
  68. DRM_ERROR("Invalid callback to write register 0x%04X with 0x%08X\n",
  69. reg, v);
  70. BUG_ON(1);
  71. }
  72. /**
  73. * radeon_register_accessor_init - sets up the register accessor callbacks
  74. *
  75. * @rdev: radeon device pointer
  76. *
  77. * Sets up the register accessor callbacks for various register
  78. * apertures. Not all asics have all apertures (all asics).
  79. */
  80. static void radeon_register_accessor_init(struct radeon_device *rdev)
  81. {
  82. rdev->mc_rreg = &radeon_invalid_rreg;
  83. rdev->mc_wreg = &radeon_invalid_wreg;
  84. rdev->pll_rreg = &radeon_invalid_rreg;
  85. rdev->pll_wreg = &radeon_invalid_wreg;
  86. rdev->pciep_rreg = &radeon_invalid_rreg;
  87. rdev->pciep_wreg = &radeon_invalid_wreg;
  88. /* Don't change order as we are overridding accessor. */
  89. if (rdev->family < CHIP_RV515) {
  90. rdev->pcie_reg_mask = 0xff;
  91. } else {
  92. rdev->pcie_reg_mask = 0x7ff;
  93. }
  94. /* FIXME: not sure here */
  95. if (rdev->family <= CHIP_R580) {
  96. rdev->pll_rreg = &r100_pll_rreg;
  97. rdev->pll_wreg = &r100_pll_wreg;
  98. }
  99. if (rdev->family >= CHIP_R420) {
  100. rdev->mc_rreg = &r420_mc_rreg;
  101. rdev->mc_wreg = &r420_mc_wreg;
  102. }
  103. if (rdev->family >= CHIP_RV515) {
  104. rdev->mc_rreg = &rv515_mc_rreg;
  105. rdev->mc_wreg = &rv515_mc_wreg;
  106. }
  107. if (rdev->family == CHIP_RS400 || rdev->family == CHIP_RS480) {
  108. rdev->mc_rreg = &rs400_mc_rreg;
  109. rdev->mc_wreg = &rs400_mc_wreg;
  110. }
  111. if (rdev->family == CHIP_RS690 || rdev->family == CHIP_RS740) {
  112. rdev->mc_rreg = &rs690_mc_rreg;
  113. rdev->mc_wreg = &rs690_mc_wreg;
  114. }
  115. if (rdev->family == CHIP_RS600) {
  116. rdev->mc_rreg = &rs600_mc_rreg;
  117. rdev->mc_wreg = &rs600_mc_wreg;
  118. }
  119. if (rdev->family == CHIP_RS780 || rdev->family == CHIP_RS880) {
  120. rdev->mc_rreg = &rs780_mc_rreg;
  121. rdev->mc_wreg = &rs780_mc_wreg;
  122. }
  123. if (rdev->family >= CHIP_BONAIRE) {
  124. rdev->pciep_rreg = &cik_pciep_rreg;
  125. rdev->pciep_wreg = &cik_pciep_wreg;
  126. } else if (rdev->family >= CHIP_R600) {
  127. rdev->pciep_rreg = &r600_pciep_rreg;
  128. rdev->pciep_wreg = &r600_pciep_wreg;
  129. }
  130. }
  131. static int radeon_invalid_get_allowed_info_register(struct radeon_device *rdev,
  132. u32 reg, u32 *val)
  133. {
  134. return -EINVAL;
  135. }
  136. /* helper to disable agp */
  137. /**
  138. * radeon_agp_disable - AGP disable helper function
  139. *
  140. * @rdev: radeon device pointer
  141. *
  142. * Removes AGP flags and changes the gart callbacks on AGP
  143. * cards when using the internal gart rather than AGP (all asics).
  144. */
  145. void radeon_agp_disable(struct radeon_device *rdev)
  146. {
  147. rdev->flags &= ~RADEON_IS_AGP;
  148. if (rdev->family >= CHIP_R600) {
  149. DRM_INFO("Forcing AGP to PCIE mode\n");
  150. rdev->flags |= RADEON_IS_PCIE;
  151. } else if (rdev->family >= CHIP_RV515 ||
  152. rdev->family == CHIP_RV380 ||
  153. rdev->family == CHIP_RV410 ||
  154. rdev->family == CHIP_R423) {
  155. DRM_INFO("Forcing AGP to PCIE mode\n");
  156. rdev->flags |= RADEON_IS_PCIE;
  157. rdev->asic->gart.tlb_flush = &rv370_pcie_gart_tlb_flush;
  158. rdev->asic->gart.get_page_entry = &rv370_pcie_gart_get_page_entry;
  159. rdev->asic->gart.set_page = &rv370_pcie_gart_set_page;
  160. } else {
  161. DRM_INFO("Forcing AGP to PCI mode\n");
  162. rdev->flags |= RADEON_IS_PCI;
  163. rdev->asic->gart.tlb_flush = &r100_pci_gart_tlb_flush;
  164. rdev->asic->gart.get_page_entry = &r100_pci_gart_get_page_entry;
  165. rdev->asic->gart.set_page = &r100_pci_gart_set_page;
  166. }
  167. rdev->mc.gtt_size = radeon_gart_size * 1024 * 1024;
  168. }
  169. /*
  170. * ASIC
  171. */
  172. static struct radeon_asic_ring r100_gfx_ring = {
  173. .ib_execute = &r100_ring_ib_execute,
  174. .emit_fence = &r100_fence_ring_emit,
  175. .emit_semaphore = &r100_semaphore_ring_emit,
  176. .cs_parse = &r100_cs_parse,
  177. .ring_start = &r100_ring_start,
  178. .ring_test = &r100_ring_test,
  179. .ib_test = &r100_ib_test,
  180. .is_lockup = &r100_gpu_is_lockup,
  181. .get_rptr = &r100_gfx_get_rptr,
  182. .get_wptr = &r100_gfx_get_wptr,
  183. .set_wptr = &r100_gfx_set_wptr,
  184. };
  185. static struct radeon_asic r100_asic = {
  186. .init = &r100_init,
  187. .fini = &r100_fini,
  188. .suspend = &r100_suspend,
  189. .resume = &r100_resume,
  190. .vga_set_state = &r100_vga_set_state,
  191. .asic_reset = &r100_asic_reset,
  192. .mmio_hdp_flush = NULL,
  193. .gui_idle = &r100_gui_idle,
  194. .mc_wait_for_idle = &r100_mc_wait_for_idle,
  195. .get_allowed_info_register = radeon_invalid_get_allowed_info_register,
  196. .gart = {
  197. .tlb_flush = &r100_pci_gart_tlb_flush,
  198. .get_page_entry = &r100_pci_gart_get_page_entry,
  199. .set_page = &r100_pci_gart_set_page,
  200. },
  201. .ring = {
  202. [RADEON_RING_TYPE_GFX_INDEX] = &r100_gfx_ring
  203. },
  204. .irq = {
  205. .set = &r100_irq_set,
  206. .process = &r100_irq_process,
  207. },
  208. .display = {
  209. .bandwidth_update = &r100_bandwidth_update,
  210. .get_vblank_counter = &r100_get_vblank_counter,
  211. .wait_for_vblank = &r100_wait_for_vblank,
  212. .set_backlight_level = &radeon_legacy_set_backlight_level,
  213. .get_backlight_level = &radeon_legacy_get_backlight_level,
  214. },
  215. .copy = {
  216. .blit = &r100_copy_blit,
  217. .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  218. .dma = NULL,
  219. .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  220. .copy = &r100_copy_blit,
  221. .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  222. },
  223. .surface = {
  224. .set_reg = r100_set_surface_reg,
  225. .clear_reg = r100_clear_surface_reg,
  226. },
  227. .hpd = {
  228. .init = &r100_hpd_init,
  229. .fini = &r100_hpd_fini,
  230. .sense = &r100_hpd_sense,
  231. .set_polarity = &r100_hpd_set_polarity,
  232. },
  233. .pm = {
  234. .misc = &r100_pm_misc,
  235. .prepare = &r100_pm_prepare,
  236. .finish = &r100_pm_finish,
  237. .init_profile = &r100_pm_init_profile,
  238. .get_dynpm_state = &r100_pm_get_dynpm_state,
  239. .get_engine_clock = &radeon_legacy_get_engine_clock,
  240. .set_engine_clock = &radeon_legacy_set_engine_clock,
  241. .get_memory_clock = &radeon_legacy_get_memory_clock,
  242. .set_memory_clock = NULL,
  243. .get_pcie_lanes = NULL,
  244. .set_pcie_lanes = NULL,
  245. .set_clock_gating = &radeon_legacy_set_clock_gating,
  246. },
  247. .pflip = {
  248. .page_flip = &r100_page_flip,
  249. .page_flip_pending = &r100_page_flip_pending,
  250. },
  251. };
  252. static struct radeon_asic r200_asic = {
  253. .init = &r100_init,
  254. .fini = &r100_fini,
  255. .suspend = &r100_suspend,
  256. .resume = &r100_resume,
  257. .vga_set_state = &r100_vga_set_state,
  258. .asic_reset = &r100_asic_reset,
  259. .mmio_hdp_flush = NULL,
  260. .gui_idle = &r100_gui_idle,
  261. .mc_wait_for_idle = &r100_mc_wait_for_idle,
  262. .get_allowed_info_register = radeon_invalid_get_allowed_info_register,
  263. .gart = {
  264. .tlb_flush = &r100_pci_gart_tlb_flush,
  265. .get_page_entry = &r100_pci_gart_get_page_entry,
  266. .set_page = &r100_pci_gart_set_page,
  267. },
  268. .ring = {
  269. [RADEON_RING_TYPE_GFX_INDEX] = &r100_gfx_ring
  270. },
  271. .irq = {
  272. .set = &r100_irq_set,
  273. .process = &r100_irq_process,
  274. },
  275. .display = {
  276. .bandwidth_update = &r100_bandwidth_update,
  277. .get_vblank_counter = &r100_get_vblank_counter,
  278. .wait_for_vblank = &r100_wait_for_vblank,
  279. .set_backlight_level = &radeon_legacy_set_backlight_level,
  280. .get_backlight_level = &radeon_legacy_get_backlight_level,
  281. },
  282. .copy = {
  283. .blit = &r100_copy_blit,
  284. .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  285. .dma = &r200_copy_dma,
  286. .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  287. .copy = &r100_copy_blit,
  288. .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  289. },
  290. .surface = {
  291. .set_reg = r100_set_surface_reg,
  292. .clear_reg = r100_clear_surface_reg,
  293. },
  294. .hpd = {
  295. .init = &r100_hpd_init,
  296. .fini = &r100_hpd_fini,
  297. .sense = &r100_hpd_sense,
  298. .set_polarity = &r100_hpd_set_polarity,
  299. },
  300. .pm = {
  301. .misc = &r100_pm_misc,
  302. .prepare = &r100_pm_prepare,
  303. .finish = &r100_pm_finish,
  304. .init_profile = &r100_pm_init_profile,
  305. .get_dynpm_state = &r100_pm_get_dynpm_state,
  306. .get_engine_clock = &radeon_legacy_get_engine_clock,
  307. .set_engine_clock = &radeon_legacy_set_engine_clock,
  308. .get_memory_clock = &radeon_legacy_get_memory_clock,
  309. .set_memory_clock = NULL,
  310. .get_pcie_lanes = NULL,
  311. .set_pcie_lanes = NULL,
  312. .set_clock_gating = &radeon_legacy_set_clock_gating,
  313. },
  314. .pflip = {
  315. .page_flip = &r100_page_flip,
  316. .page_flip_pending = &r100_page_flip_pending,
  317. },
  318. };
  319. static struct radeon_asic_ring r300_gfx_ring = {
  320. .ib_execute = &r100_ring_ib_execute,
  321. .emit_fence = &r300_fence_ring_emit,
  322. .emit_semaphore = &r100_semaphore_ring_emit,
  323. .cs_parse = &r300_cs_parse,
  324. .ring_start = &r300_ring_start,
  325. .ring_test = &r100_ring_test,
  326. .ib_test = &r100_ib_test,
  327. .is_lockup = &r100_gpu_is_lockup,
  328. .get_rptr = &r100_gfx_get_rptr,
  329. .get_wptr = &r100_gfx_get_wptr,
  330. .set_wptr = &r100_gfx_set_wptr,
  331. };
  332. static struct radeon_asic_ring rv515_gfx_ring = {
  333. .ib_execute = &r100_ring_ib_execute,
  334. .emit_fence = &r300_fence_ring_emit,
  335. .emit_semaphore = &r100_semaphore_ring_emit,
  336. .cs_parse = &r300_cs_parse,
  337. .ring_start = &rv515_ring_start,
  338. .ring_test = &r100_ring_test,
  339. .ib_test = &r100_ib_test,
  340. .is_lockup = &r100_gpu_is_lockup,
  341. .get_rptr = &r100_gfx_get_rptr,
  342. .get_wptr = &r100_gfx_get_wptr,
  343. .set_wptr = &r100_gfx_set_wptr,
  344. };
  345. static struct radeon_asic r300_asic = {
  346. .init = &r300_init,
  347. .fini = &r300_fini,
  348. .suspend = &r300_suspend,
  349. .resume = &r300_resume,
  350. .vga_set_state = &r100_vga_set_state,
  351. .asic_reset = &r300_asic_reset,
  352. .mmio_hdp_flush = NULL,
  353. .gui_idle = &r100_gui_idle,
  354. .mc_wait_for_idle = &r300_mc_wait_for_idle,
  355. .get_allowed_info_register = radeon_invalid_get_allowed_info_register,
  356. .gart = {
  357. .tlb_flush = &r100_pci_gart_tlb_flush,
  358. .get_page_entry = &r100_pci_gart_get_page_entry,
  359. .set_page = &r100_pci_gart_set_page,
  360. },
  361. .ring = {
  362. [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
  363. },
  364. .irq = {
  365. .set = &r100_irq_set,
  366. .process = &r100_irq_process,
  367. },
  368. .display = {
  369. .bandwidth_update = &r100_bandwidth_update,
  370. .get_vblank_counter = &r100_get_vblank_counter,
  371. .wait_for_vblank = &r100_wait_for_vblank,
  372. .set_backlight_level = &radeon_legacy_set_backlight_level,
  373. .get_backlight_level = &radeon_legacy_get_backlight_level,
  374. },
  375. .copy = {
  376. .blit = &r100_copy_blit,
  377. .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  378. .dma = &r200_copy_dma,
  379. .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  380. .copy = &r100_copy_blit,
  381. .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  382. },
  383. .surface = {
  384. .set_reg = r100_set_surface_reg,
  385. .clear_reg = r100_clear_surface_reg,
  386. },
  387. .hpd = {
  388. .init = &r100_hpd_init,
  389. .fini = &r100_hpd_fini,
  390. .sense = &r100_hpd_sense,
  391. .set_polarity = &r100_hpd_set_polarity,
  392. },
  393. .pm = {
  394. .misc = &r100_pm_misc,
  395. .prepare = &r100_pm_prepare,
  396. .finish = &r100_pm_finish,
  397. .init_profile = &r100_pm_init_profile,
  398. .get_dynpm_state = &r100_pm_get_dynpm_state,
  399. .get_engine_clock = &radeon_legacy_get_engine_clock,
  400. .set_engine_clock = &radeon_legacy_set_engine_clock,
  401. .get_memory_clock = &radeon_legacy_get_memory_clock,
  402. .set_memory_clock = NULL,
  403. .get_pcie_lanes = &rv370_get_pcie_lanes,
  404. .set_pcie_lanes = &rv370_set_pcie_lanes,
  405. .set_clock_gating = &radeon_legacy_set_clock_gating,
  406. },
  407. .pflip = {
  408. .page_flip = &r100_page_flip,
  409. .page_flip_pending = &r100_page_flip_pending,
  410. },
  411. };
  412. static struct radeon_asic r300_asic_pcie = {
  413. .init = &r300_init,
  414. .fini = &r300_fini,
  415. .suspend = &r300_suspend,
  416. .resume = &r300_resume,
  417. .vga_set_state = &r100_vga_set_state,
  418. .asic_reset = &r300_asic_reset,
  419. .mmio_hdp_flush = NULL,
  420. .gui_idle = &r100_gui_idle,
  421. .mc_wait_for_idle = &r300_mc_wait_for_idle,
  422. .get_allowed_info_register = radeon_invalid_get_allowed_info_register,
  423. .gart = {
  424. .tlb_flush = &rv370_pcie_gart_tlb_flush,
  425. .get_page_entry = &rv370_pcie_gart_get_page_entry,
  426. .set_page = &rv370_pcie_gart_set_page,
  427. },
  428. .ring = {
  429. [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
  430. },
  431. .irq = {
  432. .set = &r100_irq_set,
  433. .process = &r100_irq_process,
  434. },
  435. .display = {
  436. .bandwidth_update = &r100_bandwidth_update,
  437. .get_vblank_counter = &r100_get_vblank_counter,
  438. .wait_for_vblank = &r100_wait_for_vblank,
  439. .set_backlight_level = &radeon_legacy_set_backlight_level,
  440. .get_backlight_level = &radeon_legacy_get_backlight_level,
  441. },
  442. .copy = {
  443. .blit = &r100_copy_blit,
  444. .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  445. .dma = &r200_copy_dma,
  446. .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  447. .copy = &r100_copy_blit,
  448. .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  449. },
  450. .surface = {
  451. .set_reg = r100_set_surface_reg,
  452. .clear_reg = r100_clear_surface_reg,
  453. },
  454. .hpd = {
  455. .init = &r100_hpd_init,
  456. .fini = &r100_hpd_fini,
  457. .sense = &r100_hpd_sense,
  458. .set_polarity = &r100_hpd_set_polarity,
  459. },
  460. .pm = {
  461. .misc = &r100_pm_misc,
  462. .prepare = &r100_pm_prepare,
  463. .finish = &r100_pm_finish,
  464. .init_profile = &r100_pm_init_profile,
  465. .get_dynpm_state = &r100_pm_get_dynpm_state,
  466. .get_engine_clock = &radeon_legacy_get_engine_clock,
  467. .set_engine_clock = &radeon_legacy_set_engine_clock,
  468. .get_memory_clock = &radeon_legacy_get_memory_clock,
  469. .set_memory_clock = NULL,
  470. .get_pcie_lanes = &rv370_get_pcie_lanes,
  471. .set_pcie_lanes = &rv370_set_pcie_lanes,
  472. .set_clock_gating = &radeon_legacy_set_clock_gating,
  473. },
  474. .pflip = {
  475. .page_flip = &r100_page_flip,
  476. .page_flip_pending = &r100_page_flip_pending,
  477. },
  478. };
  479. static struct radeon_asic r420_asic = {
  480. .init = &r420_init,
  481. .fini = &r420_fini,
  482. .suspend = &r420_suspend,
  483. .resume = &r420_resume,
  484. .vga_set_state = &r100_vga_set_state,
  485. .asic_reset = &r300_asic_reset,
  486. .mmio_hdp_flush = NULL,
  487. .gui_idle = &r100_gui_idle,
  488. .mc_wait_for_idle = &r300_mc_wait_for_idle,
  489. .get_allowed_info_register = radeon_invalid_get_allowed_info_register,
  490. .gart = {
  491. .tlb_flush = &rv370_pcie_gart_tlb_flush,
  492. .get_page_entry = &rv370_pcie_gart_get_page_entry,
  493. .set_page = &rv370_pcie_gart_set_page,
  494. },
  495. .ring = {
  496. [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
  497. },
  498. .irq = {
  499. .set = &r100_irq_set,
  500. .process = &r100_irq_process,
  501. },
  502. .display = {
  503. .bandwidth_update = &r100_bandwidth_update,
  504. .get_vblank_counter = &r100_get_vblank_counter,
  505. .wait_for_vblank = &r100_wait_for_vblank,
  506. .set_backlight_level = &atombios_set_backlight_level,
  507. .get_backlight_level = &atombios_get_backlight_level,
  508. },
  509. .copy = {
  510. .blit = &r100_copy_blit,
  511. .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  512. .dma = &r200_copy_dma,
  513. .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  514. .copy = &r100_copy_blit,
  515. .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  516. },
  517. .surface = {
  518. .set_reg = r100_set_surface_reg,
  519. .clear_reg = r100_clear_surface_reg,
  520. },
  521. .hpd = {
  522. .init = &r100_hpd_init,
  523. .fini = &r100_hpd_fini,
  524. .sense = &r100_hpd_sense,
  525. .set_polarity = &r100_hpd_set_polarity,
  526. },
  527. .pm = {
  528. .misc = &r100_pm_misc,
  529. .prepare = &r100_pm_prepare,
  530. .finish = &r100_pm_finish,
  531. .init_profile = &r420_pm_init_profile,
  532. .get_dynpm_state = &r100_pm_get_dynpm_state,
  533. .get_engine_clock = &radeon_atom_get_engine_clock,
  534. .set_engine_clock = &radeon_atom_set_engine_clock,
  535. .get_memory_clock = &radeon_atom_get_memory_clock,
  536. .set_memory_clock = &radeon_atom_set_memory_clock,
  537. .get_pcie_lanes = &rv370_get_pcie_lanes,
  538. .set_pcie_lanes = &rv370_set_pcie_lanes,
  539. .set_clock_gating = &radeon_atom_set_clock_gating,
  540. },
  541. .pflip = {
  542. .page_flip = &r100_page_flip,
  543. .page_flip_pending = &r100_page_flip_pending,
  544. },
  545. };
  546. static struct radeon_asic rs400_asic = {
  547. .init = &rs400_init,
  548. .fini = &rs400_fini,
  549. .suspend = &rs400_suspend,
  550. .resume = &rs400_resume,
  551. .vga_set_state = &r100_vga_set_state,
  552. .asic_reset = &r300_asic_reset,
  553. .mmio_hdp_flush = NULL,
  554. .gui_idle = &r100_gui_idle,
  555. .mc_wait_for_idle = &rs400_mc_wait_for_idle,
  556. .get_allowed_info_register = radeon_invalid_get_allowed_info_register,
  557. .gart = {
  558. .tlb_flush = &rs400_gart_tlb_flush,
  559. .get_page_entry = &rs400_gart_get_page_entry,
  560. .set_page = &rs400_gart_set_page,
  561. },
  562. .ring = {
  563. [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
  564. },
  565. .irq = {
  566. .set = &r100_irq_set,
  567. .process = &r100_irq_process,
  568. },
  569. .display = {
  570. .bandwidth_update = &r100_bandwidth_update,
  571. .get_vblank_counter = &r100_get_vblank_counter,
  572. .wait_for_vblank = &r100_wait_for_vblank,
  573. .set_backlight_level = &radeon_legacy_set_backlight_level,
  574. .get_backlight_level = &radeon_legacy_get_backlight_level,
  575. },
  576. .copy = {
  577. .blit = &r100_copy_blit,
  578. .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  579. .dma = &r200_copy_dma,
  580. .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  581. .copy = &r100_copy_blit,
  582. .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  583. },
  584. .surface = {
  585. .set_reg = r100_set_surface_reg,
  586. .clear_reg = r100_clear_surface_reg,
  587. },
  588. .hpd = {
  589. .init = &r100_hpd_init,
  590. .fini = &r100_hpd_fini,
  591. .sense = &r100_hpd_sense,
  592. .set_polarity = &r100_hpd_set_polarity,
  593. },
  594. .pm = {
  595. .misc = &r100_pm_misc,
  596. .prepare = &r100_pm_prepare,
  597. .finish = &r100_pm_finish,
  598. .init_profile = &r100_pm_init_profile,
  599. .get_dynpm_state = &r100_pm_get_dynpm_state,
  600. .get_engine_clock = &radeon_legacy_get_engine_clock,
  601. .set_engine_clock = &radeon_legacy_set_engine_clock,
  602. .get_memory_clock = &radeon_legacy_get_memory_clock,
  603. .set_memory_clock = NULL,
  604. .get_pcie_lanes = NULL,
  605. .set_pcie_lanes = NULL,
  606. .set_clock_gating = &radeon_legacy_set_clock_gating,
  607. },
  608. .pflip = {
  609. .page_flip = &r100_page_flip,
  610. .page_flip_pending = &r100_page_flip_pending,
  611. },
  612. };
  613. static struct radeon_asic rs600_asic = {
  614. .init = &rs600_init,
  615. .fini = &rs600_fini,
  616. .suspend = &rs600_suspend,
  617. .resume = &rs600_resume,
  618. .vga_set_state = &r100_vga_set_state,
  619. .asic_reset = &rs600_asic_reset,
  620. .mmio_hdp_flush = NULL,
  621. .gui_idle = &r100_gui_idle,
  622. .mc_wait_for_idle = &rs600_mc_wait_for_idle,
  623. .get_allowed_info_register = radeon_invalid_get_allowed_info_register,
  624. .gart = {
  625. .tlb_flush = &rs600_gart_tlb_flush,
  626. .get_page_entry = &rs600_gart_get_page_entry,
  627. .set_page = &rs600_gart_set_page,
  628. },
  629. .ring = {
  630. [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
  631. },
  632. .irq = {
  633. .set = &rs600_irq_set,
  634. .process = &rs600_irq_process,
  635. },
  636. .display = {
  637. .bandwidth_update = &rs600_bandwidth_update,
  638. .get_vblank_counter = &rs600_get_vblank_counter,
  639. .wait_for_vblank = &avivo_wait_for_vblank,
  640. .set_backlight_level = &atombios_set_backlight_level,
  641. .get_backlight_level = &atombios_get_backlight_level,
  642. },
  643. .copy = {
  644. .blit = &r100_copy_blit,
  645. .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  646. .dma = &r200_copy_dma,
  647. .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  648. .copy = &r100_copy_blit,
  649. .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  650. },
  651. .surface = {
  652. .set_reg = r100_set_surface_reg,
  653. .clear_reg = r100_clear_surface_reg,
  654. },
  655. .hpd = {
  656. .init = &rs600_hpd_init,
  657. .fini = &rs600_hpd_fini,
  658. .sense = &rs600_hpd_sense,
  659. .set_polarity = &rs600_hpd_set_polarity,
  660. },
  661. .pm = {
  662. .misc = &rs600_pm_misc,
  663. .prepare = &rs600_pm_prepare,
  664. .finish = &rs600_pm_finish,
  665. .init_profile = &r420_pm_init_profile,
  666. .get_dynpm_state = &r100_pm_get_dynpm_state,
  667. .get_engine_clock = &radeon_atom_get_engine_clock,
  668. .set_engine_clock = &radeon_atom_set_engine_clock,
  669. .get_memory_clock = &radeon_atom_get_memory_clock,
  670. .set_memory_clock = &radeon_atom_set_memory_clock,
  671. .get_pcie_lanes = NULL,
  672. .set_pcie_lanes = NULL,
  673. .set_clock_gating = &radeon_atom_set_clock_gating,
  674. },
  675. .pflip = {
  676. .page_flip = &rs600_page_flip,
  677. .page_flip_pending = &rs600_page_flip_pending,
  678. },
  679. };
  680. static struct radeon_asic rs690_asic = {
  681. .init = &rs690_init,
  682. .fini = &rs690_fini,
  683. .suspend = &rs690_suspend,
  684. .resume = &rs690_resume,
  685. .vga_set_state = &r100_vga_set_state,
  686. .asic_reset = &rs600_asic_reset,
  687. .mmio_hdp_flush = NULL,
  688. .gui_idle = &r100_gui_idle,
  689. .mc_wait_for_idle = &rs690_mc_wait_for_idle,
  690. .get_allowed_info_register = radeon_invalid_get_allowed_info_register,
  691. .gart = {
  692. .tlb_flush = &rs400_gart_tlb_flush,
  693. .get_page_entry = &rs400_gart_get_page_entry,
  694. .set_page = &rs400_gart_set_page,
  695. },
  696. .ring = {
  697. [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
  698. },
  699. .irq = {
  700. .set = &rs600_irq_set,
  701. .process = &rs600_irq_process,
  702. },
  703. .display = {
  704. .get_vblank_counter = &rs600_get_vblank_counter,
  705. .bandwidth_update = &rs690_bandwidth_update,
  706. .wait_for_vblank = &avivo_wait_for_vblank,
  707. .set_backlight_level = &atombios_set_backlight_level,
  708. .get_backlight_level = &atombios_get_backlight_level,
  709. },
  710. .copy = {
  711. .blit = &r100_copy_blit,
  712. .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  713. .dma = &r200_copy_dma,
  714. .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  715. .copy = &r200_copy_dma,
  716. .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  717. },
  718. .surface = {
  719. .set_reg = r100_set_surface_reg,
  720. .clear_reg = r100_clear_surface_reg,
  721. },
  722. .hpd = {
  723. .init = &rs600_hpd_init,
  724. .fini = &rs600_hpd_fini,
  725. .sense = &rs600_hpd_sense,
  726. .set_polarity = &rs600_hpd_set_polarity,
  727. },
  728. .pm = {
  729. .misc = &rs600_pm_misc,
  730. .prepare = &rs600_pm_prepare,
  731. .finish = &rs600_pm_finish,
  732. .init_profile = &r420_pm_init_profile,
  733. .get_dynpm_state = &r100_pm_get_dynpm_state,
  734. .get_engine_clock = &radeon_atom_get_engine_clock,
  735. .set_engine_clock = &radeon_atom_set_engine_clock,
  736. .get_memory_clock = &radeon_atom_get_memory_clock,
  737. .set_memory_clock = &radeon_atom_set_memory_clock,
  738. .get_pcie_lanes = NULL,
  739. .set_pcie_lanes = NULL,
  740. .set_clock_gating = &radeon_atom_set_clock_gating,
  741. },
  742. .pflip = {
  743. .page_flip = &rs600_page_flip,
  744. .page_flip_pending = &rs600_page_flip_pending,
  745. },
  746. };
  747. static struct radeon_asic rv515_asic = {
  748. .init = &rv515_init,
  749. .fini = &rv515_fini,
  750. .suspend = &rv515_suspend,
  751. .resume = &rv515_resume,
  752. .vga_set_state = &r100_vga_set_state,
  753. .asic_reset = &rs600_asic_reset,
  754. .mmio_hdp_flush = NULL,
  755. .gui_idle = &r100_gui_idle,
  756. .mc_wait_for_idle = &rv515_mc_wait_for_idle,
  757. .get_allowed_info_register = radeon_invalid_get_allowed_info_register,
  758. .gart = {
  759. .tlb_flush = &rv370_pcie_gart_tlb_flush,
  760. .get_page_entry = &rv370_pcie_gart_get_page_entry,
  761. .set_page = &rv370_pcie_gart_set_page,
  762. },
  763. .ring = {
  764. [RADEON_RING_TYPE_GFX_INDEX] = &rv515_gfx_ring
  765. },
  766. .irq = {
  767. .set = &rs600_irq_set,
  768. .process = &rs600_irq_process,
  769. },
  770. .display = {
  771. .get_vblank_counter = &rs600_get_vblank_counter,
  772. .bandwidth_update = &rv515_bandwidth_update,
  773. .wait_for_vblank = &avivo_wait_for_vblank,
  774. .set_backlight_level = &atombios_set_backlight_level,
  775. .get_backlight_level = &atombios_get_backlight_level,
  776. },
  777. .copy = {
  778. .blit = &r100_copy_blit,
  779. .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  780. .dma = &r200_copy_dma,
  781. .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  782. .copy = &r100_copy_blit,
  783. .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  784. },
  785. .surface = {
  786. .set_reg = r100_set_surface_reg,
  787. .clear_reg = r100_clear_surface_reg,
  788. },
  789. .hpd = {
  790. .init = &rs600_hpd_init,
  791. .fini = &rs600_hpd_fini,
  792. .sense = &rs600_hpd_sense,
  793. .set_polarity = &rs600_hpd_set_polarity,
  794. },
  795. .pm = {
  796. .misc = &rs600_pm_misc,
  797. .prepare = &rs600_pm_prepare,
  798. .finish = &rs600_pm_finish,
  799. .init_profile = &r420_pm_init_profile,
  800. .get_dynpm_state = &r100_pm_get_dynpm_state,
  801. .get_engine_clock = &radeon_atom_get_engine_clock,
  802. .set_engine_clock = &radeon_atom_set_engine_clock,
  803. .get_memory_clock = &radeon_atom_get_memory_clock,
  804. .set_memory_clock = &radeon_atom_set_memory_clock,
  805. .get_pcie_lanes = &rv370_get_pcie_lanes,
  806. .set_pcie_lanes = &rv370_set_pcie_lanes,
  807. .set_clock_gating = &radeon_atom_set_clock_gating,
  808. },
  809. .pflip = {
  810. .page_flip = &rs600_page_flip,
  811. .page_flip_pending = &rs600_page_flip_pending,
  812. },
  813. };
  814. static struct radeon_asic r520_asic = {
  815. .init = &r520_init,
  816. .fini = &rv515_fini,
  817. .suspend = &rv515_suspend,
  818. .resume = &r520_resume,
  819. .vga_set_state = &r100_vga_set_state,
  820. .asic_reset = &rs600_asic_reset,
  821. .mmio_hdp_flush = NULL,
  822. .gui_idle = &r100_gui_idle,
  823. .mc_wait_for_idle = &r520_mc_wait_for_idle,
  824. .get_allowed_info_register = radeon_invalid_get_allowed_info_register,
  825. .gart = {
  826. .tlb_flush = &rv370_pcie_gart_tlb_flush,
  827. .get_page_entry = &rv370_pcie_gart_get_page_entry,
  828. .set_page = &rv370_pcie_gart_set_page,
  829. },
  830. .ring = {
  831. [RADEON_RING_TYPE_GFX_INDEX] = &rv515_gfx_ring
  832. },
  833. .irq = {
  834. .set = &rs600_irq_set,
  835. .process = &rs600_irq_process,
  836. },
  837. .display = {
  838. .bandwidth_update = &rv515_bandwidth_update,
  839. .get_vblank_counter = &rs600_get_vblank_counter,
  840. .wait_for_vblank = &avivo_wait_for_vblank,
  841. .set_backlight_level = &atombios_set_backlight_level,
  842. .get_backlight_level = &atombios_get_backlight_level,
  843. },
  844. .copy = {
  845. .blit = &r100_copy_blit,
  846. .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  847. .dma = &r200_copy_dma,
  848. .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  849. .copy = &r100_copy_blit,
  850. .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  851. },
  852. .surface = {
  853. .set_reg = r100_set_surface_reg,
  854. .clear_reg = r100_clear_surface_reg,
  855. },
  856. .hpd = {
  857. .init = &rs600_hpd_init,
  858. .fini = &rs600_hpd_fini,
  859. .sense = &rs600_hpd_sense,
  860. .set_polarity = &rs600_hpd_set_polarity,
  861. },
  862. .pm = {
  863. .misc = &rs600_pm_misc,
  864. .prepare = &rs600_pm_prepare,
  865. .finish = &rs600_pm_finish,
  866. .init_profile = &r420_pm_init_profile,
  867. .get_dynpm_state = &r100_pm_get_dynpm_state,
  868. .get_engine_clock = &radeon_atom_get_engine_clock,
  869. .set_engine_clock = &radeon_atom_set_engine_clock,
  870. .get_memory_clock = &radeon_atom_get_memory_clock,
  871. .set_memory_clock = &radeon_atom_set_memory_clock,
  872. .get_pcie_lanes = &rv370_get_pcie_lanes,
  873. .set_pcie_lanes = &rv370_set_pcie_lanes,
  874. .set_clock_gating = &radeon_atom_set_clock_gating,
  875. },
  876. .pflip = {
  877. .page_flip = &rs600_page_flip,
  878. .page_flip_pending = &rs600_page_flip_pending,
  879. },
  880. };
  881. static struct radeon_asic_ring r600_gfx_ring = {
  882. .ib_execute = &r600_ring_ib_execute,
  883. .emit_fence = &r600_fence_ring_emit,
  884. .emit_semaphore = &r600_semaphore_ring_emit,
  885. .cs_parse = &r600_cs_parse,
  886. .ring_test = &r600_ring_test,
  887. .ib_test = &r600_ib_test,
  888. .is_lockup = &r600_gfx_is_lockup,
  889. .get_rptr = &r600_gfx_get_rptr,
  890. .get_wptr = &r600_gfx_get_wptr,
  891. .set_wptr = &r600_gfx_set_wptr,
  892. };
  893. static struct radeon_asic_ring r600_dma_ring = {
  894. .ib_execute = &r600_dma_ring_ib_execute,
  895. .emit_fence = &r600_dma_fence_ring_emit,
  896. .emit_semaphore = &r600_dma_semaphore_ring_emit,
  897. .cs_parse = &r600_dma_cs_parse,
  898. .ring_test = &r600_dma_ring_test,
  899. .ib_test = &r600_dma_ib_test,
  900. .is_lockup = &r600_dma_is_lockup,
  901. .get_rptr = &r600_dma_get_rptr,
  902. .get_wptr = &r600_dma_get_wptr,
  903. .set_wptr = &r600_dma_set_wptr,
  904. };
  905. static struct radeon_asic r600_asic = {
  906. .init = &r600_init,
  907. .fini = &r600_fini,
  908. .suspend = &r600_suspend,
  909. .resume = &r600_resume,
  910. .vga_set_state = &r600_vga_set_state,
  911. .asic_reset = &r600_asic_reset,
  912. .mmio_hdp_flush = r600_mmio_hdp_flush,
  913. .gui_idle = &r600_gui_idle,
  914. .mc_wait_for_idle = &r600_mc_wait_for_idle,
  915. .get_xclk = &r600_get_xclk,
  916. .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
  917. .get_allowed_info_register = r600_get_allowed_info_register,
  918. .gart = {
  919. .tlb_flush = &r600_pcie_gart_tlb_flush,
  920. .get_page_entry = &rs600_gart_get_page_entry,
  921. .set_page = &rs600_gart_set_page,
  922. },
  923. .ring = {
  924. [RADEON_RING_TYPE_GFX_INDEX] = &r600_gfx_ring,
  925. [R600_RING_TYPE_DMA_INDEX] = &r600_dma_ring,
  926. },
  927. .irq = {
  928. .set = &r600_irq_set,
  929. .process = &r600_irq_process,
  930. },
  931. .display = {
  932. .bandwidth_update = &rv515_bandwidth_update,
  933. .get_vblank_counter = &rs600_get_vblank_counter,
  934. .wait_for_vblank = &avivo_wait_for_vblank,
  935. .set_backlight_level = &atombios_set_backlight_level,
  936. .get_backlight_level = &atombios_get_backlight_level,
  937. },
  938. .copy = {
  939. .blit = &r600_copy_cpdma,
  940. .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  941. .dma = &r600_copy_dma,
  942. .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
  943. .copy = &r600_copy_cpdma,
  944. .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  945. },
  946. .surface = {
  947. .set_reg = r600_set_surface_reg,
  948. .clear_reg = r600_clear_surface_reg,
  949. },
  950. .hpd = {
  951. .init = &r600_hpd_init,
  952. .fini = &r600_hpd_fini,
  953. .sense = &r600_hpd_sense,
  954. .set_polarity = &r600_hpd_set_polarity,
  955. },
  956. .pm = {
  957. .misc = &r600_pm_misc,
  958. .prepare = &rs600_pm_prepare,
  959. .finish = &rs600_pm_finish,
  960. .init_profile = &r600_pm_init_profile,
  961. .get_dynpm_state = &r600_pm_get_dynpm_state,
  962. .get_engine_clock = &radeon_atom_get_engine_clock,
  963. .set_engine_clock = &radeon_atom_set_engine_clock,
  964. .get_memory_clock = &radeon_atom_get_memory_clock,
  965. .set_memory_clock = &radeon_atom_set_memory_clock,
  966. .get_pcie_lanes = &r600_get_pcie_lanes,
  967. .set_pcie_lanes = &r600_set_pcie_lanes,
  968. .set_clock_gating = NULL,
  969. .get_temperature = &rv6xx_get_temp,
  970. },
  971. .pflip = {
  972. .page_flip = &rs600_page_flip,
  973. .page_flip_pending = &rs600_page_flip_pending,
  974. },
  975. };
  976. static struct radeon_asic_ring rv6xx_uvd_ring = {
  977. .ib_execute = &uvd_v1_0_ib_execute,
  978. .emit_fence = &uvd_v1_0_fence_emit,
  979. .emit_semaphore = &uvd_v1_0_semaphore_emit,
  980. .cs_parse = &radeon_uvd_cs_parse,
  981. .ring_test = &uvd_v1_0_ring_test,
  982. .ib_test = &uvd_v1_0_ib_test,
  983. .is_lockup = &radeon_ring_test_lockup,
  984. .get_rptr = &uvd_v1_0_get_rptr,
  985. .get_wptr = &uvd_v1_0_get_wptr,
  986. .set_wptr = &uvd_v1_0_set_wptr,
  987. };
  988. static struct radeon_asic rv6xx_asic = {
  989. .init = &r600_init,
  990. .fini = &r600_fini,
  991. .suspend = &r600_suspend,
  992. .resume = &r600_resume,
  993. .vga_set_state = &r600_vga_set_state,
  994. .asic_reset = &r600_asic_reset,
  995. .mmio_hdp_flush = r600_mmio_hdp_flush,
  996. .gui_idle = &r600_gui_idle,
  997. .mc_wait_for_idle = &r600_mc_wait_for_idle,
  998. .get_xclk = &r600_get_xclk,
  999. .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
  1000. .get_allowed_info_register = r600_get_allowed_info_register,
  1001. .gart = {
  1002. .tlb_flush = &r600_pcie_gart_tlb_flush,
  1003. .get_page_entry = &rs600_gart_get_page_entry,
  1004. .set_page = &rs600_gart_set_page,
  1005. },
  1006. .ring = {
  1007. [RADEON_RING_TYPE_GFX_INDEX] = &r600_gfx_ring,
  1008. [R600_RING_TYPE_DMA_INDEX] = &r600_dma_ring,
  1009. [R600_RING_TYPE_UVD_INDEX] = &rv6xx_uvd_ring,
  1010. },
  1011. .irq = {
  1012. .set = &r600_irq_set,
  1013. .process = &r600_irq_process,
  1014. },
  1015. .display = {
  1016. .bandwidth_update = &rv515_bandwidth_update,
  1017. .get_vblank_counter = &rs600_get_vblank_counter,
  1018. .wait_for_vblank = &avivo_wait_for_vblank,
  1019. .set_backlight_level = &atombios_set_backlight_level,
  1020. .get_backlight_level = &atombios_get_backlight_level,
  1021. },
  1022. .copy = {
  1023. .blit = &r600_copy_cpdma,
  1024. .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  1025. .dma = &r600_copy_dma,
  1026. .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
  1027. .copy = &r600_copy_cpdma,
  1028. .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  1029. },
  1030. .surface = {
  1031. .set_reg = r600_set_surface_reg,
  1032. .clear_reg = r600_clear_surface_reg,
  1033. },
  1034. .hpd = {
  1035. .init = &r600_hpd_init,
  1036. .fini = &r600_hpd_fini,
  1037. .sense = &r600_hpd_sense,
  1038. .set_polarity = &r600_hpd_set_polarity,
  1039. },
  1040. .pm = {
  1041. .misc = &r600_pm_misc,
  1042. .prepare = &rs600_pm_prepare,
  1043. .finish = &rs600_pm_finish,
  1044. .init_profile = &r600_pm_init_profile,
  1045. .get_dynpm_state = &r600_pm_get_dynpm_state,
  1046. .get_engine_clock = &radeon_atom_get_engine_clock,
  1047. .set_engine_clock = &radeon_atom_set_engine_clock,
  1048. .get_memory_clock = &radeon_atom_get_memory_clock,
  1049. .set_memory_clock = &radeon_atom_set_memory_clock,
  1050. .get_pcie_lanes = &r600_get_pcie_lanes,
  1051. .set_pcie_lanes = &r600_set_pcie_lanes,
  1052. .set_clock_gating = NULL,
  1053. .get_temperature = &rv6xx_get_temp,
  1054. .set_uvd_clocks = &r600_set_uvd_clocks,
  1055. },
  1056. .dpm = {
  1057. .init = &rv6xx_dpm_init,
  1058. .setup_asic = &rv6xx_setup_asic,
  1059. .enable = &rv6xx_dpm_enable,
  1060. .late_enable = &r600_dpm_late_enable,
  1061. .disable = &rv6xx_dpm_disable,
  1062. .pre_set_power_state = &r600_dpm_pre_set_power_state,
  1063. .set_power_state = &rv6xx_dpm_set_power_state,
  1064. .post_set_power_state = &r600_dpm_post_set_power_state,
  1065. .display_configuration_changed = &rv6xx_dpm_display_configuration_changed,
  1066. .fini = &rv6xx_dpm_fini,
  1067. .get_sclk = &rv6xx_dpm_get_sclk,
  1068. .get_mclk = &rv6xx_dpm_get_mclk,
  1069. .print_power_state = &rv6xx_dpm_print_power_state,
  1070. .debugfs_print_current_performance_level = &rv6xx_dpm_debugfs_print_current_performance_level,
  1071. .force_performance_level = &rv6xx_dpm_force_performance_level,
  1072. .get_current_sclk = &rv6xx_dpm_get_current_sclk,
  1073. .get_current_mclk = &rv6xx_dpm_get_current_mclk,
  1074. },
  1075. .pflip = {
  1076. .page_flip = &rs600_page_flip,
  1077. .page_flip_pending = &rs600_page_flip_pending,
  1078. },
  1079. };
  1080. static struct radeon_asic rs780_asic = {
  1081. .init = &r600_init,
  1082. .fini = &r600_fini,
  1083. .suspend = &r600_suspend,
  1084. .resume = &r600_resume,
  1085. .vga_set_state = &r600_vga_set_state,
  1086. .asic_reset = &r600_asic_reset,
  1087. .mmio_hdp_flush = r600_mmio_hdp_flush,
  1088. .gui_idle = &r600_gui_idle,
  1089. .mc_wait_for_idle = &r600_mc_wait_for_idle,
  1090. .get_xclk = &r600_get_xclk,
  1091. .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
  1092. .get_allowed_info_register = r600_get_allowed_info_register,
  1093. .gart = {
  1094. .tlb_flush = &r600_pcie_gart_tlb_flush,
  1095. .get_page_entry = &rs600_gart_get_page_entry,
  1096. .set_page = &rs600_gart_set_page,
  1097. },
  1098. .ring = {
  1099. [RADEON_RING_TYPE_GFX_INDEX] = &r600_gfx_ring,
  1100. [R600_RING_TYPE_DMA_INDEX] = &r600_dma_ring,
  1101. [R600_RING_TYPE_UVD_INDEX] = &rv6xx_uvd_ring,
  1102. },
  1103. .irq = {
  1104. .set = &r600_irq_set,
  1105. .process = &r600_irq_process,
  1106. },
  1107. .display = {
  1108. .bandwidth_update = &rs690_bandwidth_update,
  1109. .get_vblank_counter = &rs600_get_vblank_counter,
  1110. .wait_for_vblank = &avivo_wait_for_vblank,
  1111. .set_backlight_level = &atombios_set_backlight_level,
  1112. .get_backlight_level = &atombios_get_backlight_level,
  1113. },
  1114. .copy = {
  1115. .blit = &r600_copy_cpdma,
  1116. .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  1117. .dma = &r600_copy_dma,
  1118. .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
  1119. .copy = &r600_copy_cpdma,
  1120. .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  1121. },
  1122. .surface = {
  1123. .set_reg = r600_set_surface_reg,
  1124. .clear_reg = r600_clear_surface_reg,
  1125. },
  1126. .hpd = {
  1127. .init = &r600_hpd_init,
  1128. .fini = &r600_hpd_fini,
  1129. .sense = &r600_hpd_sense,
  1130. .set_polarity = &r600_hpd_set_polarity,
  1131. },
  1132. .pm = {
  1133. .misc = &r600_pm_misc,
  1134. .prepare = &rs600_pm_prepare,
  1135. .finish = &rs600_pm_finish,
  1136. .init_profile = &rs780_pm_init_profile,
  1137. .get_dynpm_state = &r600_pm_get_dynpm_state,
  1138. .get_engine_clock = &radeon_atom_get_engine_clock,
  1139. .set_engine_clock = &radeon_atom_set_engine_clock,
  1140. .get_memory_clock = NULL,
  1141. .set_memory_clock = NULL,
  1142. .get_pcie_lanes = NULL,
  1143. .set_pcie_lanes = NULL,
  1144. .set_clock_gating = NULL,
  1145. .get_temperature = &rv6xx_get_temp,
  1146. .set_uvd_clocks = &r600_set_uvd_clocks,
  1147. },
  1148. .dpm = {
  1149. .init = &rs780_dpm_init,
  1150. .setup_asic = &rs780_dpm_setup_asic,
  1151. .enable = &rs780_dpm_enable,
  1152. .late_enable = &r600_dpm_late_enable,
  1153. .disable = &rs780_dpm_disable,
  1154. .pre_set_power_state = &r600_dpm_pre_set_power_state,
  1155. .set_power_state = &rs780_dpm_set_power_state,
  1156. .post_set_power_state = &r600_dpm_post_set_power_state,
  1157. .display_configuration_changed = &rs780_dpm_display_configuration_changed,
  1158. .fini = &rs780_dpm_fini,
  1159. .get_sclk = &rs780_dpm_get_sclk,
  1160. .get_mclk = &rs780_dpm_get_mclk,
  1161. .print_power_state = &rs780_dpm_print_power_state,
  1162. .debugfs_print_current_performance_level = &rs780_dpm_debugfs_print_current_performance_level,
  1163. .force_performance_level = &rs780_dpm_force_performance_level,
  1164. .get_current_sclk = &rs780_dpm_get_current_sclk,
  1165. .get_current_mclk = &rs780_dpm_get_current_mclk,
  1166. },
  1167. .pflip = {
  1168. .page_flip = &rs600_page_flip,
  1169. .page_flip_pending = &rs600_page_flip_pending,
  1170. },
  1171. };
  1172. static struct radeon_asic_ring rv770_uvd_ring = {
  1173. .ib_execute = &uvd_v1_0_ib_execute,
  1174. .emit_fence = &uvd_v2_2_fence_emit,
  1175. .emit_semaphore = &uvd_v2_2_semaphore_emit,
  1176. .cs_parse = &radeon_uvd_cs_parse,
  1177. .ring_test = &uvd_v1_0_ring_test,
  1178. .ib_test = &uvd_v1_0_ib_test,
  1179. .is_lockup = &radeon_ring_test_lockup,
  1180. .get_rptr = &uvd_v1_0_get_rptr,
  1181. .get_wptr = &uvd_v1_0_get_wptr,
  1182. .set_wptr = &uvd_v1_0_set_wptr,
  1183. };
  1184. static struct radeon_asic rv770_asic = {
  1185. .init = &rv770_init,
  1186. .fini = &rv770_fini,
  1187. .suspend = &rv770_suspend,
  1188. .resume = &rv770_resume,
  1189. .asic_reset = &r600_asic_reset,
  1190. .vga_set_state = &r600_vga_set_state,
  1191. .mmio_hdp_flush = r600_mmio_hdp_flush,
  1192. .gui_idle = &r600_gui_idle,
  1193. .mc_wait_for_idle = &r600_mc_wait_for_idle,
  1194. .get_xclk = &rv770_get_xclk,
  1195. .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
  1196. .get_allowed_info_register = r600_get_allowed_info_register,
  1197. .gart = {
  1198. .tlb_flush = &r600_pcie_gart_tlb_flush,
  1199. .get_page_entry = &rs600_gart_get_page_entry,
  1200. .set_page = &rs600_gart_set_page,
  1201. },
  1202. .ring = {
  1203. [RADEON_RING_TYPE_GFX_INDEX] = &r600_gfx_ring,
  1204. [R600_RING_TYPE_DMA_INDEX] = &r600_dma_ring,
  1205. [R600_RING_TYPE_UVD_INDEX] = &rv770_uvd_ring,
  1206. },
  1207. .irq = {
  1208. .set = &r600_irq_set,
  1209. .process = &r600_irq_process,
  1210. },
  1211. .display = {
  1212. .bandwidth_update = &rv515_bandwidth_update,
  1213. .get_vblank_counter = &rs600_get_vblank_counter,
  1214. .wait_for_vblank = &avivo_wait_for_vblank,
  1215. .set_backlight_level = &atombios_set_backlight_level,
  1216. .get_backlight_level = &atombios_get_backlight_level,
  1217. },
  1218. .copy = {
  1219. .blit = &r600_copy_cpdma,
  1220. .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  1221. .dma = &rv770_copy_dma,
  1222. .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
  1223. .copy = &rv770_copy_dma,
  1224. .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
  1225. },
  1226. .surface = {
  1227. .set_reg = r600_set_surface_reg,
  1228. .clear_reg = r600_clear_surface_reg,
  1229. },
  1230. .hpd = {
  1231. .init = &r600_hpd_init,
  1232. .fini = &r600_hpd_fini,
  1233. .sense = &r600_hpd_sense,
  1234. .set_polarity = &r600_hpd_set_polarity,
  1235. },
  1236. .pm = {
  1237. .misc = &rv770_pm_misc,
  1238. .prepare = &rs600_pm_prepare,
  1239. .finish = &rs600_pm_finish,
  1240. .init_profile = &r600_pm_init_profile,
  1241. .get_dynpm_state = &r600_pm_get_dynpm_state,
  1242. .get_engine_clock = &radeon_atom_get_engine_clock,
  1243. .set_engine_clock = &radeon_atom_set_engine_clock,
  1244. .get_memory_clock = &radeon_atom_get_memory_clock,
  1245. .set_memory_clock = &radeon_atom_set_memory_clock,
  1246. .get_pcie_lanes = &r600_get_pcie_lanes,
  1247. .set_pcie_lanes = &r600_set_pcie_lanes,
  1248. .set_clock_gating = &radeon_atom_set_clock_gating,
  1249. .set_uvd_clocks = &rv770_set_uvd_clocks,
  1250. .get_temperature = &rv770_get_temp,
  1251. },
  1252. .dpm = {
  1253. .init = &rv770_dpm_init,
  1254. .setup_asic = &rv770_dpm_setup_asic,
  1255. .enable = &rv770_dpm_enable,
  1256. .late_enable = &rv770_dpm_late_enable,
  1257. .disable = &rv770_dpm_disable,
  1258. .pre_set_power_state = &r600_dpm_pre_set_power_state,
  1259. .set_power_state = &rv770_dpm_set_power_state,
  1260. .post_set_power_state = &r600_dpm_post_set_power_state,
  1261. .display_configuration_changed = &rv770_dpm_display_configuration_changed,
  1262. .fini = &rv770_dpm_fini,
  1263. .get_sclk = &rv770_dpm_get_sclk,
  1264. .get_mclk = &rv770_dpm_get_mclk,
  1265. .print_power_state = &rv770_dpm_print_power_state,
  1266. .debugfs_print_current_performance_level = &rv770_dpm_debugfs_print_current_performance_level,
  1267. .force_performance_level = &rv770_dpm_force_performance_level,
  1268. .vblank_too_short = &rv770_dpm_vblank_too_short,
  1269. .get_current_sclk = &rv770_dpm_get_current_sclk,
  1270. .get_current_mclk = &rv770_dpm_get_current_mclk,
  1271. },
  1272. .pflip = {
  1273. .page_flip = &rv770_page_flip,
  1274. .page_flip_pending = &rv770_page_flip_pending,
  1275. },
  1276. };
  1277. static struct radeon_asic_ring evergreen_gfx_ring = {
  1278. .ib_execute = &evergreen_ring_ib_execute,
  1279. .emit_fence = &r600_fence_ring_emit,
  1280. .emit_semaphore = &r600_semaphore_ring_emit,
  1281. .cs_parse = &evergreen_cs_parse,
  1282. .ring_test = &r600_ring_test,
  1283. .ib_test = &r600_ib_test,
  1284. .is_lockup = &evergreen_gfx_is_lockup,
  1285. .get_rptr = &r600_gfx_get_rptr,
  1286. .get_wptr = &r600_gfx_get_wptr,
  1287. .set_wptr = &r600_gfx_set_wptr,
  1288. };
  1289. static struct radeon_asic_ring evergreen_dma_ring = {
  1290. .ib_execute = &evergreen_dma_ring_ib_execute,
  1291. .emit_fence = &evergreen_dma_fence_ring_emit,
  1292. .emit_semaphore = &r600_dma_semaphore_ring_emit,
  1293. .cs_parse = &evergreen_dma_cs_parse,
  1294. .ring_test = &r600_dma_ring_test,
  1295. .ib_test = &r600_dma_ib_test,
  1296. .is_lockup = &evergreen_dma_is_lockup,
  1297. .get_rptr = &r600_dma_get_rptr,
  1298. .get_wptr = &r600_dma_get_wptr,
  1299. .set_wptr = &r600_dma_set_wptr,
  1300. };
  1301. static struct radeon_asic evergreen_asic = {
  1302. .init = &evergreen_init,
  1303. .fini = &evergreen_fini,
  1304. .suspend = &evergreen_suspend,
  1305. .resume = &evergreen_resume,
  1306. .asic_reset = &evergreen_asic_reset,
  1307. .vga_set_state = &r600_vga_set_state,
  1308. .mmio_hdp_flush = r600_mmio_hdp_flush,
  1309. .gui_idle = &r600_gui_idle,
  1310. .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
  1311. .get_xclk = &rv770_get_xclk,
  1312. .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
  1313. .get_allowed_info_register = evergreen_get_allowed_info_register,
  1314. .gart = {
  1315. .tlb_flush = &evergreen_pcie_gart_tlb_flush,
  1316. .get_page_entry = &rs600_gart_get_page_entry,
  1317. .set_page = &rs600_gart_set_page,
  1318. },
  1319. .ring = {
  1320. [RADEON_RING_TYPE_GFX_INDEX] = &evergreen_gfx_ring,
  1321. [R600_RING_TYPE_DMA_INDEX] = &evergreen_dma_ring,
  1322. [R600_RING_TYPE_UVD_INDEX] = &rv770_uvd_ring,
  1323. },
  1324. .irq = {
  1325. .set = &evergreen_irq_set,
  1326. .process = &evergreen_irq_process,
  1327. },
  1328. .display = {
  1329. .bandwidth_update = &evergreen_bandwidth_update,
  1330. .get_vblank_counter = &evergreen_get_vblank_counter,
  1331. .wait_for_vblank = &dce4_wait_for_vblank,
  1332. .set_backlight_level = &atombios_set_backlight_level,
  1333. .get_backlight_level = &atombios_get_backlight_level,
  1334. },
  1335. .copy = {
  1336. .blit = &r600_copy_cpdma,
  1337. .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  1338. .dma = &evergreen_copy_dma,
  1339. .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
  1340. .copy = &evergreen_copy_dma,
  1341. .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
  1342. },
  1343. .surface = {
  1344. .set_reg = r600_set_surface_reg,
  1345. .clear_reg = r600_clear_surface_reg,
  1346. },
  1347. .hpd = {
  1348. .init = &evergreen_hpd_init,
  1349. .fini = &evergreen_hpd_fini,
  1350. .sense = &evergreen_hpd_sense,
  1351. .set_polarity = &evergreen_hpd_set_polarity,
  1352. },
  1353. .pm = {
  1354. .misc = &evergreen_pm_misc,
  1355. .prepare = &evergreen_pm_prepare,
  1356. .finish = &evergreen_pm_finish,
  1357. .init_profile = &r600_pm_init_profile,
  1358. .get_dynpm_state = &r600_pm_get_dynpm_state,
  1359. .get_engine_clock = &radeon_atom_get_engine_clock,
  1360. .set_engine_clock = &radeon_atom_set_engine_clock,
  1361. .get_memory_clock = &radeon_atom_get_memory_clock,
  1362. .set_memory_clock = &radeon_atom_set_memory_clock,
  1363. .get_pcie_lanes = &r600_get_pcie_lanes,
  1364. .set_pcie_lanes = &r600_set_pcie_lanes,
  1365. .set_clock_gating = NULL,
  1366. .set_uvd_clocks = &evergreen_set_uvd_clocks,
  1367. .get_temperature = &evergreen_get_temp,
  1368. },
  1369. .dpm = {
  1370. .init = &cypress_dpm_init,
  1371. .setup_asic = &cypress_dpm_setup_asic,
  1372. .enable = &cypress_dpm_enable,
  1373. .late_enable = &rv770_dpm_late_enable,
  1374. .disable = &cypress_dpm_disable,
  1375. .pre_set_power_state = &r600_dpm_pre_set_power_state,
  1376. .set_power_state = &cypress_dpm_set_power_state,
  1377. .post_set_power_state = &r600_dpm_post_set_power_state,
  1378. .display_configuration_changed = &cypress_dpm_display_configuration_changed,
  1379. .fini = &cypress_dpm_fini,
  1380. .get_sclk = &rv770_dpm_get_sclk,
  1381. .get_mclk = &rv770_dpm_get_mclk,
  1382. .print_power_state = &rv770_dpm_print_power_state,
  1383. .debugfs_print_current_performance_level = &rv770_dpm_debugfs_print_current_performance_level,
  1384. .force_performance_level = &rv770_dpm_force_performance_level,
  1385. .vblank_too_short = &cypress_dpm_vblank_too_short,
  1386. .get_current_sclk = &rv770_dpm_get_current_sclk,
  1387. .get_current_mclk = &rv770_dpm_get_current_mclk,
  1388. },
  1389. .pflip = {
  1390. .page_flip = &evergreen_page_flip,
  1391. .page_flip_pending = &evergreen_page_flip_pending,
  1392. },
  1393. };
  1394. static struct radeon_asic sumo_asic = {
  1395. .init = &evergreen_init,
  1396. .fini = &evergreen_fini,
  1397. .suspend = &evergreen_suspend,
  1398. .resume = &evergreen_resume,
  1399. .asic_reset = &evergreen_asic_reset,
  1400. .vga_set_state = &r600_vga_set_state,
  1401. .mmio_hdp_flush = r600_mmio_hdp_flush,
  1402. .gui_idle = &r600_gui_idle,
  1403. .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
  1404. .get_xclk = &r600_get_xclk,
  1405. .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
  1406. .get_allowed_info_register = evergreen_get_allowed_info_register,
  1407. .gart = {
  1408. .tlb_flush = &evergreen_pcie_gart_tlb_flush,
  1409. .get_page_entry = &rs600_gart_get_page_entry,
  1410. .set_page = &rs600_gart_set_page,
  1411. },
  1412. .ring = {
  1413. [RADEON_RING_TYPE_GFX_INDEX] = &evergreen_gfx_ring,
  1414. [R600_RING_TYPE_DMA_INDEX] = &evergreen_dma_ring,
  1415. [R600_RING_TYPE_UVD_INDEX] = &rv770_uvd_ring,
  1416. },
  1417. .irq = {
  1418. .set = &evergreen_irq_set,
  1419. .process = &evergreen_irq_process,
  1420. },
  1421. .display = {
  1422. .bandwidth_update = &evergreen_bandwidth_update,
  1423. .get_vblank_counter = &evergreen_get_vblank_counter,
  1424. .wait_for_vblank = &dce4_wait_for_vblank,
  1425. .set_backlight_level = &atombios_set_backlight_level,
  1426. .get_backlight_level = &atombios_get_backlight_level,
  1427. },
  1428. .copy = {
  1429. .blit = &r600_copy_cpdma,
  1430. .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  1431. .dma = &evergreen_copy_dma,
  1432. .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
  1433. .copy = &evergreen_copy_dma,
  1434. .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
  1435. },
  1436. .surface = {
  1437. .set_reg = r600_set_surface_reg,
  1438. .clear_reg = r600_clear_surface_reg,
  1439. },
  1440. .hpd = {
  1441. .init = &evergreen_hpd_init,
  1442. .fini = &evergreen_hpd_fini,
  1443. .sense = &evergreen_hpd_sense,
  1444. .set_polarity = &evergreen_hpd_set_polarity,
  1445. },
  1446. .pm = {
  1447. .misc = &evergreen_pm_misc,
  1448. .prepare = &evergreen_pm_prepare,
  1449. .finish = &evergreen_pm_finish,
  1450. .init_profile = &sumo_pm_init_profile,
  1451. .get_dynpm_state = &r600_pm_get_dynpm_state,
  1452. .get_engine_clock = &radeon_atom_get_engine_clock,
  1453. .set_engine_clock = &radeon_atom_set_engine_clock,
  1454. .get_memory_clock = NULL,
  1455. .set_memory_clock = NULL,
  1456. .get_pcie_lanes = NULL,
  1457. .set_pcie_lanes = NULL,
  1458. .set_clock_gating = NULL,
  1459. .set_uvd_clocks = &sumo_set_uvd_clocks,
  1460. .get_temperature = &sumo_get_temp,
  1461. },
  1462. .dpm = {
  1463. .init = &sumo_dpm_init,
  1464. .setup_asic = &sumo_dpm_setup_asic,
  1465. .enable = &sumo_dpm_enable,
  1466. .late_enable = &sumo_dpm_late_enable,
  1467. .disable = &sumo_dpm_disable,
  1468. .pre_set_power_state = &sumo_dpm_pre_set_power_state,
  1469. .set_power_state = &sumo_dpm_set_power_state,
  1470. .post_set_power_state = &sumo_dpm_post_set_power_state,
  1471. .display_configuration_changed = &sumo_dpm_display_configuration_changed,
  1472. .fini = &sumo_dpm_fini,
  1473. .get_sclk = &sumo_dpm_get_sclk,
  1474. .get_mclk = &sumo_dpm_get_mclk,
  1475. .print_power_state = &sumo_dpm_print_power_state,
  1476. .debugfs_print_current_performance_level = &sumo_dpm_debugfs_print_current_performance_level,
  1477. .force_performance_level = &sumo_dpm_force_performance_level,
  1478. .get_current_sclk = &sumo_dpm_get_current_sclk,
  1479. .get_current_mclk = &sumo_dpm_get_current_mclk,
  1480. },
  1481. .pflip = {
  1482. .page_flip = &evergreen_page_flip,
  1483. .page_flip_pending = &evergreen_page_flip_pending,
  1484. },
  1485. };
  1486. static struct radeon_asic btc_asic = {
  1487. .init = &evergreen_init,
  1488. .fini = &evergreen_fini,
  1489. .suspend = &evergreen_suspend,
  1490. .resume = &evergreen_resume,
  1491. .asic_reset = &evergreen_asic_reset,
  1492. .vga_set_state = &r600_vga_set_state,
  1493. .mmio_hdp_flush = r600_mmio_hdp_flush,
  1494. .gui_idle = &r600_gui_idle,
  1495. .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
  1496. .get_xclk = &rv770_get_xclk,
  1497. .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
  1498. .get_allowed_info_register = evergreen_get_allowed_info_register,
  1499. .gart = {
  1500. .tlb_flush = &evergreen_pcie_gart_tlb_flush,
  1501. .get_page_entry = &rs600_gart_get_page_entry,
  1502. .set_page = &rs600_gart_set_page,
  1503. },
  1504. .ring = {
  1505. [RADEON_RING_TYPE_GFX_INDEX] = &evergreen_gfx_ring,
  1506. [R600_RING_TYPE_DMA_INDEX] = &evergreen_dma_ring,
  1507. [R600_RING_TYPE_UVD_INDEX] = &rv770_uvd_ring,
  1508. },
  1509. .irq = {
  1510. .set = &evergreen_irq_set,
  1511. .process = &evergreen_irq_process,
  1512. },
  1513. .display = {
  1514. .bandwidth_update = &evergreen_bandwidth_update,
  1515. .get_vblank_counter = &evergreen_get_vblank_counter,
  1516. .wait_for_vblank = &dce4_wait_for_vblank,
  1517. .set_backlight_level = &atombios_set_backlight_level,
  1518. .get_backlight_level = &atombios_get_backlight_level,
  1519. },
  1520. .copy = {
  1521. .blit = &r600_copy_cpdma,
  1522. .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  1523. .dma = &evergreen_copy_dma,
  1524. .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
  1525. .copy = &evergreen_copy_dma,
  1526. .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
  1527. },
  1528. .surface = {
  1529. .set_reg = r600_set_surface_reg,
  1530. .clear_reg = r600_clear_surface_reg,
  1531. },
  1532. .hpd = {
  1533. .init = &evergreen_hpd_init,
  1534. .fini = &evergreen_hpd_fini,
  1535. .sense = &evergreen_hpd_sense,
  1536. .set_polarity = &evergreen_hpd_set_polarity,
  1537. },
  1538. .pm = {
  1539. .misc = &evergreen_pm_misc,
  1540. .prepare = &evergreen_pm_prepare,
  1541. .finish = &evergreen_pm_finish,
  1542. .init_profile = &btc_pm_init_profile,
  1543. .get_dynpm_state = &r600_pm_get_dynpm_state,
  1544. .get_engine_clock = &radeon_atom_get_engine_clock,
  1545. .set_engine_clock = &radeon_atom_set_engine_clock,
  1546. .get_memory_clock = &radeon_atom_get_memory_clock,
  1547. .set_memory_clock = &radeon_atom_set_memory_clock,
  1548. .get_pcie_lanes = &r600_get_pcie_lanes,
  1549. .set_pcie_lanes = &r600_set_pcie_lanes,
  1550. .set_clock_gating = NULL,
  1551. .set_uvd_clocks = &evergreen_set_uvd_clocks,
  1552. .get_temperature = &evergreen_get_temp,
  1553. },
  1554. .dpm = {
  1555. .init = &btc_dpm_init,
  1556. .setup_asic = &btc_dpm_setup_asic,
  1557. .enable = &btc_dpm_enable,
  1558. .late_enable = &rv770_dpm_late_enable,
  1559. .disable = &btc_dpm_disable,
  1560. .pre_set_power_state = &btc_dpm_pre_set_power_state,
  1561. .set_power_state = &btc_dpm_set_power_state,
  1562. .post_set_power_state = &btc_dpm_post_set_power_state,
  1563. .display_configuration_changed = &cypress_dpm_display_configuration_changed,
  1564. .fini = &btc_dpm_fini,
  1565. .get_sclk = &btc_dpm_get_sclk,
  1566. .get_mclk = &btc_dpm_get_mclk,
  1567. .print_power_state = &rv770_dpm_print_power_state,
  1568. .debugfs_print_current_performance_level = &btc_dpm_debugfs_print_current_performance_level,
  1569. .force_performance_level = &rv770_dpm_force_performance_level,
  1570. .vblank_too_short = &btc_dpm_vblank_too_short,
  1571. .get_current_sclk = &btc_dpm_get_current_sclk,
  1572. .get_current_mclk = &btc_dpm_get_current_mclk,
  1573. },
  1574. .pflip = {
  1575. .page_flip = &evergreen_page_flip,
  1576. .page_flip_pending = &evergreen_page_flip_pending,
  1577. },
  1578. };
  1579. static struct radeon_asic_ring cayman_gfx_ring = {
  1580. .ib_execute = &cayman_ring_ib_execute,
  1581. .ib_parse = &evergreen_ib_parse,
  1582. .emit_fence = &cayman_fence_ring_emit,
  1583. .emit_semaphore = &r600_semaphore_ring_emit,
  1584. .cs_parse = &evergreen_cs_parse,
  1585. .ring_test = &r600_ring_test,
  1586. .ib_test = &r600_ib_test,
  1587. .is_lockup = &cayman_gfx_is_lockup,
  1588. .vm_flush = &cayman_vm_flush,
  1589. .get_rptr = &cayman_gfx_get_rptr,
  1590. .get_wptr = &cayman_gfx_get_wptr,
  1591. .set_wptr = &cayman_gfx_set_wptr,
  1592. };
  1593. static struct radeon_asic_ring cayman_dma_ring = {
  1594. .ib_execute = &cayman_dma_ring_ib_execute,
  1595. .ib_parse = &evergreen_dma_ib_parse,
  1596. .emit_fence = &evergreen_dma_fence_ring_emit,
  1597. .emit_semaphore = &r600_dma_semaphore_ring_emit,
  1598. .cs_parse = &evergreen_dma_cs_parse,
  1599. .ring_test = &r600_dma_ring_test,
  1600. .ib_test = &r600_dma_ib_test,
  1601. .is_lockup = &cayman_dma_is_lockup,
  1602. .vm_flush = &cayman_dma_vm_flush,
  1603. .get_rptr = &cayman_dma_get_rptr,
  1604. .get_wptr = &cayman_dma_get_wptr,
  1605. .set_wptr = &cayman_dma_set_wptr
  1606. };
  1607. static struct radeon_asic_ring cayman_uvd_ring = {
  1608. .ib_execute = &uvd_v1_0_ib_execute,
  1609. .emit_fence = &uvd_v2_2_fence_emit,
  1610. .emit_semaphore = &uvd_v3_1_semaphore_emit,
  1611. .cs_parse = &radeon_uvd_cs_parse,
  1612. .ring_test = &uvd_v1_0_ring_test,
  1613. .ib_test = &uvd_v1_0_ib_test,
  1614. .is_lockup = &radeon_ring_test_lockup,
  1615. .get_rptr = &uvd_v1_0_get_rptr,
  1616. .get_wptr = &uvd_v1_0_get_wptr,
  1617. .set_wptr = &uvd_v1_0_set_wptr,
  1618. };
  1619. static struct radeon_asic cayman_asic = {
  1620. .init = &cayman_init,
  1621. .fini = &cayman_fini,
  1622. .suspend = &cayman_suspend,
  1623. .resume = &cayman_resume,
  1624. .asic_reset = &cayman_asic_reset,
  1625. .vga_set_state = &r600_vga_set_state,
  1626. .mmio_hdp_flush = r600_mmio_hdp_flush,
  1627. .gui_idle = &r600_gui_idle,
  1628. .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
  1629. .get_xclk = &rv770_get_xclk,
  1630. .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
  1631. .get_allowed_info_register = cayman_get_allowed_info_register,
  1632. .gart = {
  1633. .tlb_flush = &cayman_pcie_gart_tlb_flush,
  1634. .get_page_entry = &rs600_gart_get_page_entry,
  1635. .set_page = &rs600_gart_set_page,
  1636. },
  1637. .vm = {
  1638. .init = &cayman_vm_init,
  1639. .fini = &cayman_vm_fini,
  1640. .copy_pages = &cayman_dma_vm_copy_pages,
  1641. .write_pages = &cayman_dma_vm_write_pages,
  1642. .set_pages = &cayman_dma_vm_set_pages,
  1643. .pad_ib = &cayman_dma_vm_pad_ib,
  1644. },
  1645. .ring = {
  1646. [RADEON_RING_TYPE_GFX_INDEX] = &cayman_gfx_ring,
  1647. [CAYMAN_RING_TYPE_CP1_INDEX] = &cayman_gfx_ring,
  1648. [CAYMAN_RING_TYPE_CP2_INDEX] = &cayman_gfx_ring,
  1649. [R600_RING_TYPE_DMA_INDEX] = &cayman_dma_ring,
  1650. [CAYMAN_RING_TYPE_DMA1_INDEX] = &cayman_dma_ring,
  1651. [R600_RING_TYPE_UVD_INDEX] = &cayman_uvd_ring,
  1652. },
  1653. .irq = {
  1654. .set = &evergreen_irq_set,
  1655. .process = &evergreen_irq_process,
  1656. },
  1657. .display = {
  1658. .bandwidth_update = &evergreen_bandwidth_update,
  1659. .get_vblank_counter = &evergreen_get_vblank_counter,
  1660. .wait_for_vblank = &dce4_wait_for_vblank,
  1661. .set_backlight_level = &atombios_set_backlight_level,
  1662. .get_backlight_level = &atombios_get_backlight_level,
  1663. },
  1664. .copy = {
  1665. .blit = &r600_copy_cpdma,
  1666. .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  1667. .dma = &evergreen_copy_dma,
  1668. .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
  1669. .copy = &evergreen_copy_dma,
  1670. .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
  1671. },
  1672. .surface = {
  1673. .set_reg = r600_set_surface_reg,
  1674. .clear_reg = r600_clear_surface_reg,
  1675. },
  1676. .hpd = {
  1677. .init = &evergreen_hpd_init,
  1678. .fini = &evergreen_hpd_fini,
  1679. .sense = &evergreen_hpd_sense,
  1680. .set_polarity = &evergreen_hpd_set_polarity,
  1681. },
  1682. .pm = {
  1683. .misc = &evergreen_pm_misc,
  1684. .prepare = &evergreen_pm_prepare,
  1685. .finish = &evergreen_pm_finish,
  1686. .init_profile = &btc_pm_init_profile,
  1687. .get_dynpm_state = &r600_pm_get_dynpm_state,
  1688. .get_engine_clock = &radeon_atom_get_engine_clock,
  1689. .set_engine_clock = &radeon_atom_set_engine_clock,
  1690. .get_memory_clock = &radeon_atom_get_memory_clock,
  1691. .set_memory_clock = &radeon_atom_set_memory_clock,
  1692. .get_pcie_lanes = &r600_get_pcie_lanes,
  1693. .set_pcie_lanes = &r600_set_pcie_lanes,
  1694. .set_clock_gating = NULL,
  1695. .set_uvd_clocks = &evergreen_set_uvd_clocks,
  1696. .get_temperature = &evergreen_get_temp,
  1697. },
  1698. .dpm = {
  1699. .init = &ni_dpm_init,
  1700. .setup_asic = &ni_dpm_setup_asic,
  1701. .enable = &ni_dpm_enable,
  1702. .late_enable = &rv770_dpm_late_enable,
  1703. .disable = &ni_dpm_disable,
  1704. .pre_set_power_state = &ni_dpm_pre_set_power_state,
  1705. .set_power_state = &ni_dpm_set_power_state,
  1706. .post_set_power_state = &ni_dpm_post_set_power_state,
  1707. .display_configuration_changed = &cypress_dpm_display_configuration_changed,
  1708. .fini = &ni_dpm_fini,
  1709. .get_sclk = &ni_dpm_get_sclk,
  1710. .get_mclk = &ni_dpm_get_mclk,
  1711. .print_power_state = &ni_dpm_print_power_state,
  1712. .debugfs_print_current_performance_level = &ni_dpm_debugfs_print_current_performance_level,
  1713. .force_performance_level = &ni_dpm_force_performance_level,
  1714. .vblank_too_short = &ni_dpm_vblank_too_short,
  1715. .get_current_sclk = &ni_dpm_get_current_sclk,
  1716. .get_current_mclk = &ni_dpm_get_current_mclk,
  1717. },
  1718. .pflip = {
  1719. .page_flip = &evergreen_page_flip,
  1720. .page_flip_pending = &evergreen_page_flip_pending,
  1721. },
  1722. };
  1723. static struct radeon_asic_ring trinity_vce_ring = {
  1724. .ib_execute = &radeon_vce_ib_execute,
  1725. .emit_fence = &radeon_vce_fence_emit,
  1726. .emit_semaphore = &radeon_vce_semaphore_emit,
  1727. .cs_parse = &radeon_vce_cs_parse,
  1728. .ring_test = &radeon_vce_ring_test,
  1729. .ib_test = &radeon_vce_ib_test,
  1730. .is_lockup = &radeon_ring_test_lockup,
  1731. .get_rptr = &vce_v1_0_get_rptr,
  1732. .get_wptr = &vce_v1_0_get_wptr,
  1733. .set_wptr = &vce_v1_0_set_wptr,
  1734. };
  1735. static struct radeon_asic trinity_asic = {
  1736. .init = &cayman_init,
  1737. .fini = &cayman_fini,
  1738. .suspend = &cayman_suspend,
  1739. .resume = &cayman_resume,
  1740. .asic_reset = &cayman_asic_reset,
  1741. .vga_set_state = &r600_vga_set_state,
  1742. .mmio_hdp_flush = r600_mmio_hdp_flush,
  1743. .gui_idle = &r600_gui_idle,
  1744. .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
  1745. .get_xclk = &r600_get_xclk,
  1746. .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
  1747. .get_allowed_info_register = cayman_get_allowed_info_register,
  1748. .gart = {
  1749. .tlb_flush = &cayman_pcie_gart_tlb_flush,
  1750. .get_page_entry = &rs600_gart_get_page_entry,
  1751. .set_page = &rs600_gart_set_page,
  1752. },
  1753. .vm = {
  1754. .init = &cayman_vm_init,
  1755. .fini = &cayman_vm_fini,
  1756. .copy_pages = &cayman_dma_vm_copy_pages,
  1757. .write_pages = &cayman_dma_vm_write_pages,
  1758. .set_pages = &cayman_dma_vm_set_pages,
  1759. .pad_ib = &cayman_dma_vm_pad_ib,
  1760. },
  1761. .ring = {
  1762. [RADEON_RING_TYPE_GFX_INDEX] = &cayman_gfx_ring,
  1763. [CAYMAN_RING_TYPE_CP1_INDEX] = &cayman_gfx_ring,
  1764. [CAYMAN_RING_TYPE_CP2_INDEX] = &cayman_gfx_ring,
  1765. [R600_RING_TYPE_DMA_INDEX] = &cayman_dma_ring,
  1766. [CAYMAN_RING_TYPE_DMA1_INDEX] = &cayman_dma_ring,
  1767. [R600_RING_TYPE_UVD_INDEX] = &cayman_uvd_ring,
  1768. [TN_RING_TYPE_VCE1_INDEX] = &trinity_vce_ring,
  1769. [TN_RING_TYPE_VCE2_INDEX] = &trinity_vce_ring,
  1770. },
  1771. .irq = {
  1772. .set = &evergreen_irq_set,
  1773. .process = &evergreen_irq_process,
  1774. },
  1775. .display = {
  1776. .bandwidth_update = &dce6_bandwidth_update,
  1777. .get_vblank_counter = &evergreen_get_vblank_counter,
  1778. .wait_for_vblank = &dce4_wait_for_vblank,
  1779. .set_backlight_level = &atombios_set_backlight_level,
  1780. .get_backlight_level = &atombios_get_backlight_level,
  1781. },
  1782. .copy = {
  1783. .blit = &r600_copy_cpdma,
  1784. .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  1785. .dma = &evergreen_copy_dma,
  1786. .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
  1787. .copy = &evergreen_copy_dma,
  1788. .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
  1789. },
  1790. .surface = {
  1791. .set_reg = r600_set_surface_reg,
  1792. .clear_reg = r600_clear_surface_reg,
  1793. },
  1794. .hpd = {
  1795. .init = &evergreen_hpd_init,
  1796. .fini = &evergreen_hpd_fini,
  1797. .sense = &evergreen_hpd_sense,
  1798. .set_polarity = &evergreen_hpd_set_polarity,
  1799. },
  1800. .pm = {
  1801. .misc = &evergreen_pm_misc,
  1802. .prepare = &evergreen_pm_prepare,
  1803. .finish = &evergreen_pm_finish,
  1804. .init_profile = &sumo_pm_init_profile,
  1805. .get_dynpm_state = &r600_pm_get_dynpm_state,
  1806. .get_engine_clock = &radeon_atom_get_engine_clock,
  1807. .set_engine_clock = &radeon_atom_set_engine_clock,
  1808. .get_memory_clock = NULL,
  1809. .set_memory_clock = NULL,
  1810. .get_pcie_lanes = NULL,
  1811. .set_pcie_lanes = NULL,
  1812. .set_clock_gating = NULL,
  1813. .set_uvd_clocks = &sumo_set_uvd_clocks,
  1814. .set_vce_clocks = &tn_set_vce_clocks,
  1815. .get_temperature = &tn_get_temp,
  1816. },
  1817. .dpm = {
  1818. .init = &trinity_dpm_init,
  1819. .setup_asic = &trinity_dpm_setup_asic,
  1820. .enable = &trinity_dpm_enable,
  1821. .late_enable = &trinity_dpm_late_enable,
  1822. .disable = &trinity_dpm_disable,
  1823. .pre_set_power_state = &trinity_dpm_pre_set_power_state,
  1824. .set_power_state = &trinity_dpm_set_power_state,
  1825. .post_set_power_state = &trinity_dpm_post_set_power_state,
  1826. .display_configuration_changed = &trinity_dpm_display_configuration_changed,
  1827. .fini = &trinity_dpm_fini,
  1828. .get_sclk = &trinity_dpm_get_sclk,
  1829. .get_mclk = &trinity_dpm_get_mclk,
  1830. .print_power_state = &trinity_dpm_print_power_state,
  1831. .debugfs_print_current_performance_level = &trinity_dpm_debugfs_print_current_performance_level,
  1832. .force_performance_level = &trinity_dpm_force_performance_level,
  1833. .enable_bapm = &trinity_dpm_enable_bapm,
  1834. .get_current_sclk = &trinity_dpm_get_current_sclk,
  1835. .get_current_mclk = &trinity_dpm_get_current_mclk,
  1836. },
  1837. .pflip = {
  1838. .page_flip = &evergreen_page_flip,
  1839. .page_flip_pending = &evergreen_page_flip_pending,
  1840. },
  1841. };
  1842. static struct radeon_asic_ring si_gfx_ring = {
  1843. .ib_execute = &si_ring_ib_execute,
  1844. .ib_parse = &si_ib_parse,
  1845. .emit_fence = &si_fence_ring_emit,
  1846. .emit_semaphore = &r600_semaphore_ring_emit,
  1847. .cs_parse = NULL,
  1848. .ring_test = &r600_ring_test,
  1849. .ib_test = &r600_ib_test,
  1850. .is_lockup = &si_gfx_is_lockup,
  1851. .vm_flush = &si_vm_flush,
  1852. .get_rptr = &cayman_gfx_get_rptr,
  1853. .get_wptr = &cayman_gfx_get_wptr,
  1854. .set_wptr = &cayman_gfx_set_wptr,
  1855. };
  1856. static struct radeon_asic_ring si_dma_ring = {
  1857. .ib_execute = &cayman_dma_ring_ib_execute,
  1858. .ib_parse = &evergreen_dma_ib_parse,
  1859. .emit_fence = &evergreen_dma_fence_ring_emit,
  1860. .emit_semaphore = &r600_dma_semaphore_ring_emit,
  1861. .cs_parse = NULL,
  1862. .ring_test = &r600_dma_ring_test,
  1863. .ib_test = &r600_dma_ib_test,
  1864. .is_lockup = &si_dma_is_lockup,
  1865. .vm_flush = &si_dma_vm_flush,
  1866. .get_rptr = &cayman_dma_get_rptr,
  1867. .get_wptr = &cayman_dma_get_wptr,
  1868. .set_wptr = &cayman_dma_set_wptr,
  1869. };
  1870. static struct radeon_asic si_asic = {
  1871. .init = &si_init,
  1872. .fini = &si_fini,
  1873. .suspend = &si_suspend,
  1874. .resume = &si_resume,
  1875. .asic_reset = &si_asic_reset,
  1876. .vga_set_state = &r600_vga_set_state,
  1877. .mmio_hdp_flush = r600_mmio_hdp_flush,
  1878. .gui_idle = &r600_gui_idle,
  1879. .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
  1880. .get_xclk = &si_get_xclk,
  1881. .get_gpu_clock_counter = &si_get_gpu_clock_counter,
  1882. .get_allowed_info_register = si_get_allowed_info_register,
  1883. .gart = {
  1884. .tlb_flush = &si_pcie_gart_tlb_flush,
  1885. .get_page_entry = &rs600_gart_get_page_entry,
  1886. .set_page = &rs600_gart_set_page,
  1887. },
  1888. .vm = {
  1889. .init = &si_vm_init,
  1890. .fini = &si_vm_fini,
  1891. .copy_pages = &si_dma_vm_copy_pages,
  1892. .write_pages = &si_dma_vm_write_pages,
  1893. .set_pages = &si_dma_vm_set_pages,
  1894. .pad_ib = &cayman_dma_vm_pad_ib,
  1895. },
  1896. .ring = {
  1897. [RADEON_RING_TYPE_GFX_INDEX] = &si_gfx_ring,
  1898. [CAYMAN_RING_TYPE_CP1_INDEX] = &si_gfx_ring,
  1899. [CAYMAN_RING_TYPE_CP2_INDEX] = &si_gfx_ring,
  1900. [R600_RING_TYPE_DMA_INDEX] = &si_dma_ring,
  1901. [CAYMAN_RING_TYPE_DMA1_INDEX] = &si_dma_ring,
  1902. [R600_RING_TYPE_UVD_INDEX] = &cayman_uvd_ring,
  1903. [TN_RING_TYPE_VCE1_INDEX] = &trinity_vce_ring,
  1904. [TN_RING_TYPE_VCE2_INDEX] = &trinity_vce_ring,
  1905. },
  1906. .irq = {
  1907. .set = &si_irq_set,
  1908. .process = &si_irq_process,
  1909. },
  1910. .display = {
  1911. .bandwidth_update = &dce6_bandwidth_update,
  1912. .get_vblank_counter = &evergreen_get_vblank_counter,
  1913. .wait_for_vblank = &dce4_wait_for_vblank,
  1914. .set_backlight_level = &atombios_set_backlight_level,
  1915. .get_backlight_level = &atombios_get_backlight_level,
  1916. },
  1917. .copy = {
  1918. .blit = &r600_copy_cpdma,
  1919. .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  1920. .dma = &si_copy_dma,
  1921. .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
  1922. .copy = &si_copy_dma,
  1923. .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
  1924. },
  1925. .surface = {
  1926. .set_reg = r600_set_surface_reg,
  1927. .clear_reg = r600_clear_surface_reg,
  1928. },
  1929. .hpd = {
  1930. .init = &evergreen_hpd_init,
  1931. .fini = &evergreen_hpd_fini,
  1932. .sense = &evergreen_hpd_sense,
  1933. .set_polarity = &evergreen_hpd_set_polarity,
  1934. },
  1935. .pm = {
  1936. .misc = &evergreen_pm_misc,
  1937. .prepare = &evergreen_pm_prepare,
  1938. .finish = &evergreen_pm_finish,
  1939. .init_profile = &sumo_pm_init_profile,
  1940. .get_dynpm_state = &r600_pm_get_dynpm_state,
  1941. .get_engine_clock = &radeon_atom_get_engine_clock,
  1942. .set_engine_clock = &radeon_atom_set_engine_clock,
  1943. .get_memory_clock = &radeon_atom_get_memory_clock,
  1944. .set_memory_clock = &radeon_atom_set_memory_clock,
  1945. .get_pcie_lanes = &r600_get_pcie_lanes,
  1946. .set_pcie_lanes = &r600_set_pcie_lanes,
  1947. .set_clock_gating = NULL,
  1948. .set_uvd_clocks = &si_set_uvd_clocks,
  1949. .set_vce_clocks = &si_set_vce_clocks,
  1950. .get_temperature = &si_get_temp,
  1951. },
  1952. .dpm = {
  1953. .init = &si_dpm_init,
  1954. .setup_asic = &si_dpm_setup_asic,
  1955. .enable = &si_dpm_enable,
  1956. .late_enable = &si_dpm_late_enable,
  1957. .disable = &si_dpm_disable,
  1958. .pre_set_power_state = &si_dpm_pre_set_power_state,
  1959. .set_power_state = &si_dpm_set_power_state,
  1960. .post_set_power_state = &si_dpm_post_set_power_state,
  1961. .display_configuration_changed = &si_dpm_display_configuration_changed,
  1962. .fini = &si_dpm_fini,
  1963. .get_sclk = &ni_dpm_get_sclk,
  1964. .get_mclk = &ni_dpm_get_mclk,
  1965. .print_power_state = &ni_dpm_print_power_state,
  1966. .debugfs_print_current_performance_level = &si_dpm_debugfs_print_current_performance_level,
  1967. .force_performance_level = &si_dpm_force_performance_level,
  1968. .vblank_too_short = &ni_dpm_vblank_too_short,
  1969. .fan_ctrl_set_mode = &si_fan_ctrl_set_mode,
  1970. .fan_ctrl_get_mode = &si_fan_ctrl_get_mode,
  1971. .get_fan_speed_percent = &si_fan_ctrl_get_fan_speed_percent,
  1972. .set_fan_speed_percent = &si_fan_ctrl_set_fan_speed_percent,
  1973. .get_current_sclk = &si_dpm_get_current_sclk,
  1974. .get_current_mclk = &si_dpm_get_current_mclk,
  1975. },
  1976. .pflip = {
  1977. .page_flip = &evergreen_page_flip,
  1978. .page_flip_pending = &evergreen_page_flip_pending,
  1979. },
  1980. };
  1981. static struct radeon_asic_ring ci_gfx_ring = {
  1982. .ib_execute = &cik_ring_ib_execute,
  1983. .ib_parse = &cik_ib_parse,
  1984. .emit_fence = &cik_fence_gfx_ring_emit,
  1985. .emit_semaphore = &cik_semaphore_ring_emit,
  1986. .cs_parse = NULL,
  1987. .ring_test = &cik_ring_test,
  1988. .ib_test = &cik_ib_test,
  1989. .is_lockup = &cik_gfx_is_lockup,
  1990. .vm_flush = &cik_vm_flush,
  1991. .get_rptr = &cik_gfx_get_rptr,
  1992. .get_wptr = &cik_gfx_get_wptr,
  1993. .set_wptr = &cik_gfx_set_wptr,
  1994. };
  1995. static struct radeon_asic_ring ci_cp_ring = {
  1996. .ib_execute = &cik_ring_ib_execute,
  1997. .ib_parse = &cik_ib_parse,
  1998. .emit_fence = &cik_fence_compute_ring_emit,
  1999. .emit_semaphore = &cik_semaphore_ring_emit,
  2000. .cs_parse = NULL,
  2001. .ring_test = &cik_ring_test,
  2002. .ib_test = &cik_ib_test,
  2003. .is_lockup = &cik_gfx_is_lockup,
  2004. .vm_flush = &cik_vm_flush,
  2005. .get_rptr = &cik_compute_get_rptr,
  2006. .get_wptr = &cik_compute_get_wptr,
  2007. .set_wptr = &cik_compute_set_wptr,
  2008. };
  2009. static struct radeon_asic_ring ci_dma_ring = {
  2010. .ib_execute = &cik_sdma_ring_ib_execute,
  2011. .ib_parse = &cik_ib_parse,
  2012. .emit_fence = &cik_sdma_fence_ring_emit,
  2013. .emit_semaphore = &cik_sdma_semaphore_ring_emit,
  2014. .cs_parse = NULL,
  2015. .ring_test = &cik_sdma_ring_test,
  2016. .ib_test = &cik_sdma_ib_test,
  2017. .is_lockup = &cik_sdma_is_lockup,
  2018. .vm_flush = &cik_dma_vm_flush,
  2019. .get_rptr = &cik_sdma_get_rptr,
  2020. .get_wptr = &cik_sdma_get_wptr,
  2021. .set_wptr = &cik_sdma_set_wptr,
  2022. };
  2023. static struct radeon_asic_ring ci_vce_ring = {
  2024. .ib_execute = &radeon_vce_ib_execute,
  2025. .emit_fence = &radeon_vce_fence_emit,
  2026. .emit_semaphore = &radeon_vce_semaphore_emit,
  2027. .cs_parse = &radeon_vce_cs_parse,
  2028. .ring_test = &radeon_vce_ring_test,
  2029. .ib_test = &radeon_vce_ib_test,
  2030. .is_lockup = &radeon_ring_test_lockup,
  2031. .get_rptr = &vce_v1_0_get_rptr,
  2032. .get_wptr = &vce_v1_0_get_wptr,
  2033. .set_wptr = &vce_v1_0_set_wptr,
  2034. };
  2035. static struct radeon_asic ci_asic = {
  2036. .init = &cik_init,
  2037. .fini = &cik_fini,
  2038. .suspend = &cik_suspend,
  2039. .resume = &cik_resume,
  2040. .asic_reset = &cik_asic_reset,
  2041. .vga_set_state = &r600_vga_set_state,
  2042. .mmio_hdp_flush = &r600_mmio_hdp_flush,
  2043. .gui_idle = &r600_gui_idle,
  2044. .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
  2045. .get_xclk = &cik_get_xclk,
  2046. .get_gpu_clock_counter = &cik_get_gpu_clock_counter,
  2047. .get_allowed_info_register = cik_get_allowed_info_register,
  2048. .gart = {
  2049. .tlb_flush = &cik_pcie_gart_tlb_flush,
  2050. .get_page_entry = &rs600_gart_get_page_entry,
  2051. .set_page = &rs600_gart_set_page,
  2052. },
  2053. .vm = {
  2054. .init = &cik_vm_init,
  2055. .fini = &cik_vm_fini,
  2056. .copy_pages = &cik_sdma_vm_copy_pages,
  2057. .write_pages = &cik_sdma_vm_write_pages,
  2058. .set_pages = &cik_sdma_vm_set_pages,
  2059. .pad_ib = &cik_sdma_vm_pad_ib,
  2060. },
  2061. .ring = {
  2062. [RADEON_RING_TYPE_GFX_INDEX] = &ci_gfx_ring,
  2063. [CAYMAN_RING_TYPE_CP1_INDEX] = &ci_cp_ring,
  2064. [CAYMAN_RING_TYPE_CP2_INDEX] = &ci_cp_ring,
  2065. [R600_RING_TYPE_DMA_INDEX] = &ci_dma_ring,
  2066. [CAYMAN_RING_TYPE_DMA1_INDEX] = &ci_dma_ring,
  2067. [R600_RING_TYPE_UVD_INDEX] = &cayman_uvd_ring,
  2068. [TN_RING_TYPE_VCE1_INDEX] = &ci_vce_ring,
  2069. [TN_RING_TYPE_VCE2_INDEX] = &ci_vce_ring,
  2070. },
  2071. .irq = {
  2072. .set = &cik_irq_set,
  2073. .process = &cik_irq_process,
  2074. },
  2075. .display = {
  2076. .bandwidth_update = &dce8_bandwidth_update,
  2077. .get_vblank_counter = &evergreen_get_vblank_counter,
  2078. .wait_for_vblank = &dce4_wait_for_vblank,
  2079. .set_backlight_level = &atombios_set_backlight_level,
  2080. .get_backlight_level = &atombios_get_backlight_level,
  2081. },
  2082. .copy = {
  2083. .blit = &cik_copy_cpdma,
  2084. .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  2085. .dma = &cik_copy_dma,
  2086. .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
  2087. .copy = &cik_copy_dma,
  2088. .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
  2089. },
  2090. .surface = {
  2091. .set_reg = r600_set_surface_reg,
  2092. .clear_reg = r600_clear_surface_reg,
  2093. },
  2094. .hpd = {
  2095. .init = &evergreen_hpd_init,
  2096. .fini = &evergreen_hpd_fini,
  2097. .sense = &evergreen_hpd_sense,
  2098. .set_polarity = &evergreen_hpd_set_polarity,
  2099. },
  2100. .pm = {
  2101. .misc = &evergreen_pm_misc,
  2102. .prepare = &evergreen_pm_prepare,
  2103. .finish = &evergreen_pm_finish,
  2104. .init_profile = &sumo_pm_init_profile,
  2105. .get_dynpm_state = &r600_pm_get_dynpm_state,
  2106. .get_engine_clock = &radeon_atom_get_engine_clock,
  2107. .set_engine_clock = &radeon_atom_set_engine_clock,
  2108. .get_memory_clock = &radeon_atom_get_memory_clock,
  2109. .set_memory_clock = &radeon_atom_set_memory_clock,
  2110. .get_pcie_lanes = NULL,
  2111. .set_pcie_lanes = NULL,
  2112. .set_clock_gating = NULL,
  2113. .set_uvd_clocks = &cik_set_uvd_clocks,
  2114. .set_vce_clocks = &cik_set_vce_clocks,
  2115. .get_temperature = &ci_get_temp,
  2116. },
  2117. .dpm = {
  2118. .init = &ci_dpm_init,
  2119. .setup_asic = &ci_dpm_setup_asic,
  2120. .enable = &ci_dpm_enable,
  2121. .late_enable = &ci_dpm_late_enable,
  2122. .disable = &ci_dpm_disable,
  2123. .pre_set_power_state = &ci_dpm_pre_set_power_state,
  2124. .set_power_state = &ci_dpm_set_power_state,
  2125. .post_set_power_state = &ci_dpm_post_set_power_state,
  2126. .display_configuration_changed = &ci_dpm_display_configuration_changed,
  2127. .fini = &ci_dpm_fini,
  2128. .get_sclk = &ci_dpm_get_sclk,
  2129. .get_mclk = &ci_dpm_get_mclk,
  2130. .print_power_state = &ci_dpm_print_power_state,
  2131. .debugfs_print_current_performance_level = &ci_dpm_debugfs_print_current_performance_level,
  2132. .force_performance_level = &ci_dpm_force_performance_level,
  2133. .vblank_too_short = &ci_dpm_vblank_too_short,
  2134. .powergate_uvd = &ci_dpm_powergate_uvd,
  2135. .fan_ctrl_set_mode = &ci_fan_ctrl_set_mode,
  2136. .fan_ctrl_get_mode = &ci_fan_ctrl_get_mode,
  2137. .get_fan_speed_percent = &ci_fan_ctrl_get_fan_speed_percent,
  2138. .set_fan_speed_percent = &ci_fan_ctrl_set_fan_speed_percent,
  2139. .get_current_sclk = &ci_dpm_get_current_sclk,
  2140. .get_current_mclk = &ci_dpm_get_current_mclk,
  2141. },
  2142. .pflip = {
  2143. .page_flip = &evergreen_page_flip,
  2144. .page_flip_pending = &evergreen_page_flip_pending,
  2145. },
  2146. };
  2147. static struct radeon_asic kv_asic = {
  2148. .init = &cik_init,
  2149. .fini = &cik_fini,
  2150. .suspend = &cik_suspend,
  2151. .resume = &cik_resume,
  2152. .asic_reset = &cik_asic_reset,
  2153. .vga_set_state = &r600_vga_set_state,
  2154. .mmio_hdp_flush = &r600_mmio_hdp_flush,
  2155. .gui_idle = &r600_gui_idle,
  2156. .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
  2157. .get_xclk = &cik_get_xclk,
  2158. .get_gpu_clock_counter = &cik_get_gpu_clock_counter,
  2159. .get_allowed_info_register = cik_get_allowed_info_register,
  2160. .gart = {
  2161. .tlb_flush = &cik_pcie_gart_tlb_flush,
  2162. .get_page_entry = &rs600_gart_get_page_entry,
  2163. .set_page = &rs600_gart_set_page,
  2164. },
  2165. .vm = {
  2166. .init = &cik_vm_init,
  2167. .fini = &cik_vm_fini,
  2168. .copy_pages = &cik_sdma_vm_copy_pages,
  2169. .write_pages = &cik_sdma_vm_write_pages,
  2170. .set_pages = &cik_sdma_vm_set_pages,
  2171. .pad_ib = &cik_sdma_vm_pad_ib,
  2172. },
  2173. .ring = {
  2174. [RADEON_RING_TYPE_GFX_INDEX] = &ci_gfx_ring,
  2175. [CAYMAN_RING_TYPE_CP1_INDEX] = &ci_cp_ring,
  2176. [CAYMAN_RING_TYPE_CP2_INDEX] = &ci_cp_ring,
  2177. [R600_RING_TYPE_DMA_INDEX] = &ci_dma_ring,
  2178. [CAYMAN_RING_TYPE_DMA1_INDEX] = &ci_dma_ring,
  2179. [R600_RING_TYPE_UVD_INDEX] = &cayman_uvd_ring,
  2180. [TN_RING_TYPE_VCE1_INDEX] = &ci_vce_ring,
  2181. [TN_RING_TYPE_VCE2_INDEX] = &ci_vce_ring,
  2182. },
  2183. .irq = {
  2184. .set = &cik_irq_set,
  2185. .process = &cik_irq_process,
  2186. },
  2187. .display = {
  2188. .bandwidth_update = &dce8_bandwidth_update,
  2189. .get_vblank_counter = &evergreen_get_vblank_counter,
  2190. .wait_for_vblank = &dce4_wait_for_vblank,
  2191. .set_backlight_level = &atombios_set_backlight_level,
  2192. .get_backlight_level = &atombios_get_backlight_level,
  2193. },
  2194. .copy = {
  2195. .blit = &cik_copy_cpdma,
  2196. .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
  2197. .dma = &cik_copy_dma,
  2198. .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
  2199. .copy = &cik_copy_dma,
  2200. .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
  2201. },
  2202. .surface = {
  2203. .set_reg = r600_set_surface_reg,
  2204. .clear_reg = r600_clear_surface_reg,
  2205. },
  2206. .hpd = {
  2207. .init = &evergreen_hpd_init,
  2208. .fini = &evergreen_hpd_fini,
  2209. .sense = &evergreen_hpd_sense,
  2210. .set_polarity = &evergreen_hpd_set_polarity,
  2211. },
  2212. .pm = {
  2213. .misc = &evergreen_pm_misc,
  2214. .prepare = &evergreen_pm_prepare,
  2215. .finish = &evergreen_pm_finish,
  2216. .init_profile = &sumo_pm_init_profile,
  2217. .get_dynpm_state = &r600_pm_get_dynpm_state,
  2218. .get_engine_clock = &radeon_atom_get_engine_clock,
  2219. .set_engine_clock = &radeon_atom_set_engine_clock,
  2220. .get_memory_clock = &radeon_atom_get_memory_clock,
  2221. .set_memory_clock = &radeon_atom_set_memory_clock,
  2222. .get_pcie_lanes = NULL,
  2223. .set_pcie_lanes = NULL,
  2224. .set_clock_gating = NULL,
  2225. .set_uvd_clocks = &cik_set_uvd_clocks,
  2226. .set_vce_clocks = &cik_set_vce_clocks,
  2227. .get_temperature = &kv_get_temp,
  2228. },
  2229. .dpm = {
  2230. .init = &kv_dpm_init,
  2231. .setup_asic = &kv_dpm_setup_asic,
  2232. .enable = &kv_dpm_enable,
  2233. .late_enable = &kv_dpm_late_enable,
  2234. .disable = &kv_dpm_disable,
  2235. .pre_set_power_state = &kv_dpm_pre_set_power_state,
  2236. .set_power_state = &kv_dpm_set_power_state,
  2237. .post_set_power_state = &kv_dpm_post_set_power_state,
  2238. .display_configuration_changed = &kv_dpm_display_configuration_changed,
  2239. .fini = &kv_dpm_fini,
  2240. .get_sclk = &kv_dpm_get_sclk,
  2241. .get_mclk = &kv_dpm_get_mclk,
  2242. .print_power_state = &kv_dpm_print_power_state,
  2243. .debugfs_print_current_performance_level = &kv_dpm_debugfs_print_current_performance_level,
  2244. .force_performance_level = &kv_dpm_force_performance_level,
  2245. .powergate_uvd = &kv_dpm_powergate_uvd,
  2246. .enable_bapm = &kv_dpm_enable_bapm,
  2247. .get_current_sclk = &kv_dpm_get_current_sclk,
  2248. .get_current_mclk = &kv_dpm_get_current_mclk,
  2249. },
  2250. .pflip = {
  2251. .page_flip = &evergreen_page_flip,
  2252. .page_flip_pending = &evergreen_page_flip_pending,
  2253. },
  2254. };
  2255. /**
  2256. * radeon_asic_init - register asic specific callbacks
  2257. *
  2258. * @rdev: radeon device pointer
  2259. *
  2260. * Registers the appropriate asic specific callbacks for each
  2261. * chip family. Also sets other asics specific info like the number
  2262. * of crtcs and the register aperture accessors (all asics).
  2263. * Returns 0 for success.
  2264. */
  2265. int radeon_asic_init(struct radeon_device *rdev)
  2266. {
  2267. radeon_register_accessor_init(rdev);
  2268. /* set the number of crtcs */
  2269. if (rdev->flags & RADEON_SINGLE_CRTC)
  2270. rdev->num_crtc = 1;
  2271. else
  2272. rdev->num_crtc = 2;
  2273. rdev->has_uvd = false;
  2274. switch (rdev->family) {
  2275. case CHIP_R100:
  2276. case CHIP_RV100:
  2277. case CHIP_RS100:
  2278. case CHIP_RV200:
  2279. case CHIP_RS200:
  2280. rdev->asic = &r100_asic;
  2281. break;
  2282. case CHIP_R200:
  2283. case CHIP_RV250:
  2284. case CHIP_RS300:
  2285. case CHIP_RV280:
  2286. rdev->asic = &r200_asic;
  2287. break;
  2288. case CHIP_R300:
  2289. case CHIP_R350:
  2290. case CHIP_RV350:
  2291. case CHIP_RV380:
  2292. if (rdev->flags & RADEON_IS_PCIE)
  2293. rdev->asic = &r300_asic_pcie;
  2294. else
  2295. rdev->asic = &r300_asic;
  2296. break;
  2297. case CHIP_R420:
  2298. case CHIP_R423:
  2299. case CHIP_RV410:
  2300. rdev->asic = &r420_asic;
  2301. /* handle macs */
  2302. if (rdev->bios == NULL) {
  2303. rdev->asic->pm.get_engine_clock = &radeon_legacy_get_engine_clock;
  2304. rdev->asic->pm.set_engine_clock = &radeon_legacy_set_engine_clock;
  2305. rdev->asic->pm.get_memory_clock = &radeon_legacy_get_memory_clock;
  2306. rdev->asic->pm.set_memory_clock = NULL;
  2307. rdev->asic->display.set_backlight_level = &radeon_legacy_set_backlight_level;
  2308. }
  2309. break;
  2310. case CHIP_RS400:
  2311. case CHIP_RS480:
  2312. rdev->asic = &rs400_asic;
  2313. break;
  2314. case CHIP_RS600:
  2315. rdev->asic = &rs600_asic;
  2316. break;
  2317. case CHIP_RS690:
  2318. case CHIP_RS740:
  2319. rdev->asic = &rs690_asic;
  2320. break;
  2321. case CHIP_RV515:
  2322. rdev->asic = &rv515_asic;
  2323. break;
  2324. case CHIP_R520:
  2325. case CHIP_RV530:
  2326. case CHIP_RV560:
  2327. case CHIP_RV570:
  2328. case CHIP_R580:
  2329. rdev->asic = &r520_asic;
  2330. break;
  2331. case CHIP_R600:
  2332. rdev->asic = &r600_asic;
  2333. break;
  2334. case CHIP_RV610:
  2335. case CHIP_RV630:
  2336. case CHIP_RV620:
  2337. case CHIP_RV635:
  2338. case CHIP_RV670:
  2339. rdev->asic = &rv6xx_asic;
  2340. rdev->has_uvd = true;
  2341. break;
  2342. case CHIP_RS780:
  2343. case CHIP_RS880:
  2344. rdev->asic = &rs780_asic;
  2345. /* 760G/780V/880V don't have UVD */
  2346. if ((rdev->pdev->device == 0x9616)||
  2347. (rdev->pdev->device == 0x9611)||
  2348. (rdev->pdev->device == 0x9613)||
  2349. (rdev->pdev->device == 0x9711)||
  2350. (rdev->pdev->device == 0x9713))
  2351. rdev->has_uvd = false;
  2352. else
  2353. rdev->has_uvd = true;
  2354. break;
  2355. case CHIP_RV770:
  2356. case CHIP_RV730:
  2357. case CHIP_RV710:
  2358. case CHIP_RV740:
  2359. rdev->asic = &rv770_asic;
  2360. rdev->has_uvd = true;
  2361. break;
  2362. case CHIP_CEDAR:
  2363. case CHIP_REDWOOD:
  2364. case CHIP_JUNIPER:
  2365. case CHIP_CYPRESS:
  2366. case CHIP_HEMLOCK:
  2367. /* set num crtcs */
  2368. if (rdev->family == CHIP_CEDAR)
  2369. rdev->num_crtc = 4;
  2370. else
  2371. rdev->num_crtc = 6;
  2372. rdev->asic = &evergreen_asic;
  2373. rdev->has_uvd = true;
  2374. break;
  2375. case CHIP_PALM:
  2376. case CHIP_SUMO:
  2377. case CHIP_SUMO2:
  2378. rdev->asic = &sumo_asic;
  2379. rdev->has_uvd = true;
  2380. break;
  2381. case CHIP_BARTS:
  2382. case CHIP_TURKS:
  2383. case CHIP_CAICOS:
  2384. /* set num crtcs */
  2385. if (rdev->family == CHIP_CAICOS)
  2386. rdev->num_crtc = 4;
  2387. else
  2388. rdev->num_crtc = 6;
  2389. rdev->asic = &btc_asic;
  2390. rdev->has_uvd = true;
  2391. break;
  2392. case CHIP_CAYMAN:
  2393. rdev->asic = &cayman_asic;
  2394. /* set num crtcs */
  2395. rdev->num_crtc = 6;
  2396. rdev->has_uvd = true;
  2397. break;
  2398. case CHIP_ARUBA:
  2399. rdev->asic = &trinity_asic;
  2400. /* set num crtcs */
  2401. rdev->num_crtc = 4;
  2402. rdev->has_uvd = true;
  2403. rdev->cg_flags =
  2404. RADEON_CG_SUPPORT_VCE_MGCG;
  2405. break;
  2406. case CHIP_TAHITI:
  2407. case CHIP_PITCAIRN:
  2408. case CHIP_VERDE:
  2409. case CHIP_OLAND:
  2410. case CHIP_HAINAN:
  2411. rdev->asic = &si_asic;
  2412. /* set num crtcs */
  2413. if (rdev->family == CHIP_HAINAN)
  2414. rdev->num_crtc = 0;
  2415. else if (rdev->family == CHIP_OLAND)
  2416. rdev->num_crtc = 2;
  2417. else
  2418. rdev->num_crtc = 6;
  2419. if (rdev->family == CHIP_HAINAN)
  2420. rdev->has_uvd = false;
  2421. else
  2422. rdev->has_uvd = true;
  2423. switch (rdev->family) {
  2424. case CHIP_TAHITI:
  2425. rdev->cg_flags =
  2426. RADEON_CG_SUPPORT_GFX_MGCG |
  2427. RADEON_CG_SUPPORT_GFX_MGLS |
  2428. /*RADEON_CG_SUPPORT_GFX_CGCG |*/
  2429. RADEON_CG_SUPPORT_GFX_CGLS |
  2430. RADEON_CG_SUPPORT_GFX_CGTS |
  2431. RADEON_CG_SUPPORT_GFX_CP_LS |
  2432. RADEON_CG_SUPPORT_MC_MGCG |
  2433. RADEON_CG_SUPPORT_SDMA_MGCG |
  2434. RADEON_CG_SUPPORT_BIF_LS |
  2435. RADEON_CG_SUPPORT_VCE_MGCG |
  2436. RADEON_CG_SUPPORT_UVD_MGCG |
  2437. RADEON_CG_SUPPORT_HDP_LS |
  2438. RADEON_CG_SUPPORT_HDP_MGCG;
  2439. rdev->pg_flags = 0;
  2440. break;
  2441. case CHIP_PITCAIRN:
  2442. rdev->cg_flags =
  2443. RADEON_CG_SUPPORT_GFX_MGCG |
  2444. RADEON_CG_SUPPORT_GFX_MGLS |
  2445. /*RADEON_CG_SUPPORT_GFX_CGCG |*/
  2446. RADEON_CG_SUPPORT_GFX_CGLS |
  2447. RADEON_CG_SUPPORT_GFX_CGTS |
  2448. RADEON_CG_SUPPORT_GFX_CP_LS |
  2449. RADEON_CG_SUPPORT_GFX_RLC_LS |
  2450. RADEON_CG_SUPPORT_MC_LS |
  2451. RADEON_CG_SUPPORT_MC_MGCG |
  2452. RADEON_CG_SUPPORT_SDMA_MGCG |
  2453. RADEON_CG_SUPPORT_BIF_LS |
  2454. RADEON_CG_SUPPORT_VCE_MGCG |
  2455. RADEON_CG_SUPPORT_UVD_MGCG |
  2456. RADEON_CG_SUPPORT_HDP_LS |
  2457. RADEON_CG_SUPPORT_HDP_MGCG;
  2458. rdev->pg_flags = 0;
  2459. break;
  2460. case CHIP_VERDE:
  2461. rdev->cg_flags =
  2462. RADEON_CG_SUPPORT_GFX_MGCG |
  2463. RADEON_CG_SUPPORT_GFX_MGLS |
  2464. /*RADEON_CG_SUPPORT_GFX_CGCG |*/
  2465. RADEON_CG_SUPPORT_GFX_CGLS |
  2466. RADEON_CG_SUPPORT_GFX_CGTS |
  2467. RADEON_CG_SUPPORT_GFX_CP_LS |
  2468. RADEON_CG_SUPPORT_GFX_RLC_LS |
  2469. RADEON_CG_SUPPORT_MC_LS |
  2470. RADEON_CG_SUPPORT_MC_MGCG |
  2471. RADEON_CG_SUPPORT_SDMA_MGCG |
  2472. RADEON_CG_SUPPORT_BIF_LS |
  2473. RADEON_CG_SUPPORT_VCE_MGCG |
  2474. RADEON_CG_SUPPORT_UVD_MGCG |
  2475. RADEON_CG_SUPPORT_HDP_LS |
  2476. RADEON_CG_SUPPORT_HDP_MGCG;
  2477. rdev->pg_flags = 0 |
  2478. /*RADEON_PG_SUPPORT_GFX_PG | */
  2479. RADEON_PG_SUPPORT_SDMA;
  2480. break;
  2481. case CHIP_OLAND:
  2482. rdev->cg_flags =
  2483. RADEON_CG_SUPPORT_GFX_MGCG |
  2484. RADEON_CG_SUPPORT_GFX_MGLS |
  2485. /*RADEON_CG_SUPPORT_GFX_CGCG |*/
  2486. RADEON_CG_SUPPORT_GFX_CGLS |
  2487. RADEON_CG_SUPPORT_GFX_CGTS |
  2488. RADEON_CG_SUPPORT_GFX_CP_LS |
  2489. RADEON_CG_SUPPORT_GFX_RLC_LS |
  2490. RADEON_CG_SUPPORT_MC_LS |
  2491. RADEON_CG_SUPPORT_MC_MGCG |
  2492. RADEON_CG_SUPPORT_SDMA_MGCG |
  2493. RADEON_CG_SUPPORT_BIF_LS |
  2494. RADEON_CG_SUPPORT_UVD_MGCG |
  2495. RADEON_CG_SUPPORT_HDP_LS |
  2496. RADEON_CG_SUPPORT_HDP_MGCG;
  2497. rdev->pg_flags = 0;
  2498. break;
  2499. case CHIP_HAINAN:
  2500. rdev->cg_flags =
  2501. RADEON_CG_SUPPORT_GFX_MGCG |
  2502. RADEON_CG_SUPPORT_GFX_MGLS |
  2503. /*RADEON_CG_SUPPORT_GFX_CGCG |*/
  2504. RADEON_CG_SUPPORT_GFX_CGLS |
  2505. RADEON_CG_SUPPORT_GFX_CGTS |
  2506. RADEON_CG_SUPPORT_GFX_CP_LS |
  2507. RADEON_CG_SUPPORT_GFX_RLC_LS |
  2508. RADEON_CG_SUPPORT_MC_LS |
  2509. RADEON_CG_SUPPORT_MC_MGCG |
  2510. RADEON_CG_SUPPORT_SDMA_MGCG |
  2511. RADEON_CG_SUPPORT_BIF_LS |
  2512. RADEON_CG_SUPPORT_HDP_LS |
  2513. RADEON_CG_SUPPORT_HDP_MGCG;
  2514. rdev->pg_flags = 0;
  2515. break;
  2516. default:
  2517. rdev->cg_flags = 0;
  2518. rdev->pg_flags = 0;
  2519. break;
  2520. }
  2521. break;
  2522. case CHIP_BONAIRE:
  2523. case CHIP_HAWAII:
  2524. rdev->asic = &ci_asic;
  2525. rdev->num_crtc = 6;
  2526. rdev->has_uvd = true;
  2527. if (rdev->family == CHIP_BONAIRE) {
  2528. rdev->cg_flags =
  2529. RADEON_CG_SUPPORT_GFX_MGCG |
  2530. RADEON_CG_SUPPORT_GFX_MGLS |
  2531. /*RADEON_CG_SUPPORT_GFX_CGCG |*/
  2532. RADEON_CG_SUPPORT_GFX_CGLS |
  2533. RADEON_CG_SUPPORT_GFX_CGTS |
  2534. RADEON_CG_SUPPORT_GFX_CGTS_LS |
  2535. RADEON_CG_SUPPORT_GFX_CP_LS |
  2536. RADEON_CG_SUPPORT_MC_LS |
  2537. RADEON_CG_SUPPORT_MC_MGCG |
  2538. RADEON_CG_SUPPORT_SDMA_MGCG |
  2539. RADEON_CG_SUPPORT_SDMA_LS |
  2540. RADEON_CG_SUPPORT_BIF_LS |
  2541. RADEON_CG_SUPPORT_VCE_MGCG |
  2542. RADEON_CG_SUPPORT_UVD_MGCG |
  2543. RADEON_CG_SUPPORT_HDP_LS |
  2544. RADEON_CG_SUPPORT_HDP_MGCG;
  2545. rdev->pg_flags = 0;
  2546. } else {
  2547. rdev->cg_flags =
  2548. RADEON_CG_SUPPORT_GFX_MGCG |
  2549. RADEON_CG_SUPPORT_GFX_MGLS |
  2550. /*RADEON_CG_SUPPORT_GFX_CGCG |*/
  2551. RADEON_CG_SUPPORT_GFX_CGLS |
  2552. RADEON_CG_SUPPORT_GFX_CGTS |
  2553. RADEON_CG_SUPPORT_GFX_CP_LS |
  2554. RADEON_CG_SUPPORT_MC_LS |
  2555. RADEON_CG_SUPPORT_MC_MGCG |
  2556. RADEON_CG_SUPPORT_SDMA_MGCG |
  2557. RADEON_CG_SUPPORT_SDMA_LS |
  2558. RADEON_CG_SUPPORT_BIF_LS |
  2559. RADEON_CG_SUPPORT_VCE_MGCG |
  2560. RADEON_CG_SUPPORT_UVD_MGCG |
  2561. RADEON_CG_SUPPORT_HDP_LS |
  2562. RADEON_CG_SUPPORT_HDP_MGCG;
  2563. rdev->pg_flags = 0;
  2564. }
  2565. break;
  2566. case CHIP_KAVERI:
  2567. case CHIP_KABINI:
  2568. case CHIP_MULLINS:
  2569. rdev->asic = &kv_asic;
  2570. /* set num crtcs */
  2571. if (rdev->family == CHIP_KAVERI) {
  2572. rdev->num_crtc = 4;
  2573. rdev->cg_flags =
  2574. RADEON_CG_SUPPORT_GFX_MGCG |
  2575. RADEON_CG_SUPPORT_GFX_MGLS |
  2576. /*RADEON_CG_SUPPORT_GFX_CGCG |*/
  2577. RADEON_CG_SUPPORT_GFX_CGLS |
  2578. RADEON_CG_SUPPORT_GFX_CGTS |
  2579. RADEON_CG_SUPPORT_GFX_CGTS_LS |
  2580. RADEON_CG_SUPPORT_GFX_CP_LS |
  2581. RADEON_CG_SUPPORT_SDMA_MGCG |
  2582. RADEON_CG_SUPPORT_SDMA_LS |
  2583. RADEON_CG_SUPPORT_BIF_LS |
  2584. RADEON_CG_SUPPORT_VCE_MGCG |
  2585. RADEON_CG_SUPPORT_UVD_MGCG |
  2586. RADEON_CG_SUPPORT_HDP_LS |
  2587. RADEON_CG_SUPPORT_HDP_MGCG;
  2588. rdev->pg_flags = 0;
  2589. /*RADEON_PG_SUPPORT_GFX_PG |
  2590. RADEON_PG_SUPPORT_GFX_SMG |
  2591. RADEON_PG_SUPPORT_GFX_DMG |
  2592. RADEON_PG_SUPPORT_UVD |
  2593. RADEON_PG_SUPPORT_VCE |
  2594. RADEON_PG_SUPPORT_CP |
  2595. RADEON_PG_SUPPORT_GDS |
  2596. RADEON_PG_SUPPORT_RLC_SMU_HS |
  2597. RADEON_PG_SUPPORT_ACP |
  2598. RADEON_PG_SUPPORT_SAMU;*/
  2599. } else {
  2600. rdev->num_crtc = 2;
  2601. rdev->cg_flags =
  2602. RADEON_CG_SUPPORT_GFX_MGCG |
  2603. RADEON_CG_SUPPORT_GFX_MGLS |
  2604. /*RADEON_CG_SUPPORT_GFX_CGCG |*/
  2605. RADEON_CG_SUPPORT_GFX_CGLS |
  2606. RADEON_CG_SUPPORT_GFX_CGTS |
  2607. RADEON_CG_SUPPORT_GFX_CGTS_LS |
  2608. RADEON_CG_SUPPORT_GFX_CP_LS |
  2609. RADEON_CG_SUPPORT_SDMA_MGCG |
  2610. RADEON_CG_SUPPORT_SDMA_LS |
  2611. RADEON_CG_SUPPORT_BIF_LS |
  2612. RADEON_CG_SUPPORT_VCE_MGCG |
  2613. RADEON_CG_SUPPORT_UVD_MGCG |
  2614. RADEON_CG_SUPPORT_HDP_LS |
  2615. RADEON_CG_SUPPORT_HDP_MGCG;
  2616. rdev->pg_flags = 0;
  2617. /*RADEON_PG_SUPPORT_GFX_PG |
  2618. RADEON_PG_SUPPORT_GFX_SMG |
  2619. RADEON_PG_SUPPORT_UVD |
  2620. RADEON_PG_SUPPORT_VCE |
  2621. RADEON_PG_SUPPORT_CP |
  2622. RADEON_PG_SUPPORT_GDS |
  2623. RADEON_PG_SUPPORT_RLC_SMU_HS |
  2624. RADEON_PG_SUPPORT_SAMU;*/
  2625. }
  2626. rdev->has_uvd = true;
  2627. break;
  2628. default:
  2629. /* FIXME: not supported yet */
  2630. return -EINVAL;
  2631. }
  2632. if (rdev->flags & RADEON_IS_IGP) {
  2633. rdev->asic->pm.get_memory_clock = NULL;
  2634. rdev->asic->pm.set_memory_clock = NULL;
  2635. }
  2636. return 0;
  2637. }