mali_kbase_instr.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. *
  3. * (C) COPYRIGHT 2014-2015 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. /*
  16. * Instrumentation API definitions
  17. */
  18. #ifndef _KBASE_INSTR_H_
  19. #define _KBASE_INSTR_H_
  20. #include <mali_kbase_hwaccess_instr.h>
  21. /**
  22. * kbase_instr_hwcnt_enable() - Enable HW counters collection
  23. * @kctx: Kbase context
  24. * @setup: &struct kbase_uk_hwcnt_setup containing configuration
  25. *
  26. * Return: 0 on success
  27. */
  28. int kbase_instr_hwcnt_enable(struct kbase_context *kctx,
  29. struct kbase_uk_hwcnt_setup *setup);
  30. /**
  31. * kbase_instr_hwcnt_disable() - Disable HW counters collection
  32. * @kctx: Kbase context
  33. *
  34. * Return: 0 on success
  35. */
  36. int kbase_instr_hwcnt_disable(struct kbase_context *kctx);
  37. /**
  38. * kbase_instr_hwcnt_dump() - Trigger dump of HW counters and wait for
  39. * completion
  40. * @kctx: Kbase context
  41. *
  42. * Context: might sleep, waiting for dump to complete
  43. *
  44. * Return: 0 on success
  45. */
  46. int kbase_instr_hwcnt_dump(struct kbase_context *kctx);
  47. /**
  48. * kbase_instr_hwcnt_suspend() - GPU is suspending, stop HW counter collection
  49. * @kbdev: Kbase device
  50. *
  51. * It's assumed that there's only one privileged context.
  52. *
  53. * Safe to do this without lock when doing an OS suspend, because it only
  54. * changes in response to user-space IOCTLs
  55. */
  56. void kbase_instr_hwcnt_suspend(struct kbase_device *kbdev);
  57. /**
  58. * kbase_instr_hwcnt_resume() - GPU is resuming, resume HW counter collection
  59. * @kbdev: Kbase device
  60. */
  61. void kbase_instr_hwcnt_resume(struct kbase_device *kbdev);
  62. #endif // ifndef _KBASE_INSTR_H_