mali_kbase.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535
  1. /*
  2. *
  3. * (C) COPYRIGHT 2010-2016 ARM Limited. All rights reserved.
  4. *
  5. * This program is free software and is provided to you under the terms of the
  6. * GNU General Public License version 2 as published by the Free Software
  7. * Foundation, and any use by you of this program is subject to the terms
  8. * of such GNU licence.
  9. *
  10. * A copy of the licence is included with the program, and can also be obtained
  11. * from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  12. * Boston, MA 02110-1301, USA.
  13. *
  14. */
  15. #ifndef _KBASE_H_
  16. #define _KBASE_H_
  17. #include <mali_malisw.h>
  18. #include <mali_kbase_debug.h>
  19. #include <asm/page.h>
  20. #include <linux/atomic.h>
  21. #include <linux/highmem.h>
  22. #include <linux/hrtimer.h>
  23. #include <linux/ktime.h>
  24. #include <linux/list.h>
  25. #include <linux/mm_types.h>
  26. #include <linux/mutex.h>
  27. #include <linux/rwsem.h>
  28. #include <linux/sched.h>
  29. #include <linux/slab.h>
  30. #include <linux/spinlock.h>
  31. #include <linux/vmalloc.h>
  32. #include <linux/wait.h>
  33. #include <linux/workqueue.h>
  34. #include "mali_base_kernel.h"
  35. #include <mali_kbase_uku.h>
  36. #include <mali_kbase_linux.h>
  37. #include "mali_kbase_pm.h"
  38. #include "mali_kbase_mem_lowlevel.h"
  39. #include "mali_kbase_defs.h"
  40. #include "mali_kbase_trace_timeline.h"
  41. #include "mali_kbase_js.h"
  42. #include "mali_kbase_mem.h"
  43. #include "mali_kbase_utility.h"
  44. #include "mali_kbase_gpuprops.h"
  45. #include "mali_kbase_jm.h"
  46. #include "mali_kbase_vinstr.h"
  47. #include "mali_kbase_ipa.h"
  48. #ifdef CONFIG_GPU_TRACEPOINTS
  49. #include <trace/events/gpu.h>
  50. #endif
  51. /**
  52. * @page page_base_kernel_main Kernel-side Base (KBase) APIs
  53. *
  54. * The Kernel-side Base (KBase) APIs are divided up as follows:
  55. * - @subpage page_kbase_js_policy
  56. */
  57. /**
  58. * @defgroup base_kbase_api Kernel-side Base (KBase) APIs
  59. */
  60. struct kbase_device *kbase_device_alloc(void);
  61. /*
  62. * note: configuration attributes member of kbdev needs to have
  63. * been setup before calling kbase_device_init
  64. */
  65. /*
  66. * API to acquire device list semaphore and return pointer
  67. * to the device list head
  68. */
  69. const struct list_head *kbase_dev_list_get(void);
  70. /* API to release the device list semaphore */
  71. void kbase_dev_list_put(const struct list_head *dev_list);
  72. int kbase_device_init(struct kbase_device * const kbdev);
  73. void kbase_device_term(struct kbase_device *kbdev);
  74. void kbase_device_free(struct kbase_device *kbdev);
  75. int kbase_device_has_feature(struct kbase_device *kbdev, u32 feature);
  76. /* Needed for gator integration and for reporting vsync information */
  77. struct kbase_device *kbase_find_device(int minor);
  78. void kbase_release_device(struct kbase_device *kbdev);
  79. void kbase_set_profiling_control(struct kbase_device *kbdev, u32 control, u32 value);
  80. u32 kbase_get_profiling_control(struct kbase_device *kbdev, u32 control);
  81. struct kbase_context *
  82. kbase_create_context(struct kbase_device *kbdev, bool is_compat);
  83. void kbase_destroy_context(struct kbase_context *kctx);
  84. int kbase_context_set_create_flags(struct kbase_context *kctx, u32 flags);
  85. int kbase_jd_init(struct kbase_context *kctx);
  86. void kbase_jd_exit(struct kbase_context *kctx);
  87. int kbase_jd_submit(struct kbase_context *kctx,
  88. const struct kbase_uk_job_submit *submit_data);
  89. /**
  90. * kbase_jd_done_worker - Handle a job completion
  91. * @data: a &struct work_struct
  92. *
  93. * This function requeues the job from the runpool (if it was soft-stopped or
  94. * removed from NEXT registers).
  95. *
  96. * Removes it from the system if it finished/failed/was cancelled.
  97. *
  98. * Resolves dependencies to add dependent jobs to the context, potentially
  99. * starting them if necessary (which may add more references to the context)
  100. *
  101. * Releases the reference to the context from the no-longer-running job.
  102. *
  103. * Handles retrying submission outside of IRQ context if it failed from within
  104. * IRQ context.
  105. */
  106. void kbase_jd_done_worker(struct work_struct *data);
  107. void kbase_jd_done(struct kbase_jd_atom *katom, int slot_nr, ktime_t *end_timestamp,
  108. kbasep_js_atom_done_code done_code);
  109. void kbase_jd_cancel(struct kbase_device *kbdev, struct kbase_jd_atom *katom);
  110. void kbase_jd_zap_context(struct kbase_context *kctx);
  111. bool jd_done_nolock(struct kbase_jd_atom *katom,
  112. struct list_head *completed_jobs_ctx);
  113. void kbase_jd_free_external_resources(struct kbase_jd_atom *katom);
  114. bool jd_submit_atom(struct kbase_context *kctx,
  115. const struct base_jd_atom_v2 *user_atom,
  116. struct kbase_jd_atom *katom);
  117. void kbase_jd_dep_clear_locked(struct kbase_jd_atom *katom);
  118. void kbase_job_done(struct kbase_device *kbdev, u32 done);
  119. void kbase_gpu_cacheclean(struct kbase_device *kbdev,
  120. struct kbase_jd_atom *katom);
  121. /**
  122. * kbase_job_slot_ctx_priority_check_locked(): - Check for lower priority atoms
  123. * and soft stop them
  124. * @kctx: Pointer to context to check.
  125. * @katom: Pointer to priority atom.
  126. *
  127. * Atoms from @kctx on the same job slot as @katom, which have lower priority
  128. * than @katom will be soft stopped and put back in the queue, so that atoms
  129. * with higher priority can run.
  130. *
  131. * The js_data.runpool_irq.lock must be held when calling this function.
  132. */
  133. void kbase_job_slot_ctx_priority_check_locked(struct kbase_context *kctx,
  134. struct kbase_jd_atom *katom);
  135. void kbase_job_slot_softstop(struct kbase_device *kbdev, int js,
  136. struct kbase_jd_atom *target_katom);
  137. void kbase_job_slot_softstop_swflags(struct kbase_device *kbdev, int js,
  138. struct kbase_jd_atom *target_katom, u32 sw_flags);
  139. void kbase_job_slot_hardstop(struct kbase_context *kctx, int js,
  140. struct kbase_jd_atom *target_katom);
  141. void kbase_job_check_enter_disjoint(struct kbase_device *kbdev, u32 action,
  142. u16 core_reqs, struct kbase_jd_atom *target_katom);
  143. void kbase_job_check_leave_disjoint(struct kbase_device *kbdev,
  144. struct kbase_jd_atom *target_katom);
  145. void kbase_event_post(struct kbase_context *ctx, struct kbase_jd_atom *event);
  146. int kbase_event_dequeue(struct kbase_context *ctx, struct base_jd_event_v2 *uevent);
  147. int kbase_event_pending(struct kbase_context *ctx);
  148. int kbase_event_init(struct kbase_context *kctx);
  149. void kbase_event_close(struct kbase_context *kctx);
  150. void kbase_event_cleanup(struct kbase_context *kctx);
  151. void kbase_event_wakeup(struct kbase_context *kctx);
  152. int kbase_process_soft_job(struct kbase_jd_atom *katom);
  153. int kbase_prepare_soft_job(struct kbase_jd_atom *katom);
  154. void kbase_finish_soft_job(struct kbase_jd_atom *katom);
  155. void kbase_cancel_soft_job(struct kbase_jd_atom *katom);
  156. void kbase_resume_suspended_soft_jobs(struct kbase_device *kbdev);
  157. void kbasep_add_waiting_soft_job(struct kbase_jd_atom *katom);
  158. bool kbase_replay_process(struct kbase_jd_atom *katom);
  159. enum hrtimer_restart kbasep_soft_event_timeout_worker(struct hrtimer *timer);
  160. void kbasep_complete_triggered_soft_events(struct kbase_context *kctx, u64 evt);
  161. int kbasep_read_soft_event_status(
  162. struct kbase_context *kctx, u64 evt, unsigned char *status);
  163. int kbasep_write_soft_event_status(
  164. struct kbase_context *kctx, u64 evt, unsigned char new_status);
  165. /* api used internally for register access. Contains validation and tracing */
  166. void kbase_device_trace_register_access(struct kbase_context *kctx, enum kbase_reg_access_type type, u16 reg_offset, u32 reg_value);
  167. int kbase_device_trace_buffer_install(
  168. struct kbase_context *kctx, u32 *tb, size_t size);
  169. void kbase_device_trace_buffer_uninstall(struct kbase_context *kctx);
  170. /* api to be ported per OS, only need to do the raw register access */
  171. void kbase_os_reg_write(struct kbase_device *kbdev, u16 offset, u32 value);
  172. u32 kbase_os_reg_read(struct kbase_device *kbdev, u16 offset);
  173. void kbasep_as_do_poke(struct work_struct *work);
  174. /** Returns the name associated with a Mali exception code
  175. *
  176. * This function is called from the interrupt handler when a GPU fault occurs.
  177. * It reports the details of the fault using KBASE_DEBUG_PRINT_WARN.
  178. *
  179. * @param[in] kbdev The kbase device that the GPU fault occurred from.
  180. * @param[in] exception_code exception code
  181. * @return name associated with the exception code
  182. */
  183. const char *kbase_exception_name(struct kbase_device *kbdev,
  184. u32 exception_code);
  185. /**
  186. * Check whether a system suspend is in progress, or has already been suspended
  187. *
  188. * The caller should ensure that either kbdev->pm.active_count_lock is held, or
  189. * a dmb was executed recently (to ensure the value is most
  190. * up-to-date). However, without a lock the value could change afterwards.
  191. *
  192. * @return false if a suspend is not in progress
  193. * @return !=false otherwise
  194. */
  195. static inline bool kbase_pm_is_suspending(struct kbase_device *kbdev)
  196. {
  197. return kbdev->pm.suspending;
  198. }
  199. /**
  200. * Return the atom's ID, as was originally supplied by userspace in
  201. * base_jd_atom_v2::atom_number
  202. */
  203. static inline int kbase_jd_atom_id(struct kbase_context *kctx, struct kbase_jd_atom *katom)
  204. {
  205. int result;
  206. KBASE_DEBUG_ASSERT(kctx);
  207. KBASE_DEBUG_ASSERT(katom);
  208. KBASE_DEBUG_ASSERT(katom->kctx == kctx);
  209. result = katom - &kctx->jctx.atoms[0];
  210. KBASE_DEBUG_ASSERT(result >= 0 && result <= BASE_JD_ATOM_COUNT);
  211. return result;
  212. }
  213. /**
  214. * kbase_jd_atom_from_id - Return the atom structure for the given atom ID
  215. * @kctx: Context pointer
  216. * @id: ID of atom to retrieve
  217. *
  218. * Return: Pointer to struct kbase_jd_atom associated with the supplied ID
  219. */
  220. static inline struct kbase_jd_atom *kbase_jd_atom_from_id(
  221. struct kbase_context *kctx, int id)
  222. {
  223. return &kctx->jctx.atoms[id];
  224. }
  225. /**
  226. * Initialize the disjoint state
  227. *
  228. * The disjoint event count and state are both set to zero.
  229. *
  230. * Disjoint functions usage:
  231. *
  232. * The disjoint event count should be incremented whenever a disjoint event occurs.
  233. *
  234. * There are several cases which are regarded as disjoint behavior. Rather than just increment
  235. * the counter during disjoint events we also increment the counter when jobs may be affected
  236. * by what the GPU is currently doing. To facilitate this we have the concept of disjoint state.
  237. *
  238. * Disjoint state is entered during GPU reset and for the entire time that an atom is replaying
  239. * (as part of the replay workaround). Increasing the disjoint state also increases the count of
  240. * disjoint events.
  241. *
  242. * The disjoint state is then used to increase the count of disjoint events during job submission
  243. * and job completion. Any atom submitted or completed while the disjoint state is greater than
  244. * zero is regarded as a disjoint event.
  245. *
  246. * The disjoint event counter is also incremented immediately whenever a job is soft stopped
  247. * and during context creation.
  248. *
  249. * @param kbdev The kbase device
  250. */
  251. void kbase_disjoint_init(struct kbase_device *kbdev);
  252. /**
  253. * Increase the count of disjoint events
  254. * called when a disjoint event has happened
  255. *
  256. * @param kbdev The kbase device
  257. */
  258. void kbase_disjoint_event(struct kbase_device *kbdev);
  259. /**
  260. * Increase the count of disjoint events only if the GPU is in a disjoint state
  261. *
  262. * This should be called when something happens which could be disjoint if the GPU
  263. * is in a disjoint state. The state refcount keeps track of this.
  264. *
  265. * @param kbdev The kbase device
  266. */
  267. void kbase_disjoint_event_potential(struct kbase_device *kbdev);
  268. /**
  269. * Returns the count of disjoint events
  270. *
  271. * @param kbdev The kbase device
  272. * @return the count of disjoint events
  273. */
  274. u32 kbase_disjoint_event_get(struct kbase_device *kbdev);
  275. /**
  276. * Increment the refcount state indicating that the GPU is in a disjoint state.
  277. *
  278. * Also Increment the disjoint event count (calls @ref kbase_disjoint_event)
  279. * eventually after the disjoint state has completed @ref kbase_disjoint_state_down
  280. * should be called
  281. *
  282. * @param kbdev The kbase device
  283. */
  284. void kbase_disjoint_state_up(struct kbase_device *kbdev);
  285. /**
  286. * Decrement the refcount state
  287. *
  288. * Also Increment the disjoint event count (calls @ref kbase_disjoint_event)
  289. *
  290. * Called after @ref kbase_disjoint_state_up once the disjoint state is over
  291. *
  292. * @param kbdev The kbase device
  293. */
  294. void kbase_disjoint_state_down(struct kbase_device *kbdev);
  295. /**
  296. * If a job is soft stopped and the number of contexts is >= this value
  297. * it is reported as a disjoint event
  298. */
  299. #define KBASE_DISJOINT_STATE_INTERLEAVED_CONTEXT_COUNT_THRESHOLD 2
  300. #ifndef UINT64_MAX
  301. #define UINT64_MAX ((uint64_t)0xFFFFFFFFFFFFFFFFULL)
  302. #endif
  303. #if KBASE_TRACE_ENABLE
  304. void kbasep_trace_debugfs_init(struct kbase_device *kbdev);
  305. #ifndef CONFIG_MALI_SYSTEM_TRACE
  306. /** Add trace values about a job-slot
  307. *
  308. * @note Any functions called through this macro will still be evaluated in
  309. * Release builds (CONFIG_MALI_DEBUG not defined). Therefore, when KBASE_TRACE_ENABLE == 0 any
  310. * functions called to get the parameters supplied to this macro must:
  311. * - be static or static inline
  312. * - must just return 0 and have no other statements present in the body.
  313. */
  314. #define KBASE_TRACE_ADD_SLOT(kbdev, code, ctx, katom, gpu_addr, jobslot) \
  315. kbasep_trace_add(kbdev, KBASE_TRACE_CODE(code), ctx, katom, gpu_addr, \
  316. KBASE_TRACE_FLAG_JOBSLOT, 0, jobslot, 0)
  317. /** Add trace values about a job-slot, with info
  318. *
  319. * @note Any functions called through this macro will still be evaluated in
  320. * Release builds (CONFIG_MALI_DEBUG not defined). Therefore, when KBASE_TRACE_ENABLE == 0 any
  321. * functions called to get the parameters supplied to this macro must:
  322. * - be static or static inline
  323. * - must just return 0 and have no other statements present in the body.
  324. */
  325. #define KBASE_TRACE_ADD_SLOT_INFO(kbdev, code, ctx, katom, gpu_addr, jobslot, info_val) \
  326. kbasep_trace_add(kbdev, KBASE_TRACE_CODE(code), ctx, katom, gpu_addr, \
  327. KBASE_TRACE_FLAG_JOBSLOT, 0, jobslot, info_val)
  328. /** Add trace values about a ctx refcount
  329. *
  330. * @note Any functions called through this macro will still be evaluated in
  331. * Release builds (CONFIG_MALI_DEBUG not defined). Therefore, when KBASE_TRACE_ENABLE == 0 any
  332. * functions called to get the parameters supplied to this macro must:
  333. * - be static or static inline
  334. * - must just return 0 and have no other statements present in the body.
  335. */
  336. #define KBASE_TRACE_ADD_REFCOUNT(kbdev, code, ctx, katom, gpu_addr, refcount) \
  337. kbasep_trace_add(kbdev, KBASE_TRACE_CODE(code), ctx, katom, gpu_addr, \
  338. KBASE_TRACE_FLAG_REFCOUNT, refcount, 0, 0)
  339. /** Add trace values about a ctx refcount, and info
  340. *
  341. * @note Any functions called through this macro will still be evaluated in
  342. * Release builds (CONFIG_MALI_DEBUG not defined). Therefore, when KBASE_TRACE_ENABLE == 0 any
  343. * functions called to get the parameters supplied to this macro must:
  344. * - be static or static inline
  345. * - must just return 0 and have no other statements present in the body.
  346. */
  347. #define KBASE_TRACE_ADD_REFCOUNT_INFO(kbdev, code, ctx, katom, gpu_addr, refcount, info_val) \
  348. kbasep_trace_add(kbdev, KBASE_TRACE_CODE(code), ctx, katom, gpu_addr, \
  349. KBASE_TRACE_FLAG_REFCOUNT, refcount, 0, info_val)
  350. /** Add trace values (no slot or refcount)
  351. *
  352. * @note Any functions called through this macro will still be evaluated in
  353. * Release builds (CONFIG_MALI_DEBUG not defined). Therefore, when KBASE_TRACE_ENABLE == 0 any
  354. * functions called to get the parameters supplied to this macro must:
  355. * - be static or static inline
  356. * - must just return 0 and have no other statements present in the body.
  357. */
  358. #define KBASE_TRACE_ADD(kbdev, code, ctx, katom, gpu_addr, info_val) \
  359. kbasep_trace_add(kbdev, KBASE_TRACE_CODE(code), ctx, katom, gpu_addr, \
  360. 0, 0, 0, info_val)
  361. /** Clear the trace */
  362. #define KBASE_TRACE_CLEAR(kbdev) \
  363. kbasep_trace_clear(kbdev)
  364. /** Dump the slot trace */
  365. #define KBASE_TRACE_DUMP(kbdev) \
  366. kbasep_trace_dump(kbdev)
  367. /** PRIVATE - do not use directly. Use KBASE_TRACE_ADD() instead */
  368. void kbasep_trace_add(struct kbase_device *kbdev, enum kbase_trace_code code, void *ctx, struct kbase_jd_atom *katom, u64 gpu_addr, u8 flags, int refcount, int jobslot, unsigned long info_val);
  369. /** PRIVATE - do not use directly. Use KBASE_TRACE_CLEAR() instead */
  370. void kbasep_trace_clear(struct kbase_device *kbdev);
  371. #else // ifndef CONFIG_MALI_SYSTEM_TRACE
  372. /* Dispatch kbase trace events as system trace events */
  373. #include <mali_linux_kbase_trace.h>
  374. #define KBASE_TRACE_ADD_SLOT(kbdev, code, ctx, katom, gpu_addr, jobslot)\
  375. trace_mali_##code(jobslot, 0)
  376. #define KBASE_TRACE_ADD_SLOT_INFO(kbdev, code, ctx, katom, gpu_addr, jobslot, info_val)\
  377. trace_mali_##code(jobslot, info_val)
  378. #define KBASE_TRACE_ADD_REFCOUNT(kbdev, code, ctx, katom, gpu_addr, refcount)\
  379. trace_mali_##code(refcount, 0)
  380. #define KBASE_TRACE_ADD_REFCOUNT_INFO(kbdev, code, ctx, katom, gpu_addr, refcount, info_val)\
  381. trace_mali_##code(refcount, info_val)
  382. #define KBASE_TRACE_ADD(kbdev, code, ctx, katom, gpu_addr, info_val)\
  383. trace_mali_##code(gpu_addr, info_val)
  384. #define KBASE_TRACE_CLEAR(kbdev)\
  385. do {\
  386. CSTD_UNUSED(kbdev);\
  387. CSTD_NOP(0);\
  388. } while (0)
  389. #define KBASE_TRACE_DUMP(kbdev)\
  390. do {\
  391. CSTD_UNUSED(kbdev);\
  392. CSTD_NOP(0);\
  393. } while (0)
  394. #endif // ifndef CONFIG_MALI_SYSTEM_TRACE
  395. #else // KBASE_TRACE_ENABLE
  396. #define KBASE_TRACE_ADD_SLOT(kbdev, code, ctx, katom, gpu_addr, jobslot)\
  397. do {\
  398. CSTD_UNUSED(kbdev);\
  399. CSTD_NOP(code);\
  400. CSTD_UNUSED(ctx);\
  401. CSTD_UNUSED(katom);\
  402. CSTD_UNUSED(gpu_addr);\
  403. CSTD_UNUSED(jobslot);\
  404. } while (0)
  405. #define KBASE_TRACE_ADD_SLOT_INFO(kbdev, code, ctx, katom, gpu_addr, jobslot, info_val)\
  406. do {\
  407. CSTD_UNUSED(kbdev);\
  408. CSTD_NOP(code);\
  409. CSTD_UNUSED(ctx);\
  410. CSTD_UNUSED(katom);\
  411. CSTD_UNUSED(gpu_addr);\
  412. CSTD_UNUSED(jobslot);\
  413. CSTD_UNUSED(info_val);\
  414. CSTD_NOP(0);\
  415. } while (0)
  416. #define KBASE_TRACE_ADD_REFCOUNT(kbdev, code, ctx, katom, gpu_addr, refcount)\
  417. do {\
  418. CSTD_UNUSED(kbdev);\
  419. CSTD_NOP(code);\
  420. CSTD_UNUSED(ctx);\
  421. CSTD_UNUSED(katom);\
  422. CSTD_UNUSED(gpu_addr);\
  423. CSTD_UNUSED(refcount);\
  424. CSTD_NOP(0);\
  425. } while (0)
  426. #define KBASE_TRACE_ADD_REFCOUNT_INFO(kbdev, code, ctx, katom, gpu_addr, refcount, info_val)\
  427. do {\
  428. CSTD_UNUSED(kbdev);\
  429. CSTD_NOP(code);\
  430. CSTD_UNUSED(ctx);\
  431. CSTD_UNUSED(katom);\
  432. CSTD_UNUSED(gpu_addr);\
  433. CSTD_UNUSED(info_val);\
  434. CSTD_NOP(0);\
  435. } while (0)
  436. #define KBASE_TRACE_ADD(kbdev, code, subcode, ctx, katom, val)\
  437. do {\
  438. CSTD_UNUSED(kbdev);\
  439. CSTD_NOP(code);\
  440. CSTD_UNUSED(subcode);\
  441. CSTD_UNUSED(ctx);\
  442. CSTD_UNUSED(katom);\
  443. CSTD_UNUSED(val);\
  444. CSTD_NOP(0);\
  445. } while (0)
  446. #define KBASE_TRACE_CLEAR(kbdev)\
  447. do {\
  448. CSTD_UNUSED(kbdev);\
  449. CSTD_NOP(0);\
  450. } while (0)
  451. #define KBASE_TRACE_DUMP(kbdev)\
  452. do {\
  453. CSTD_UNUSED(kbdev);\
  454. CSTD_NOP(0);\
  455. } while (0)
  456. #endif // KBASE_TRACE_ENABLE
  457. /** PRIVATE - do not use directly. Use KBASE_TRACE_DUMP() instead */
  458. void kbasep_trace_dump(struct kbase_device *kbdev);
  459. #ifdef CONFIG_MALI_DEBUG
  460. /**
  461. * kbase_set_driver_inactive - Force driver to go inactive
  462. * @kbdev: Device pointer
  463. * @inactive: true if driver should go inactive, false otherwise
  464. *
  465. * Forcing the driver inactive will cause all future IOCTLs to wait until the
  466. * driver is made active again. This is intended solely for the use of tests
  467. * which require that no jobs are running while the test executes.
  468. */
  469. void kbase_set_driver_inactive(struct kbase_device *kbdev, bool inactive);
  470. #endif // ifdef CONFIG_MALI_DEBUG
  471. #endif // ifndef _KBASE_H_