2 * Copyright 2019 Advanced Micro Devices, Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
24 #ifndef __AMDGPU_MES_H__
25 #define __AMDGPU_MES_H__
27 struct amdgpu_mes_funcs;
30 struct amdgpu_adev *adev;
32 /* ip specific functions */
33 struct amdgpu_mes_funcs *funcs;
36 struct mes_add_queue_input {
38 uint64_t page_table_base_addr;
39 uint64_t process_va_start;
40 uint64_t process_va_end;
41 uint64_t process_quantum;
42 uint64_t process_context_addr;
43 uint64_t gang_quantum;
44 uint64_t gang_context_addr;
45 uint32_t inprocess_gang_priority;
46 uint32_t gang_global_priority_level;
47 uint32_t doorbell_offset;
54 struct mes_remove_queue_input {
55 uint32_t doorbell_offset;
56 uint64_t gang_context_addr;
59 struct mes_suspend_gang_input {
60 bool suspend_all_gangs;
61 uint64_t gang_context_addr;
62 uint64_t suspend_fence_addr;
63 uint32_t suspend_fence_value;
66 struct mes_resume_gang_input {
67 bool resume_all_gangs;
68 uint64_t gang_context_addr;
71 struct amdgpu_mes_funcs {
72 int (*add_hw_queue)(struct amdgpu_mes *mes,
73 struct mes_add_queue_input *input);
75 int (*remove_hw_queue)(struct amdgpu_mes *mes,
76 struct mes_remove_queue_input *input);
78 int (*suspend_gang)(struct amdgpu_mes *mes,
79 struct mes_suspend_gang_input *input);
81 int (*resume_gang)(struct amdgpu_mes *mes,
82 struct mes_resume_gang_input *input);
85 #endif /* __AMDGPU_MES_H__ */