mali_gp_scheduler.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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_GP_SCHEDULER_H__
  11. #define __MALI_GP_SCHEDULER_H__
  12. #include "mali_osk.h"
  13. #include "mali_gp_job.h"
  14. #include "mali_group.h"
  15. _mali_osk_errcode_t mali_gp_scheduler_initialize(void);
  16. void mali_gp_scheduler_terminate(void);
  17. void mali_gp_scheduler_job_done(struct mali_group *group, struct mali_gp_job *job, mali_bool success);
  18. void mali_gp_scheduler_oom(struct mali_group *group, struct mali_gp_job *job);
  19. u32 mali_gp_scheduler_dump_state(char *buf, u32 size);
  20. void mali_gp_scheduler_suspend(void);
  21. void mali_gp_scheduler_resume(void);
  22. /**
  23. * @brief Abort all running and queued GP jobs from session.
  24. *
  25. * This functions aborts all GP jobs from the specified session. Queued jobs are removed from the
  26. * queue and jobs currently running on a core will be aborted.
  27. *
  28. * @param session Session that is aborting.
  29. */
  30. void mali_gp_scheduler_abort_session(struct mali_session_data *session);
  31. /**
  32. * @brief Reset all groups
  33. *
  34. * This function resets all groups known by the GP scheuduler. This must be
  35. * called after the Mali HW has been powered on in order to reset the HW.
  36. */
  37. void mali_gp_scheduler_reset_all_groups(void);
  38. /**
  39. * @brief Zap TLB on all groups with \a session active
  40. *
  41. * The scheculer will zap the session on all groups it owns.
  42. */
  43. void mali_gp_scheduler_zap_all_active(struct mali_session_data *session);
  44. /**
  45. * @brief Re-enable a group that has been disabled with mali_gp_scheduler_disable_group
  46. *
  47. * If a Mali PMU is present, the group will be powered back on and added back
  48. * into the GP scheduler.
  49. *
  50. * @param group Pointer to the group to enable
  51. */
  52. void mali_gp_scheduler_enable_group(struct mali_group *group);
  53. /**
  54. * @brief Disable a group
  55. *
  56. * The group will be taken out of the GP scheduler and powered off, if a Mali
  57. * PMU is present.
  58. *
  59. * @param group Pointer to the group to disable
  60. */
  61. void mali_gp_scheduler_disable_group(struct mali_group *group);
  62. /**
  63. * @brief Used by the Timeline system to queue a GP job.
  64. *
  65. * @note @ref mali_scheduler_schedule_from_mask() should be called if this function returns non-zero.
  66. *
  67. * @param job The GP job that is being activated.
  68. *
  69. * @return A scheduling bitmask that can be used to decide if scheduling is necessary after this
  70. * call.
  71. */
  72. mali_scheduler_mask mali_gp_scheduler_activate_job(struct mali_gp_job *job);
  73. /**
  74. * @brief Schedule queued jobs on idle cores.
  75. */
  76. void mali_gp_scheduler_schedule(void);
  77. /**
  78. * @brief Submit a GP job to the GP scheduler.
  79. *
  80. * This will add the GP job to the Timeline system.
  81. *
  82. * @param session Session this job belongs to.
  83. * @param job GP job that will be submitted
  84. * @return Point on GP timeline for job.
  85. */
  86. mali_timeline_point mali_gp_scheduler_submit_job(struct mali_session_data *session, struct mali_gp_job *job);
  87. #endif /* __MALI_GP_SCHEDULER_H__ */