mali_kbase_pm_ca.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. *
  3. * (C) COPYRIGHT 2011-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. * Base kernel core availability APIs
  17. */
  18. #ifndef _KBASE_PM_CA_H_
  19. #define _KBASE_PM_CA_H_
  20. /**
  21. * kbase_pm_ca_init - Initialize core availability framework
  22. *
  23. * Must be called before calling any other core availability function
  24. *
  25. * @kbdev: The kbase device structure for the device (must be a valid pointer)
  26. *
  27. * Return: 0 if the core availability framework was successfully initialized,
  28. * -errno otherwise
  29. */
  30. int kbase_pm_ca_init(struct kbase_device *kbdev);
  31. /**
  32. * kbase_pm_ca_term - Terminate core availability framework
  33. *
  34. * @kbdev: The kbase device structure for the device (must be a valid pointer)
  35. */
  36. void kbase_pm_ca_term(struct kbase_device *kbdev);
  37. /**
  38. * kbase_pm_ca_get_core_mask - Get currently available shaders core mask
  39. *
  40. * @kbdev: The kbase device structure for the device (must be a valid pointer)
  41. *
  42. * Returns a mask of the currently available shader cores.
  43. * Calls into the core availability policy
  44. *
  45. * Return: The bit mask of available cores
  46. */
  47. u64 kbase_pm_ca_get_core_mask(struct kbase_device *kbdev);
  48. /**
  49. * kbase_pm_ca_update_core_status - Update core status
  50. *
  51. * @kbdev: The kbase device structure for the device (must be
  52. * a valid pointer)
  53. * @cores_ready: The bit mask of cores ready for job submission
  54. * @cores_transitioning: The bit mask of cores that are transitioning power
  55. * state
  56. *
  57. * Update core availability policy with current core power status
  58. *
  59. * Calls into the core availability policy
  60. */
  61. void kbase_pm_ca_update_core_status(struct kbase_device *kbdev, u64 cores_ready,
  62. u64 cores_transitioning);
  63. /**
  64. * kbase_pm_ca_instr_enable - Enable override for instrumentation
  65. *
  66. * @kbdev: The kbase device structure for the device (must be a valid pointer)
  67. *
  68. * This overrides the output of the core availability policy, ensuring that all
  69. * cores are available
  70. */
  71. void kbase_pm_ca_instr_enable(struct kbase_device *kbdev);
  72. /**
  73. * kbase_pm_ca_instr_disable - Disable override for instrumentation
  74. *
  75. * @kbdev: The kbase device structure for the device (must be a valid pointer)
  76. *
  77. * This disables any previously enabled override, and resumes normal policy
  78. * functionality
  79. */
  80. void kbase_pm_ca_instr_disable(struct kbase_device *kbdev);
  81. #endif // ifndef _KBASE_PM_CA_H_