2 * Copyright (C) 2012 ARM Limited. All rights reserved.
4 * This program is free software and is provided to you under the terms of the GNU General Public License version 2
5 * as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence.
7 * A copy of the licence is included with the program, and can also be obtained from Free Software
8 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
11 #ifndef __MALI_GP_SCHEDULER_H__
12 #define __MALI_GP_SCHEDULER_H__
15 #include "mali_gp_job.h"
16 #include "mali_group.h"
18 _mali_osk_errcode_t mali_gp_scheduler_initialize(void);
19 void mali_gp_scheduler_terminate(void);
21 void mali_gp_scheduler_job_done(struct mali_group *group, struct mali_gp_job *job, mali_bool success);
22 void mali_gp_scheduler_oom(struct mali_group *group, struct mali_gp_job *job);
23 u32 mali_gp_scheduler_dump_state(char *buf, u32 size);
25 void mali_gp_scheduler_suspend(void);
26 void mali_gp_scheduler_resume(void);
29 * @brief Abort all running and queued GP jobs from session.
31 * This functions aborts all GP jobs from the specified session. Queued jobs are removed from the
32 * queue and jobs currently running on a core will be aborted.
34 * @param session Session that is aborting.
36 void mali_gp_scheduler_abort_session(struct mali_session_data *session);
39 * @brief Reset all groups
41 * This function resets all groups known by the GP scheuduler. This must be
42 * called after the Mali HW has been powered on in order to reset the HW.
44 void mali_gp_scheduler_reset_all_groups(void);
47 * @brief Zap TLB on all groups with \a session active
49 * The scheculer will zap the session on all groups it owns.
51 void mali_gp_scheduler_zap_all_active(struct mali_session_data *session);
54 * @brief Re-enable a group that has been disabled with mali_gp_scheduler_disable_group
56 * If a Mali PMU is present, the group will be powered back on and added back
57 * into the GP scheduler.
59 * @param group Pointer to the group to enable
61 void mali_gp_scheduler_enable_group(struct mali_group *group);
64 * @brief Disable a group
66 * The group will be taken out of the GP scheduler and powered off, if a Mali
69 * @param group Pointer to the group to disable
71 void mali_gp_scheduler_disable_group(struct mali_group *group);
74 * @brief Used by the Timeline system to queue a GP job.
76 * @note @ref mali_scheduler_schedule_from_mask() should be called if this function returns non-zero.
78 * @param job The GP job that is being activated.
80 * @return A scheduling bitmask that can be used to decide if scheduling is necessary after this
83 mali_scheduler_mask mali_gp_scheduler_activate_job(struct mali_gp_job *job);
86 * @brief Schedule queued jobs on idle cores.
88 void mali_gp_scheduler_schedule(void);
91 * @brief Submit a GP job to the GP scheduler.
93 * This will add the GP job to the Timeline system.
95 * @param session Session this job belongs to.
96 * @param job GP job that will be submitted
97 * @return Point on GP timeline for job.
99 mali_timeline_point mali_gp_scheduler_submit_job(struct mali_session_data *session, struct mali_gp_job *job);
101 #endif /* __MALI_GP_SCHEDULER_H__ */