mali_kernel_utilization.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * This confidential and proprietary software may be used only as
  3. * authorised by a licensing agreement from ARM Limited
  4. * (C) COPYRIGHT 2010-2013 ARM Limited
  5. * ALL RIGHTS RESERVED
  6. * The entire notice above must be reproduced on all authorised
  7. * copies and copies may only be made to the extent permitted
  8. * by a licensing agreement from ARM Limited.
  9. */
  10. #ifndef __MALI_KERNEL_UTILIZATION_H__
  11. #define __MALI_KERNEL_UTILIZATION_H__
  12. #include <linux/mali/mali_utgard.h>
  13. #include "mali_osk.h"
  14. extern void (*mali_utilization_callback)(struct mali_gpu_utilization_data *data);
  15. /**
  16. * Initialize/start the Mali GPU utilization metrics reporting.
  17. *
  18. * @return _MALI_OSK_ERR_OK on success, otherwise failure.
  19. */
  20. _mali_osk_errcode_t mali_utilization_init(void);
  21. /**
  22. * Terminate the Mali GPU utilization metrics reporting
  23. */
  24. void mali_utilization_term(void);
  25. /**
  26. * Check if Mali utilization is enabled
  27. */
  28. MALI_STATIC_INLINE mali_bool mali_utilization_enabled(void)
  29. {
  30. return (NULL != mali_utilization_callback);
  31. }
  32. /**
  33. * Should be called when a job is about to execute a GP job
  34. */
  35. void mali_utilization_gp_start(void);
  36. /**
  37. * Should be called when a job has completed executing a GP job
  38. */
  39. void mali_utilization_gp_end(void);
  40. /**
  41. * Should be called when a job is about to execute a PP job
  42. */
  43. void mali_utilization_pp_start(void);
  44. /**
  45. * Should be called when a job has completed executing a PP job
  46. */
  47. void mali_utilization_pp_end(void);
  48. /**
  49. * Should be called to stop the utilization timer during system suspend
  50. */
  51. void mali_utilization_suspend(void);
  52. #endif /* __MALI_KERNEL_UTILIZATION_H__ */