adreno_a3xx_snapshot.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558
  1. /* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. */
  13. #include <linux/io.h>
  14. #include "kgsl.h"
  15. #include "adreno.h"
  16. #include "kgsl_snapshot.h"
  17. #include "a3xx_reg.h"
  18. #define DEBUG_SECTION_SZ(_dwords) (((_dwords) * sizeof(unsigned int)) \
  19. + sizeof(struct kgsl_snapshot_debug))
  20. /* Shader memory size in words */
  21. #define SHADER_MEMORY_SIZE 0x4000
  22. /**
  23. * _rbbm_debug_bus_read - Helper function to read data from the RBBM
  24. * debug bus.
  25. * @device - GPU device to read/write registers
  26. * @block_id - Debug bus block to read from
  27. * @index - Index in the debug bus block to read
  28. * @ret - Value of the register read
  29. */
  30. static void _rbbm_debug_bus_read(struct kgsl_device *device,
  31. unsigned int block_id, unsigned int index, unsigned int *val)
  32. {
  33. unsigned int block = (block_id << 8) | 1 << 16;
  34. kgsl_regwrite(device, A3XX_RBBM_DEBUG_BUS_CTL, block | index);
  35. kgsl_regread(device, A3XX_RBBM_DEBUG_BUS_DATA_STATUS, val);
  36. }
  37. /**
  38. * a3xx_snapshot_shader_memory - Helper function to dump the GPU shader
  39. * memory to the snapshot buffer.
  40. * @device - GPU device whose shader memory is to be dumped
  41. * @snapshot - Pointer to binary snapshot data blob being made
  42. * @remain - Number of remaining bytes in the snapshot blob
  43. * @priv - Unused parameter
  44. */
  45. static int a3xx_snapshot_shader_memory(struct kgsl_device *device,
  46. void *snapshot, int remain, void *priv)
  47. {
  48. struct kgsl_snapshot_debug *header = snapshot;
  49. unsigned int i;
  50. unsigned int *data = snapshot + sizeof(*header);
  51. unsigned int shader_read_len = SHADER_MEMORY_SIZE;
  52. if (SHADER_MEMORY_SIZE > (device->shader_mem_len >> 2))
  53. shader_read_len = (device->shader_mem_len >> 2);
  54. if (remain < DEBUG_SECTION_SZ(SHADER_MEMORY_SIZE)) {
  55. SNAPSHOT_ERR_NOMEM(device, "SHADER MEMORY");
  56. return 0;
  57. }
  58. header->type = SNAPSHOT_DEBUG_SHADER_MEMORY;
  59. header->size = SHADER_MEMORY_SIZE;
  60. /* Map shader memory to kernel, for dumping */
  61. if (device->shader_mem_virt == NULL)
  62. device->shader_mem_virt = devm_ioremap(device->dev,
  63. device->shader_mem_phys,
  64. device->shader_mem_len);
  65. if (device->shader_mem_virt == NULL) {
  66. KGSL_DRV_ERR(device,
  67. "Unable to map shader memory region\n");
  68. return 0;
  69. }
  70. /* Now, dump shader memory to snapshot */
  71. for (i = 0; i < shader_read_len; i++)
  72. adreno_shadermem_regread(device, i, &data[i]);
  73. return DEBUG_SECTION_SZ(SHADER_MEMORY_SIZE);
  74. }
  75. #define VPC_MEMORY_BANKS 4
  76. #define VPC_MEMORY_SIZE 512
  77. static int a3xx_snapshot_vpc_memory(struct kgsl_device *device, void *snapshot,
  78. int remain, void *priv)
  79. {
  80. struct kgsl_snapshot_debug *header = snapshot;
  81. unsigned int *data = snapshot + sizeof(*header);
  82. int size = VPC_MEMORY_BANKS * VPC_MEMORY_SIZE;
  83. int bank, addr, i = 0;
  84. if (remain < DEBUG_SECTION_SZ(size)) {
  85. SNAPSHOT_ERR_NOMEM(device, "VPC MEMORY");
  86. return 0;
  87. }
  88. header->type = SNAPSHOT_DEBUG_VPC_MEMORY;
  89. header->size = size;
  90. for (bank = 0; bank < VPC_MEMORY_BANKS; bank++) {
  91. for (addr = 0; addr < VPC_MEMORY_SIZE; addr++) {
  92. unsigned int val = bank | (addr << 4);
  93. kgsl_regwrite(device,
  94. A3XX_VPC_VPC_DEBUG_RAM_SEL, val);
  95. kgsl_regread(device,
  96. A3XX_VPC_VPC_DEBUG_RAM_READ, &data[i++]);
  97. }
  98. }
  99. return DEBUG_SECTION_SZ(size);
  100. }
  101. #define CP_MEQ_SIZE 16
  102. static int a3xx_snapshot_cp_meq(struct kgsl_device *device, void *snapshot,
  103. int remain, void *priv)
  104. {
  105. struct kgsl_snapshot_debug *header = snapshot;
  106. unsigned int *data = snapshot + sizeof(*header);
  107. int i;
  108. if (remain < DEBUG_SECTION_SZ(CP_MEQ_SIZE)) {
  109. SNAPSHOT_ERR_NOMEM(device, "CP MEQ DEBUG");
  110. return 0;
  111. }
  112. header->type = SNAPSHOT_DEBUG_CP_MEQ;
  113. header->size = CP_MEQ_SIZE;
  114. kgsl_regwrite(device, A3XX_CP_MEQ_ADDR, 0x0);
  115. for (i = 0; i < CP_MEQ_SIZE; i++)
  116. kgsl_regread(device, A3XX_CP_MEQ_DATA, &data[i]);
  117. return DEBUG_SECTION_SZ(CP_MEQ_SIZE);
  118. }
  119. static int a3xx_snapshot_cp_pm4_ram(struct kgsl_device *device, void *snapshot,
  120. int remain, void *priv)
  121. {
  122. struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
  123. struct kgsl_snapshot_debug *header = snapshot;
  124. unsigned int *data = snapshot + sizeof(*header);
  125. int i, size = adreno_dev->pm4_fw_size - 1;
  126. if (remain < DEBUG_SECTION_SZ(size)) {
  127. SNAPSHOT_ERR_NOMEM(device, "CP PM4 RAM DEBUG");
  128. return 0;
  129. }
  130. header->type = SNAPSHOT_DEBUG_CP_PM4_RAM;
  131. header->size = size;
  132. /*
  133. * Read the firmware from the GPU rather than use our cache in order to
  134. * try to catch mis-programming or corruption in the hardware. We do
  135. * use the cached version of the size, however, instead of trying to
  136. * maintain always changing hardcoded constants
  137. */
  138. kgsl_regwrite(device, REG_CP_ME_RAM_RADDR, 0x0);
  139. for (i = 0; i < size; i++)
  140. kgsl_regread(device, REG_CP_ME_RAM_DATA, &data[i]);
  141. return DEBUG_SECTION_SZ(size);
  142. }
  143. static int a3xx_snapshot_cp_pfp_ram(struct kgsl_device *device, void *snapshot,
  144. int remain, void *priv)
  145. {
  146. struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
  147. struct kgsl_snapshot_debug *header = snapshot;
  148. unsigned int *data = snapshot + sizeof(*header);
  149. int i, size = adreno_dev->pfp_fw_size - 1;
  150. if (remain < DEBUG_SECTION_SZ(size)) {
  151. SNAPSHOT_ERR_NOMEM(device, "CP PFP RAM DEBUG");
  152. return 0;
  153. }
  154. header->type = SNAPSHOT_DEBUG_CP_PFP_RAM;
  155. header->size = size;
  156. /*
  157. * Read the firmware from the GPU rather than use our cache in order to
  158. * try to catch mis-programming or corruption in the hardware. We do
  159. * use the cached version of the size, however, instead of trying to
  160. * maintain always changing hardcoded constants
  161. */
  162. kgsl_regwrite(device, A3XX_CP_PFP_UCODE_ADDR, 0x0);
  163. for (i = 0; i < size; i++)
  164. kgsl_regread(device, A3XX_CP_PFP_UCODE_DATA, &data[i]);
  165. return DEBUG_SECTION_SZ(size);
  166. }
  167. /* This is the ROQ buffer size on both the A305 and A320 */
  168. #define A320_CP_ROQ_SIZE 128
  169. /* This is the ROQ buffer size on the A330 */
  170. #define A330_CP_ROQ_SIZE 512
  171. static int a3xx_snapshot_cp_roq(struct kgsl_device *device, void *snapshot,
  172. int remain, void *priv)
  173. {
  174. struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
  175. struct kgsl_snapshot_debug *header = snapshot;
  176. unsigned int *data = snapshot + sizeof(*header);
  177. int i, size;
  178. /* The size of the ROQ buffer is core dependent */
  179. size = (adreno_is_a330(adreno_dev) ||
  180. adreno_is_a305b(adreno_dev)) ?
  181. A330_CP_ROQ_SIZE : A320_CP_ROQ_SIZE;
  182. if (remain < DEBUG_SECTION_SZ(size)) {
  183. SNAPSHOT_ERR_NOMEM(device, "CP ROQ DEBUG");
  184. return 0;
  185. }
  186. header->type = SNAPSHOT_DEBUG_CP_ROQ;
  187. header->size = size;
  188. kgsl_regwrite(device, A3XX_CP_ROQ_ADDR, 0x0);
  189. for (i = 0; i < size; i++)
  190. kgsl_regread(device, A3XX_CP_ROQ_DATA, &data[i]);
  191. return DEBUG_SECTION_SZ(size);
  192. }
  193. #define A330_CP_MERCIU_QUEUE_SIZE 32
  194. static int a330_snapshot_cp_merciu(struct kgsl_device *device, void *snapshot,
  195. int remain, void *priv)
  196. {
  197. struct kgsl_snapshot_debug *header = snapshot;
  198. unsigned int *data = snapshot + sizeof(*header);
  199. int i, size;
  200. /* The MERCIU data is two dwords per entry */
  201. size = A330_CP_MERCIU_QUEUE_SIZE << 1;
  202. if (remain < DEBUG_SECTION_SZ(size)) {
  203. SNAPSHOT_ERR_NOMEM(device, "CP MERCIU DEBUG");
  204. return 0;
  205. }
  206. header->type = SNAPSHOT_DEBUG_CP_MERCIU;
  207. header->size = size;
  208. kgsl_regwrite(device, A3XX_CP_MERCIU_ADDR, 0x0);
  209. for (i = 0; i < A330_CP_MERCIU_QUEUE_SIZE; i++) {
  210. kgsl_regread(device, A3XX_CP_MERCIU_DATA,
  211. &data[(i * 2)]);
  212. kgsl_regread(device, A3XX_CP_MERCIU_DATA2,
  213. &data[(i * 2) + 1]);
  214. }
  215. return DEBUG_SECTION_SZ(size);
  216. }
  217. struct debugbus_block {
  218. unsigned int block_id;
  219. unsigned int dwords;
  220. };
  221. static int a3xx_snapshot_debugbus_block(struct kgsl_device *device,
  222. void *snapshot, int remain, void *priv)
  223. {
  224. struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
  225. struct kgsl_snapshot_debugbus *header = snapshot;
  226. struct debugbus_block *block = priv;
  227. int i;
  228. unsigned int *data = snapshot + sizeof(*header);
  229. unsigned int dwords;
  230. int size;
  231. /*
  232. * For A305 and A320 all debug bus regions are the same size (0x40). For
  233. * A330, they can be different sizes - most are still 0x40, but some
  234. * like CP are larger
  235. */
  236. dwords = (adreno_is_a330(adreno_dev) ||
  237. adreno_is_a305b(adreno_dev)) ?
  238. block->dwords : 0x40;
  239. size = (dwords * sizeof(unsigned int)) + sizeof(*header);
  240. if (remain < size) {
  241. SNAPSHOT_ERR_NOMEM(device, "DEBUGBUS");
  242. return 0;
  243. }
  244. header->id = block->block_id;
  245. header->count = dwords;
  246. for (i = 0; i < dwords; i++)
  247. _rbbm_debug_bus_read(device, block->block_id, i, &data[i]);
  248. return size;
  249. }
  250. static struct debugbus_block debugbus_blocks[] = {
  251. { RBBM_BLOCK_ID_CP, 0x52, },
  252. { RBBM_BLOCK_ID_RBBM, 0x40, },
  253. { RBBM_BLOCK_ID_VBIF, 0x40, },
  254. { RBBM_BLOCK_ID_HLSQ, 0x40, },
  255. { RBBM_BLOCK_ID_UCHE, 0x40, },
  256. { RBBM_BLOCK_ID_PC, 0x40, },
  257. { RBBM_BLOCK_ID_VFD, 0x40, },
  258. { RBBM_BLOCK_ID_VPC, 0x40, },
  259. { RBBM_BLOCK_ID_TSE, 0x40, },
  260. { RBBM_BLOCK_ID_RAS, 0x40, },
  261. { RBBM_BLOCK_ID_VSC, 0x40, },
  262. { RBBM_BLOCK_ID_SP_0, 0x40, },
  263. { RBBM_BLOCK_ID_SP_1, 0x40, },
  264. { RBBM_BLOCK_ID_SP_2, 0x40, },
  265. { RBBM_BLOCK_ID_SP_3, 0x40, },
  266. { RBBM_BLOCK_ID_TPL1_0, 0x40, },
  267. { RBBM_BLOCK_ID_TPL1_1, 0x40, },
  268. { RBBM_BLOCK_ID_TPL1_2, 0x40, },
  269. { RBBM_BLOCK_ID_TPL1_3, 0x40, },
  270. { RBBM_BLOCK_ID_RB_0, 0x40, },
  271. { RBBM_BLOCK_ID_RB_1, 0x40, },
  272. { RBBM_BLOCK_ID_RB_2, 0x40, },
  273. { RBBM_BLOCK_ID_RB_3, 0x40, },
  274. { RBBM_BLOCK_ID_MARB_0, 0x40, },
  275. { RBBM_BLOCK_ID_MARB_1, 0x40, },
  276. { RBBM_BLOCK_ID_MARB_2, 0x40, },
  277. { RBBM_BLOCK_ID_MARB_3, 0x40, },
  278. };
  279. static void *a3xx_snapshot_debugbus(struct kgsl_device *device,
  280. void *snapshot, int *remain)
  281. {
  282. int i;
  283. for (i = 0; i < ARRAY_SIZE(debugbus_blocks); i++) {
  284. snapshot = kgsl_snapshot_add_section(device,
  285. KGSL_SNAPSHOT_SECTION_DEBUGBUS, snapshot, remain,
  286. a3xx_snapshot_debugbus_block,
  287. (void *) &debugbus_blocks[i]);
  288. }
  289. return snapshot;
  290. }
  291. static void _snapshot_a3xx_regs(struct kgsl_snapshot_registers *regs,
  292. struct kgsl_snapshot_registers_list *list)
  293. {
  294. regs[list->count].regs = (unsigned int *) a3xx_registers;
  295. regs[list->count].count = a3xx_registers_count;
  296. list->count++;
  297. }
  298. static void _snapshot_hlsq_regs(struct kgsl_snapshot_registers *regs,
  299. struct kgsl_snapshot_registers_list *list,
  300. struct adreno_device *adreno_dev)
  301. {
  302. struct kgsl_device *device = &adreno_dev->dev;
  303. /*
  304. * Trying to read HLSQ registers when the HLSQ block is busy
  305. * will cause the device to hang. The RBBM_DEBUG_BUS has information
  306. * that will tell us if the HLSQ block is busy or not. Read values
  307. * from the debug bus to ensure the HLSQ block is not busy (this
  308. * is hardware dependent). If the HLSQ block is busy do not
  309. * dump the registers, otherwise dump the HLSQ registers.
  310. */
  311. if (adreno_is_a330(adreno_dev)) {
  312. /*
  313. * stall_ctxt_full status bit: RBBM_BLOCK_ID_HLSQ index 49 [27]
  314. *
  315. * if (!stall_context_full)
  316. * then dump HLSQ registers
  317. */
  318. unsigned int stall_context_full = 0;
  319. _rbbm_debug_bus_read(device, RBBM_BLOCK_ID_HLSQ, 49,
  320. &stall_context_full);
  321. stall_context_full &= 0x08000000;
  322. if (stall_context_full)
  323. return;
  324. } else {
  325. /*
  326. * tpif status bits: RBBM_BLOCK_ID_HLSQ index 4 [4:0]
  327. * spif status bits: RBBM_BLOCK_ID_HLSQ index 7 [5:0]
  328. *
  329. * if ((tpif == 0, 1, 28) && (spif == 0, 1, 10))
  330. * then dump HLSQ registers
  331. */
  332. unsigned int next_pif = 0;
  333. /* check tpif */
  334. _rbbm_debug_bus_read(device, RBBM_BLOCK_ID_HLSQ, 4, &next_pif);
  335. next_pif &= 0x1f;
  336. if (next_pif != 0 && next_pif != 1 && next_pif != 28)
  337. return;
  338. /* check spif */
  339. _rbbm_debug_bus_read(device, RBBM_BLOCK_ID_HLSQ, 7, &next_pif);
  340. next_pif &= 0x3f;
  341. if (next_pif != 0 && next_pif != 1 && next_pif != 10)
  342. return;
  343. }
  344. regs[list->count].regs = (unsigned int *) a3xx_hlsq_registers;
  345. regs[list->count].count = a3xx_hlsq_registers_count;
  346. list->count++;
  347. }
  348. static void _snapshot_a330_regs(struct kgsl_snapshot_registers *regs,
  349. struct kgsl_snapshot_registers_list *list)
  350. {
  351. /* For A330, append the additional list of new registers to grab */
  352. regs[list->count].regs = (unsigned int *) a330_registers;
  353. regs[list->count].count = a330_registers_count;
  354. list->count++;
  355. }
  356. /* A3XX GPU snapshot function - this is where all of the A3XX specific
  357. * bits and pieces are grabbed into the snapshot memory
  358. */
  359. void *a3xx_snapshot(struct adreno_device *adreno_dev, void *snapshot,
  360. int *remain, int hang)
  361. {
  362. struct kgsl_device *device = &adreno_dev->dev;
  363. struct kgsl_snapshot_registers_list list;
  364. struct kgsl_snapshot_registers regs[5];
  365. int size;
  366. list.registers = regs;
  367. list.count = 0;
  368. /* Disable Clock gating temporarily for the debug bus to work */
  369. kgsl_regwrite(device, A3XX_RBBM_CLOCK_CTL, 0x00);
  370. /* Store relevant registers in list to snapshot */
  371. _snapshot_a3xx_regs(regs, &list);
  372. _snapshot_hlsq_regs(regs, &list, adreno_dev);
  373. if (adreno_is_a330(adreno_dev) || adreno_is_a305b(adreno_dev))
  374. _snapshot_a330_regs(regs, &list);
  375. /* Master set of (non debug) registers */
  376. snapshot = kgsl_snapshot_add_section(device,
  377. KGSL_SNAPSHOT_SECTION_REGS, snapshot, remain,
  378. kgsl_snapshot_dump_regs, &list);
  379. /*
  380. * CP_STATE_DEBUG indexed registers - 20 on 305 and 320 and 46 on A330
  381. */
  382. size = (adreno_is_a330(adreno_dev) ||
  383. adreno_is_a305b(adreno_dev)) ? 0x2E : 0x14;
  384. /* Skip indexed register dump for these chipsets 8974, 8x26, 8x10 */
  385. if (adreno_is_a330(adreno_dev) ||
  386. adreno_is_a330v2(adreno_dev) ||
  387. adreno_is_a305b(adreno_dev) ||
  388. adreno_is_a305c(adreno_dev) ) {
  389. KGSL_DRV_ERR(device,
  390. "Skipping indexed register dump\n");
  391. } else {
  392. snapshot = kgsl_snapshot_indexed_registers(device, snapshot,
  393. remain, REG_CP_STATE_DEBUG_INDEX,
  394. REG_CP_STATE_DEBUG_DATA, 0x0, size);
  395. /* CP_ME indexed registers */
  396. snapshot = kgsl_snapshot_indexed_registers(device, snapshot,
  397. remain, REG_CP_ME_CNTL, REG_CP_ME_STATUS,
  398. 64, 44);
  399. }
  400. /* VPC memory */
  401. snapshot = kgsl_snapshot_add_section(device,
  402. KGSL_SNAPSHOT_SECTION_DEBUG, snapshot, remain,
  403. a3xx_snapshot_vpc_memory, NULL);
  404. /* CP MEQ */
  405. snapshot = kgsl_snapshot_add_section(device,
  406. KGSL_SNAPSHOT_SECTION_DEBUG, snapshot, remain,
  407. a3xx_snapshot_cp_meq, NULL);
  408. /* Skip shader memory dump for these chipsets: 8974, 8x26, 8x10 */
  409. if (adreno_is_a330(adreno_dev) ||
  410. adreno_is_a330v2(adreno_dev) ||
  411. adreno_is_a305b(adreno_dev) ||
  412. adreno_is_a305c(adreno_dev) ) {
  413. KGSL_DRV_ERR(device,
  414. "Skipping shader memory dump\n");
  415. } else {
  416. /* Shader working/shadow memory */
  417. snapshot = kgsl_snapshot_add_section(device,
  418. KGSL_SNAPSHOT_SECTION_DEBUG, snapshot, remain,
  419. a3xx_snapshot_shader_memory, NULL);
  420. }
  421. /* CP PFP and PM4 */
  422. /* Reading these will hang the GPU if it isn't already hung */
  423. if (hang) {
  424. unsigned int reg;
  425. /*
  426. * Reading the microcode while the CP will is running will
  427. * basically basically move the CP instruction pointer to
  428. * whatever address we read. Big badaboom ensues. Stop the CP
  429. * (if it isn't already stopped) to ensure that we are safe.
  430. * We do this here and not earlier to avoid corrupting the RBBM
  431. * status and CP registers - by the time we get here we don't
  432. * care about the contents of the CP anymore.
  433. */
  434. adreno_readreg(adreno_dev, ADRENO_REG_CP_ME_CNTL, &reg);
  435. reg |= (1 << 27) | (1 << 28);
  436. adreno_writereg(adreno_dev, ADRENO_REG_CP_ME_CNTL, reg);
  437. snapshot = kgsl_snapshot_add_section(device,
  438. KGSL_SNAPSHOT_SECTION_DEBUG, snapshot, remain,
  439. a3xx_snapshot_cp_pfp_ram, NULL);
  440. snapshot = kgsl_snapshot_add_section(device,
  441. KGSL_SNAPSHOT_SECTION_DEBUG, snapshot, remain,
  442. a3xx_snapshot_cp_pm4_ram, NULL);
  443. }
  444. /* CP ROQ */
  445. snapshot = kgsl_snapshot_add_section(device,
  446. KGSL_SNAPSHOT_SECTION_DEBUG, snapshot, remain,
  447. a3xx_snapshot_cp_roq, NULL);
  448. if (adreno_is_a330(adreno_dev) ||
  449. adreno_is_a305b(adreno_dev)) {
  450. snapshot = kgsl_snapshot_add_section(device,
  451. KGSL_SNAPSHOT_SECTION_DEBUG, snapshot, remain,
  452. a330_snapshot_cp_merciu, NULL);
  453. }
  454. snapshot = a3xx_snapshot_debugbus(device, snapshot, remain);
  455. /* Enable Clock gating */
  456. kgsl_regwrite(device, A3XX_RBBM_CLOCK_CTL,
  457. adreno_a3xx_rbbm_clock_ctl_default(adreno_dev));
  458. return snapshot;
  459. }