Thomas Gleixner | caab277 | 2019-06-03 07:44:50 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Rob Clark | 7198e6b | 2013-07-19 12:59:32 -0400 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2013 Red Hat |
| 4 | * Author: Rob Clark <robdclark@gmail.com> |
Rob Clark | 7198e6b | 2013-07-19 12:59:32 -0400 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #ifndef __MSM_GPU_H__ |
| 8 | #define __MSM_GPU_H__ |
| 9 | |
| 10 | #include <linux/clk.h> |
Jordan Crouse | fcf9d0b | 2019-02-12 11:52:38 +0200 | [diff] [blame] | 11 | #include <linux/interconnect.h> |
Rob Clark | 7198e6b | 2013-07-19 12:59:32 -0400 | [diff] [blame] | 12 | #include <linux/regulator/consumer.h> |
| 13 | |
| 14 | #include "msm_drv.h" |
Rob Clark | ca762a8 | 2016-03-15 17:22:13 -0400 | [diff] [blame] | 15 | #include "msm_fence.h" |
Rob Clark | 7198e6b | 2013-07-19 12:59:32 -0400 | [diff] [blame] | 16 | #include "msm_ringbuffer.h" |
| 17 | |
| 18 | struct msm_gem_submit; |
Rob Clark | 70c70f0 | 2014-05-30 14:49:43 -0400 | [diff] [blame] | 19 | struct msm_gpu_perfcntr; |
Jordan Crouse | e00e473 | 2018-07-24 10:33:24 -0600 | [diff] [blame] | 20 | struct msm_gpu_state; |
Rob Clark | 7198e6b | 2013-07-19 12:59:32 -0400 | [diff] [blame] | 21 | |
Jordan Crouse | 5770fc7 | 2017-05-08 14:35:03 -0600 | [diff] [blame] | 22 | struct msm_gpu_config { |
| 23 | const char *ioname; |
Jordan Crouse | 5770fc7 | 2017-05-08 14:35:03 -0600 | [diff] [blame] | 24 | uint64_t va_start; |
| 25 | uint64_t va_end; |
Jordan Crouse | f97deca | 2017-10-20 11:06:57 -0600 | [diff] [blame] | 26 | unsigned int nr_rings; |
Jordan Crouse | 5770fc7 | 2017-05-08 14:35:03 -0600 | [diff] [blame] | 27 | }; |
| 28 | |
Rob Clark | 7198e6b | 2013-07-19 12:59:32 -0400 | [diff] [blame] | 29 | /* So far, with hardware that I've seen to date, we can have: |
| 30 | * + zero, one, or two z180 2d cores |
| 31 | * + a3xx or a2xx 3d core, which share a common CP (the firmware |
| 32 | * for the CP seems to implement some different PM4 packet types |
| 33 | * but the basics of cmdstream submission are the same) |
| 34 | * |
| 35 | * Which means that the eventual complete "class" hierarchy, once |
| 36 | * support for all past and present hw is in place, becomes: |
| 37 | * + msm_gpu |
| 38 | * + adreno_gpu |
| 39 | * + a3xx_gpu |
| 40 | * + a2xx_gpu |
| 41 | * + z180_gpu |
| 42 | */ |
| 43 | struct msm_gpu_funcs { |
| 44 | int (*get_param)(struct msm_gpu *gpu, uint32_t param, uint64_t *value); |
| 45 | int (*hw_init)(struct msm_gpu *gpu); |
| 46 | int (*pm_suspend)(struct msm_gpu *gpu); |
| 47 | int (*pm_resume)(struct msm_gpu *gpu); |
Rob Clark | 1193c3b | 2016-05-03 09:46:49 -0400 | [diff] [blame] | 48 | void (*submit)(struct msm_gpu *gpu, struct msm_gem_submit *submit, |
Rob Clark | 7198e6b | 2013-07-19 12:59:32 -0400 | [diff] [blame] | 49 | struct msm_file_private *ctx); |
Jordan Crouse | f97deca | 2017-10-20 11:06:57 -0600 | [diff] [blame] | 50 | void (*flush)(struct msm_gpu *gpu, struct msm_ringbuffer *ring); |
Rob Clark | 7198e6b | 2013-07-19 12:59:32 -0400 | [diff] [blame] | 51 | irqreturn_t (*irq)(struct msm_gpu *irq); |
Jordan Crouse | f97deca | 2017-10-20 11:06:57 -0600 | [diff] [blame] | 52 | struct msm_ringbuffer *(*active_ring)(struct msm_gpu *gpu); |
Rob Clark | bd6f82d | 2013-08-24 14:20:38 -0400 | [diff] [blame] | 53 | void (*recover)(struct msm_gpu *gpu); |
Rob Clark | 7198e6b | 2013-07-19 12:59:32 -0400 | [diff] [blame] | 54 | void (*destroy)(struct msm_gpu *gpu); |
Arnd Bergmann | c878a62 | 2018-08-13 23:23:44 +0200 | [diff] [blame] | 55 | #if defined(CONFIG_DEBUG_FS) || defined(CONFIG_DEV_COREDUMP) |
Rob Clark | 7198e6b | 2013-07-19 12:59:32 -0400 | [diff] [blame] | 56 | /* show GPU status in debugfs: */ |
Jordan Crouse | 4f776f4 | 2018-07-24 10:33:25 -0600 | [diff] [blame] | 57 | void (*show)(struct msm_gpu *gpu, struct msm_gpu_state *state, |
Jordan Crouse | c0fec7f | 2018-07-24 10:33:27 -0600 | [diff] [blame] | 58 | struct drm_printer *p); |
Rob Clark | 331dc0b | 2017-12-13 15:12:56 -0500 | [diff] [blame] | 59 | /* for generation specific debugfs: */ |
| 60 | int (*debugfs_init)(struct msm_gpu *gpu, struct drm_minor *minor); |
Rob Clark | 7198e6b | 2013-07-19 12:59:32 -0400 | [diff] [blame] | 61 | #endif |
Sharat Masetty | de0a3d09 | 2018-10-04 15:11:42 +0530 | [diff] [blame] | 62 | unsigned long (*gpu_busy)(struct msm_gpu *gpu); |
Jordan Crouse | e00e473 | 2018-07-24 10:33:24 -0600 | [diff] [blame] | 63 | struct msm_gpu_state *(*gpu_state_get)(struct msm_gpu *gpu); |
Jordan Crouse | c0fec7f | 2018-07-24 10:33:27 -0600 | [diff] [blame] | 64 | int (*gpu_state_put)(struct msm_gpu_state *state); |
Sharat Masetty | de0a3d09 | 2018-10-04 15:11:42 +0530 | [diff] [blame] | 65 | unsigned long (*gpu_get_freq)(struct msm_gpu *gpu); |
| 66 | void (*gpu_set_freq)(struct msm_gpu *gpu, unsigned long freq); |
Rob Clark | 7198e6b | 2013-07-19 12:59:32 -0400 | [diff] [blame] | 67 | }; |
| 68 | |
| 69 | struct msm_gpu { |
| 70 | const char *name; |
| 71 | struct drm_device *dev; |
Rob Clark | eeb7547 | 2017-02-10 15:36:33 -0500 | [diff] [blame] | 72 | struct platform_device *pdev; |
Rob Clark | 7198e6b | 2013-07-19 12:59:32 -0400 | [diff] [blame] | 73 | const struct msm_gpu_funcs *funcs; |
| 74 | |
Rob Clark | 70c70f0 | 2014-05-30 14:49:43 -0400 | [diff] [blame] | 75 | /* performance counters (hw & sw): */ |
| 76 | spinlock_t perf_lock; |
| 77 | bool perfcntr_active; |
| 78 | struct { |
| 79 | bool active; |
| 80 | ktime_t time; |
| 81 | } last_sample; |
| 82 | uint32_t totaltime, activetime; /* sw counters */ |
| 83 | uint32_t last_cntrs[5]; /* hw counters */ |
| 84 | const struct msm_gpu_perfcntr *perfcntrs; |
| 85 | uint32_t num_perfcntrs; |
| 86 | |
Jordan Crouse | f97deca | 2017-10-20 11:06:57 -0600 | [diff] [blame] | 87 | struct msm_ringbuffer *rb[MSM_GPU_MAX_RINGS]; |
| 88 | int nr_rings; |
Rob Clark | 7198e6b | 2013-07-19 12:59:32 -0400 | [diff] [blame] | 89 | |
| 90 | /* list of GEM active objects: */ |
| 91 | struct list_head active_list; |
| 92 | |
Rob Clark | eeb7547 | 2017-02-10 15:36:33 -0500 | [diff] [blame] | 93 | /* does gpu need hw_init? */ |
| 94 | bool needs_hw_init; |
Rob Clark | 37d77c3 | 2014-01-11 16:25:08 -0500 | [diff] [blame] | 95 | |
Rob Clark | 48dc424 | 2019-04-16 16:13:28 -0700 | [diff] [blame] | 96 | /* number of GPU hangs (for all contexts) */ |
| 97 | int global_faults; |
| 98 | |
Rob Clark | 7198e6b | 2013-07-19 12:59:32 -0400 | [diff] [blame] | 99 | /* worker for handling active-list retiring: */ |
| 100 | struct work_struct retire_work; |
| 101 | |
| 102 | void __iomem *mmio; |
| 103 | int irq; |
| 104 | |
Rob Clark | 667ce33 | 2016-09-28 19:58:32 -0400 | [diff] [blame] | 105 | struct msm_gem_address_space *aspace; |
Rob Clark | 7198e6b | 2013-07-19 12:59:32 -0400 | [diff] [blame] | 106 | |
| 107 | /* Power Control: */ |
| 108 | struct regulator *gpu_reg, *gpu_cx; |
Jordan Crouse | 8e54eea | 2018-08-06 11:33:21 -0600 | [diff] [blame] | 109 | struct clk_bulk_data *grp_clks; |
Jordan Crouse | 98db803 | 2017-03-07 10:02:56 -0700 | [diff] [blame] | 110 | int nr_clocks; |
| 111 | struct clk *ebi1_clk, *core_clk, *rbbmtimer_clk; |
Jordan Crouse | 1babd70 | 2017-11-21 12:40:53 -0700 | [diff] [blame] | 112 | uint32_t fast_rate; |
Rob Clark | bd6f82d | 2013-08-24 14:20:38 -0400 | [diff] [blame] | 113 | |
Brian Masney | 00bb924 | 2019-11-21 20:26:43 -0500 | [diff] [blame^] | 114 | /* The gfx-mem interconnect path that's used by all GPU types. */ |
Jordan Crouse | fcf9d0b | 2019-02-12 11:52:38 +0200 | [diff] [blame] | 115 | struct icc_path *icc_path; |
| 116 | |
Brian Masney | 00bb924 | 2019-11-21 20:26:43 -0500 | [diff] [blame^] | 117 | /* |
| 118 | * Second interconnect path for some A3xx and all A4xx GPUs to the |
| 119 | * On Chip MEMory (OCMEM). |
| 120 | */ |
| 121 | struct icc_path *ocmem_icc_path; |
| 122 | |
Rob Clark | 37d77c3 | 2014-01-11 16:25:08 -0500 | [diff] [blame] | 123 | /* Hang and Inactivity Detection: |
| 124 | */ |
| 125 | #define DRM_MSM_INACTIVE_PERIOD 66 /* in ms (roughly four frames) */ |
Rob Clark | eeb7547 | 2017-02-10 15:36:33 -0500 | [diff] [blame] | 126 | |
Rob Clark | bd6f82d | 2013-08-24 14:20:38 -0400 | [diff] [blame] | 127 | #define DRM_MSM_HANGCHECK_PERIOD 500 /* in ms */ |
| 128 | #define DRM_MSM_HANGCHECK_JIFFIES msecs_to_jiffies(DRM_MSM_HANGCHECK_PERIOD) |
| 129 | struct timer_list hangcheck_timer; |
Rob Clark | bd6f82d | 2013-08-24 14:20:38 -0400 | [diff] [blame] | 130 | struct work_struct recover_work; |
Rob Clark | 1a370be | 2015-06-07 13:46:04 -0400 | [diff] [blame] | 131 | |
Jordan Crouse | cd414f3 | 2017-10-20 11:06:56 -0600 | [diff] [blame] | 132 | struct drm_gem_object *memptrs_bo; |
Jordan Crouse | f91c14a | 2018-01-10 10:41:54 -0700 | [diff] [blame] | 133 | |
| 134 | struct { |
| 135 | struct devfreq *devfreq; |
| 136 | u64 busy_cycles; |
| 137 | ktime_t time; |
| 138 | } devfreq; |
Jordan Crouse | c0fec7f | 2018-07-24 10:33:27 -0600 | [diff] [blame] | 139 | |
| 140 | struct msm_gpu_state *crashstate; |
Rob Clark | 7198e6b | 2013-07-19 12:59:32 -0400 | [diff] [blame] | 141 | }; |
| 142 | |
Jordan Crouse | f97deca | 2017-10-20 11:06:57 -0600 | [diff] [blame] | 143 | /* It turns out that all targets use the same ringbuffer size */ |
| 144 | #define MSM_GPU_RINGBUFFER_SZ SZ_32K |
Jordan Crouse | 4d87fc3 | 2017-10-20 11:07:00 -0600 | [diff] [blame] | 145 | #define MSM_GPU_RINGBUFFER_BLKSIZE 32 |
| 146 | |
| 147 | #define MSM_GPU_RB_CNTL_DEFAULT \ |
| 148 | (AXXX_CP_RB_CNTL_BUFSZ(ilog2(MSM_GPU_RINGBUFFER_SZ / 8)) | \ |
| 149 | AXXX_CP_RB_CNTL_BLKSZ(ilog2(MSM_GPU_RINGBUFFER_BLKSIZE / 8))) |
Jordan Crouse | f97deca | 2017-10-20 11:06:57 -0600 | [diff] [blame] | 150 | |
Rob Clark | 37d77c3 | 2014-01-11 16:25:08 -0500 | [diff] [blame] | 151 | static inline bool msm_gpu_active(struct msm_gpu *gpu) |
| 152 | { |
Jordan Crouse | f97deca | 2017-10-20 11:06:57 -0600 | [diff] [blame] | 153 | int i; |
| 154 | |
| 155 | for (i = 0; i < gpu->nr_rings; i++) { |
| 156 | struct msm_ringbuffer *ring = gpu->rb[i]; |
| 157 | |
| 158 | if (ring->seqno > ring->memptrs->fence) |
| 159 | return true; |
| 160 | } |
| 161 | |
| 162 | return false; |
Rob Clark | 37d77c3 | 2014-01-11 16:25:08 -0500 | [diff] [blame] | 163 | } |
| 164 | |
Rob Clark | 70c70f0 | 2014-05-30 14:49:43 -0400 | [diff] [blame] | 165 | /* Perf-Counters: |
| 166 | * The select_reg and select_val are just there for the benefit of the child |
| 167 | * class that actually enables the perf counter.. but msm_gpu base class |
| 168 | * will handle sampling/displaying the counters. |
| 169 | */ |
| 170 | |
| 171 | struct msm_gpu_perfcntr { |
| 172 | uint32_t select_reg; |
| 173 | uint32_t sample_reg; |
| 174 | uint32_t select_val; |
| 175 | const char *name; |
| 176 | }; |
| 177 | |
Jordan Crouse | f7de154 | 2017-10-20 11:06:55 -0600 | [diff] [blame] | 178 | struct msm_gpu_submitqueue { |
| 179 | int id; |
| 180 | u32 flags; |
| 181 | u32 prio; |
| 182 | int faults; |
| 183 | struct list_head node; |
| 184 | struct kref ref; |
| 185 | }; |
| 186 | |
Jordan Crouse | cdb9593 | 2018-07-24 10:33:31 -0600 | [diff] [blame] | 187 | struct msm_gpu_state_bo { |
| 188 | u64 iova; |
| 189 | size_t size; |
| 190 | void *data; |
Sharat Masetty | 1df4289 | 2018-11-01 20:16:45 +0530 | [diff] [blame] | 191 | bool encoded; |
Jordan Crouse | cdb9593 | 2018-07-24 10:33:31 -0600 | [diff] [blame] | 192 | }; |
| 193 | |
Jordan Crouse | e00e473 | 2018-07-24 10:33:24 -0600 | [diff] [blame] | 194 | struct msm_gpu_state { |
Jordan Crouse | c0fec7f | 2018-07-24 10:33:27 -0600 | [diff] [blame] | 195 | struct kref ref; |
Arnd Bergmann | 3530a17 | 2018-07-26 14:39:25 +0200 | [diff] [blame] | 196 | struct timespec64 time; |
Jordan Crouse | e00e473 | 2018-07-24 10:33:24 -0600 | [diff] [blame] | 197 | |
| 198 | struct { |
| 199 | u64 iova; |
| 200 | u32 fence; |
| 201 | u32 seqno; |
| 202 | u32 rptr; |
| 203 | u32 wptr; |
Jordan Crouse | 43a5668 | 2018-07-24 10:33:29 -0600 | [diff] [blame] | 204 | void *data; |
| 205 | int data_size; |
Sharat Masetty | 1df4289 | 2018-11-01 20:16:45 +0530 | [diff] [blame] | 206 | bool encoded; |
Jordan Crouse | e00e473 | 2018-07-24 10:33:24 -0600 | [diff] [blame] | 207 | } ring[MSM_GPU_MAX_RINGS]; |
| 208 | |
| 209 | int nr_registers; |
| 210 | u32 *registers; |
| 211 | |
| 212 | u32 rbbm_status; |
Jordan Crouse | c0fec7f | 2018-07-24 10:33:27 -0600 | [diff] [blame] | 213 | |
| 214 | char *comm; |
| 215 | char *cmd; |
Jordan Crouse | cdb9593 | 2018-07-24 10:33:31 -0600 | [diff] [blame] | 216 | |
| 217 | int nr_bos; |
| 218 | struct msm_gpu_state_bo *bos; |
Jordan Crouse | e00e473 | 2018-07-24 10:33:24 -0600 | [diff] [blame] | 219 | }; |
| 220 | |
Rob Clark | 7198e6b | 2013-07-19 12:59:32 -0400 | [diff] [blame] | 221 | static inline void gpu_write(struct msm_gpu *gpu, u32 reg, u32 data) |
| 222 | { |
| 223 | msm_writel(data, gpu->mmio + (reg << 2)); |
| 224 | } |
| 225 | |
| 226 | static inline u32 gpu_read(struct msm_gpu *gpu, u32 reg) |
| 227 | { |
| 228 | return msm_readl(gpu->mmio + (reg << 2)); |
| 229 | } |
| 230 | |
Jordan Crouse | ae53a82 | 2016-11-28 12:28:28 -0700 | [diff] [blame] | 231 | static inline void gpu_rmw(struct msm_gpu *gpu, u32 reg, u32 mask, u32 or) |
| 232 | { |
| 233 | uint32_t val = gpu_read(gpu, reg); |
| 234 | |
| 235 | val &= ~mask; |
| 236 | gpu_write(gpu, reg, val | or); |
| 237 | } |
| 238 | |
| 239 | static inline u64 gpu_read64(struct msm_gpu *gpu, u32 lo, u32 hi) |
| 240 | { |
| 241 | u64 val; |
| 242 | |
| 243 | /* |
| 244 | * Why not a readq here? Two reasons: 1) many of the LO registers are |
| 245 | * not quad word aligned and 2) the GPU hardware designers have a bit |
| 246 | * of a history of putting registers where they fit, especially in |
| 247 | * spins. The longer a GPU family goes the higher the chance that |
| 248 | * we'll get burned. We could do a series of validity checks if we |
| 249 | * wanted to, but really is a readq() that much better? Nah. |
| 250 | */ |
| 251 | |
| 252 | /* |
| 253 | * For some lo/hi registers (like perfcounters), the hi value is latched |
| 254 | * when the lo is read, so make sure to read the lo first to trigger |
| 255 | * that |
| 256 | */ |
| 257 | val = (u64) msm_readl(gpu->mmio + (lo << 2)); |
| 258 | val |= ((u64) msm_readl(gpu->mmio + (hi << 2)) << 32); |
| 259 | |
| 260 | return val; |
| 261 | } |
| 262 | |
| 263 | static inline void gpu_write64(struct msm_gpu *gpu, u32 lo, u32 hi, u64 val) |
| 264 | { |
| 265 | /* Why not a writeq here? Read the screed above */ |
| 266 | msm_writel(lower_32_bits(val), gpu->mmio + (lo << 2)); |
| 267 | msm_writel(upper_32_bits(val), gpu->mmio + (hi << 2)); |
| 268 | } |
| 269 | |
Rob Clark | 7198e6b | 2013-07-19 12:59:32 -0400 | [diff] [blame] | 270 | int msm_gpu_pm_suspend(struct msm_gpu *gpu); |
| 271 | int msm_gpu_pm_resume(struct msm_gpu *gpu); |
Sharat Masetty | de0a3d09 | 2018-10-04 15:11:42 +0530 | [diff] [blame] | 272 | void msm_gpu_resume_devfreq(struct msm_gpu *gpu); |
Rob Clark | 7198e6b | 2013-07-19 12:59:32 -0400 | [diff] [blame] | 273 | |
Rob Clark | eeb7547 | 2017-02-10 15:36:33 -0500 | [diff] [blame] | 274 | int msm_gpu_hw_init(struct msm_gpu *gpu); |
| 275 | |
Rob Clark | 70c70f0 | 2014-05-30 14:49:43 -0400 | [diff] [blame] | 276 | void msm_gpu_perfcntr_start(struct msm_gpu *gpu); |
| 277 | void msm_gpu_perfcntr_stop(struct msm_gpu *gpu); |
| 278 | int msm_gpu_perfcntr_sample(struct msm_gpu *gpu, uint32_t *activetime, |
| 279 | uint32_t *totaltime, uint32_t ncntrs, uint32_t *cntrs); |
| 280 | |
Rob Clark | 7198e6b | 2013-07-19 12:59:32 -0400 | [diff] [blame] | 281 | void msm_gpu_retire(struct msm_gpu *gpu); |
Rob Clark | f44d32c | 2016-06-16 16:37:38 -0400 | [diff] [blame] | 282 | void msm_gpu_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit, |
Rob Clark | 7198e6b | 2013-07-19 12:59:32 -0400 | [diff] [blame] | 283 | struct msm_file_private *ctx); |
| 284 | |
| 285 | int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev, |
| 286 | struct msm_gpu *gpu, const struct msm_gpu_funcs *funcs, |
Jordan Crouse | 5770fc7 | 2017-05-08 14:35:03 -0600 | [diff] [blame] | 287 | const char *name, struct msm_gpu_config *config); |
| 288 | |
Rob Clark | 7198e6b | 2013-07-19 12:59:32 -0400 | [diff] [blame] | 289 | void msm_gpu_cleanup(struct msm_gpu *gpu); |
| 290 | |
Rob Clark | e2550b7 | 2014-09-05 13:30:27 -0400 | [diff] [blame] | 291 | struct msm_gpu *adreno_load_gpu(struct drm_device *dev); |
Rob Clark | bfd28b1 | 2014-09-05 13:06:37 -0400 | [diff] [blame] | 292 | void __init adreno_register(void); |
| 293 | void __exit adreno_unregister(void); |
Rob Clark | 7198e6b | 2013-07-19 12:59:32 -0400 | [diff] [blame] | 294 | |
Jordan Crouse | f7de154 | 2017-10-20 11:06:55 -0600 | [diff] [blame] | 295 | static inline void msm_submitqueue_put(struct msm_gpu_submitqueue *queue) |
| 296 | { |
| 297 | if (queue) |
| 298 | kref_put(&queue->ref, msm_submitqueue_destroy); |
| 299 | } |
| 300 | |
Jordan Crouse | c0fec7f | 2018-07-24 10:33:27 -0600 | [diff] [blame] | 301 | static inline struct msm_gpu_state *msm_gpu_crashstate_get(struct msm_gpu *gpu) |
| 302 | { |
| 303 | struct msm_gpu_state *state = NULL; |
| 304 | |
| 305 | mutex_lock(&gpu->dev->struct_mutex); |
| 306 | |
| 307 | if (gpu->crashstate) { |
| 308 | kref_get(&gpu->crashstate->ref); |
| 309 | state = gpu->crashstate; |
| 310 | } |
| 311 | |
| 312 | mutex_unlock(&gpu->dev->struct_mutex); |
| 313 | |
| 314 | return state; |
| 315 | } |
| 316 | |
| 317 | static inline void msm_gpu_crashstate_put(struct msm_gpu *gpu) |
| 318 | { |
| 319 | mutex_lock(&gpu->dev->struct_mutex); |
| 320 | |
| 321 | if (gpu->crashstate) { |
| 322 | if (gpu->funcs->gpu_state_put(gpu->crashstate)) |
| 323 | gpu->crashstate = NULL; |
| 324 | } |
| 325 | |
| 326 | mutex_unlock(&gpu->dev->struct_mutex); |
| 327 | } |
| 328 | |
Rob Clark | 7198e6b | 2013-07-19 12:59:32 -0400 | [diff] [blame] | 329 | #endif /* __MSM_GPU_H__ */ |