uart...
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / misc / mediatek / gpu / mt8127 / mali / mali / common / mali_gp_scheduler.h
CommitLineData
6fa3eb70
S
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
11#ifndef __MALI_GP_SCHEDULER_H__
12#define __MALI_GP_SCHEDULER_H__
13
14#include "mali_osk.h"
15#include "mali_gp_job.h"
16#include "mali_group.h"
17
18_mali_osk_errcode_t mali_gp_scheduler_initialize(void);
19void mali_gp_scheduler_terminate(void);
20
21void mali_gp_scheduler_job_done(struct mali_group *group, struct mali_gp_job *job, mali_bool success);
22void mali_gp_scheduler_oom(struct mali_group *group, struct mali_gp_job *job);
23u32 mali_gp_scheduler_dump_state(char *buf, u32 size);
24
25void mali_gp_scheduler_suspend(void);
26void mali_gp_scheduler_resume(void);
27
28/**
29 * @brief Abort all running and queued GP jobs from session.
30 *
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.
33 *
34 * @param session Session that is aborting.
35 */
36void mali_gp_scheduler_abort_session(struct mali_session_data *session);
37
38/**
39 * @brief Reset all groups
40 *
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.
43 */
44void mali_gp_scheduler_reset_all_groups(void);
45
46/**
47 * @brief Zap TLB on all groups with \a session active
48 *
49 * The scheculer will zap the session on all groups it owns.
50 */
51void mali_gp_scheduler_zap_all_active(struct mali_session_data *session);
52
53/**
54 * @brief Re-enable a group that has been disabled with mali_gp_scheduler_disable_group
55 *
56 * If a Mali PMU is present, the group will be powered back on and added back
57 * into the GP scheduler.
58 *
59 * @param group Pointer to the group to enable
60 */
61void mali_gp_scheduler_enable_group(struct mali_group *group);
62
63/**
64 * @brief Disable a group
65 *
66 * The group will be taken out of the GP scheduler and powered off, if a Mali
67 * PMU is present.
68 *
69 * @param group Pointer to the group to disable
70 */
71void mali_gp_scheduler_disable_group(struct mali_group *group);
72
73/**
74 * @brief Used by the Timeline system to queue a GP job.
75 *
76 * @note @ref mali_scheduler_schedule_from_mask() should be called if this function returns non-zero.
77 *
78 * @param job The GP job that is being activated.
79 *
80 * @return A scheduling bitmask that can be used to decide if scheduling is necessary after this
81 * call.
82 */
83mali_scheduler_mask mali_gp_scheduler_activate_job(struct mali_gp_job *job);
84
85/**
86 * @brief Schedule queued jobs on idle cores.
87 */
88void mali_gp_scheduler_schedule(void);
89
90/**
91 * @brief Submit a GP job to the GP scheduler.
92 *
93 * This will add the GP job to the Timeline system.
94 *
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.
98 */
99mali_timeline_point mali_gp_scheduler_submit_job(struct mali_session_data *session, struct mali_gp_job *job);
100
101#endif /* __MALI_GP_SCHEDULER_H__ */