mali_scheduler.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * This confidential and proprietary software may be used only as
  3. * authorised by a licensing agreement from ARM Limited
  4. * (C) COPYRIGHT 2012-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_SCHEDULER_H__
  11. #define __MALI_SCHEDULER_H__
  12. #include "mali_osk.h"
  13. #include "mali_scheduler_types.h"
  14. #include "mali_gp_scheduler.h"
  15. #include "mali_pp_scheduler.h"
  16. _mali_osk_errcode_t mali_scheduler_initialize(void);
  17. void mali_scheduler_terminate(void);
  18. u32 mali_scheduler_get_new_id(void);
  19. u32 mali_scheduler_get_new_cache_order(void);
  20. /**
  21. * @brief Reset all groups
  22. *
  23. * This function resets all groups known by the both the PP and GP scheuduler.
  24. * This must be called after the Mali HW has been powered on in order to reset
  25. * the HW.
  26. */
  27. MALI_STATIC_INLINE void mali_scheduler_reset_all_groups(void)
  28. {
  29. mali_gp_scheduler_reset_all_groups();
  30. mali_pp_scheduler_reset_all_groups();
  31. }
  32. /**
  33. * @brief Zap TLB on all active groups running \a session
  34. *
  35. * @param session Pointer to the session to zap
  36. */
  37. MALI_STATIC_INLINE void mali_scheduler_zap_all_active(struct mali_session_data *session)
  38. {
  39. mali_gp_scheduler_zap_all_active(session);
  40. mali_pp_scheduler_zap_all_active(session);
  41. }
  42. /**
  43. * Check if bit is set in scheduler mask.
  44. *
  45. * @param mask Scheduler mask to check.
  46. * @param bit Bit to check.
  47. * @return MALI_TRUE if bit is set in scheduler mask, MALI_FALSE if not.
  48. */
  49. MALI_STATIC_INLINE mali_bool mali_scheduler_mask_is_set(mali_scheduler_mask mask, mali_scheduler_mask bit)
  50. {
  51. return MALI_SCHEDULER_MASK_EMPTY != (bit & mask);
  52. }
  53. /**
  54. * Schedule GP and PP according to bitmask.
  55. *
  56. * @param mask A scheduling bitmask.
  57. * @param deferred_schedule MALI_TRUE if schedule should be deferred, MALI_FALSE if not.
  58. */
  59. void mali_scheduler_schedule_from_mask(mali_scheduler_mask mask, mali_bool deferred_schedule);
  60. /* Enable or disable scheduler hint. */
  61. extern mali_bool mali_scheduler_hints[MALI_SCHEDULER_HINT_MAX];
  62. MALI_STATIC_INLINE void mali_scheduler_hint_enable(mali_scheduler_hint hint)
  63. {
  64. MALI_DEBUG_ASSERT(hint < MALI_SCHEDULER_HINT_MAX);
  65. mali_scheduler_hints[hint] = MALI_TRUE;
  66. }
  67. MALI_STATIC_INLINE void mali_scheduler_hint_disable(mali_scheduler_hint hint)
  68. {
  69. MALI_DEBUG_ASSERT(hint < MALI_SCHEDULER_HINT_MAX);
  70. mali_scheduler_hints[hint] = MALI_FALSE;
  71. }
  72. MALI_STATIC_INLINE mali_bool mali_scheduler_hint_is_enabled(mali_scheduler_hint hint)
  73. {
  74. MALI_DEBUG_ASSERT(hint < MALI_SCHEDULER_HINT_MAX);
  75. return mali_scheduler_hints[hint];
  76. }
  77. #endif /* __MALI_SCHEDULER_H__ */