Shrenuj Bansal | a419c79 | 2016-10-20 14:05:11 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2013-2015, 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 | #ifndef __ADRENO_SNAPSHOT_H |
| 14 | #define __ADRENO_SNAPSHOT_H |
| 15 | |
| 16 | #include "kgsl_snapshot.h" |
| 17 | |
| 18 | #define CP_CRASH_DUMPER_TIMEOUT 1000 |
| 19 | |
| 20 | #define DEBUG_SECTION_SZ(_dwords) (((_dwords) * sizeof(unsigned int)) \ |
| 21 | + sizeof(struct kgsl_snapshot_debug)) |
| 22 | |
| 23 | #define SHADER_SECTION_SZ(_dwords) (((_dwords) * sizeof(unsigned int)) \ |
| 24 | + sizeof(struct kgsl_snapshot_shader)) |
| 25 | |
| 26 | /* Section sizes for A320 */ |
| 27 | #define A320_SNAPSHOT_CP_STATE_SECTION_SIZE 0x2e |
| 28 | #define A320_SNAPSHOT_ROQ_SECTION_SIZE 512 |
| 29 | #define A320_SNAPSHOT_CP_MERCIU_SECTION_SIZE 32 |
| 30 | |
| 31 | /* Macro to make it super easy to dump registers */ |
| 32 | #define SNAPSHOT_REGISTERS(_d, _s, _r) \ |
| 33 | adreno_snapshot_registers((_d), (_s), \ |
| 34 | (unsigned int *) _r, ARRAY_SIZE(_r) / 2) |
| 35 | |
| 36 | size_t adreno_snapshot_cp_merciu(struct kgsl_device *device, u8 *buf, |
| 37 | size_t remain, void *priv); |
| 38 | size_t adreno_snapshot_cp_roq(struct kgsl_device *device, u8 *buf, |
| 39 | size_t remain, void *priv); |
| 40 | size_t adreno_snapshot_cp_pm4_ram(struct kgsl_device *device, u8 *buf, |
| 41 | size_t remain, void *priv); |
| 42 | size_t adreno_snapshot_cp_pfp_ram(struct kgsl_device *device, u8 *buf, |
| 43 | size_t remain, void *priv); |
| 44 | size_t adreno_snapshot_cp_meq(struct kgsl_device *device, u8 *buf, |
| 45 | size_t remain, void *priv); |
| 46 | size_t adreno_snapshot_vpc_memory(struct kgsl_device *device, u8 *buf, |
| 47 | size_t remain, void *priv); |
| 48 | |
| 49 | void adreno_snapshot_registers(struct kgsl_device *device, |
| 50 | struct kgsl_snapshot *snapshot, |
| 51 | const unsigned int *regs, unsigned int count); |
| 52 | |
| 53 | void adreno_snapshot_vbif_registers(struct kgsl_device *device, |
| 54 | struct kgsl_snapshot *snapshot, |
| 55 | const struct adreno_vbif_snapshot_registers *list, |
| 56 | unsigned int count); |
| 57 | |
| 58 | #endif /*__ADRENO_SNAPSHOT_H */ |