Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu/mes10.1: add ip block mes10.1 (v2)

MES takes over the scheduling capability of GFX and SDMA,
add MES as a standalone ip.

v2: squash in updates (Alex)

Acked-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Jack Xiao <Jack.Xiao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Jack Xiao and committed by
Alex Deucher
886f82aa 5f84cc63

+138 -1
+4
drivers/gpu/drm/amd/amdgpu/Makefile
··· 120 120 sdma_v4_0.o \ 121 121 sdma_v5_0.o 122 122 123 + # add MES block 124 + amdgpu-y += \ 125 + mes_v10_1.o 126 + 123 127 # add UVD block 124 128 amdgpu-y += \ 125 129 amdgpu_uvd.o \
+103
drivers/gpu/drm/amd/amdgpu/mes_v10_1.c
··· 1 + /* 2 + * Copyright 2019 Advanced Micro Devices, Inc. 3 + * 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: 10 + * 11 + * The above copyright notice and this permission notice shall be included in 12 + * all copies or substantial portions of the Software. 13 + * 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. 21 + * 22 + */ 23 + 24 + #include "amdgpu.h" 25 + 26 + static int mes_v10_1_add_hw_queue(struct amdgpu_mes *mes, 27 + struct mes_add_queue_input *input) 28 + { 29 + return 0; 30 + } 31 + 32 + static int mes_v10_1_remove_hw_queue(struct amdgpu_mes *mes, 33 + struct mes_remove_queue_input *input) 34 + { 35 + return 0; 36 + } 37 + 38 + static int mes_v10_1_suspend_gang(struct amdgpu_mes *mes, 39 + struct mes_suspend_gang_input *input) 40 + { 41 + return 0; 42 + } 43 + 44 + static int mes_v10_1_resume_gang(struct amdgpu_mes *mes, 45 + struct mes_resume_gang_input *input) 46 + { 47 + return 0; 48 + } 49 + 50 + static const struct amdgpu_mes_funcs mes_v10_1_funcs = { 51 + .add_hw_queue = mes_v10_1_add_hw_queue, 52 + .remove_hw_queue = mes_v10_1_remove_hw_queue, 53 + .suspend_gang = mes_v10_1_suspend_gang, 54 + .resume_gang = mes_v10_1_resume_gang, 55 + }; 56 + 57 + static int mes_v10_1_sw_init(void *handle) 58 + { 59 + return 0; 60 + } 61 + 62 + static int mes_v10_1_sw_fini(void *handle) 63 + { 64 + return 0; 65 + } 66 + 67 + static int mes_v10_1_hw_init(void *handle) 68 + { 69 + return 0; 70 + } 71 + 72 + static int mes_v10_1_hw_fini(void *handle) 73 + { 74 + return 0; 75 + } 76 + 77 + static int mes_v10_1_suspend(void *handle) 78 + { 79 + return 0; 80 + } 81 + 82 + static int mes_v10_1_resume(void *handle) 83 + { 84 + return 0; 85 + } 86 + 87 + static const struct amd_ip_funcs mes_v10_1_ip_funcs = { 88 + .name = "mes_v10_1", 89 + .sw_init = mes_v10_1_sw_init, 90 + .sw_fini = mes_v10_1_sw_fini, 91 + .hw_init = mes_v10_1_hw_init, 92 + .hw_fini = mes_v10_1_hw_fini, 93 + .suspend = mes_v10_1_suspend, 94 + .resume = mes_v10_1_resume, 95 + }; 96 + 97 + const struct amdgpu_ip_block_version mes_v10_1_ip_block = { 98 + .type = AMD_IP_BLOCK_TYPE_MES, 99 + .major = 10, 100 + .minor = 1, 101 + .rev = 0, 102 + .funcs = &mes_v10_1_ip_funcs, 103 + };
+29
drivers/gpu/drm/amd/amdgpu/mes_v10_1.h
··· 1 + /* 2 + * Copyright 2019 Advanced Micro Devices, Inc. 3 + * 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: 10 + * 11 + * The above copyright notice and this permission notice shall be included in 12 + * all copies or substantial portions of the Software. 13 + * 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. 21 + * 22 + */ 23 + 24 + #ifndef __MES_V10_1_H__ 25 + #define __MES_v10_1_H__ 26 + 27 + extern const struct amdgpu_ip_block_version mes_v10_1_ip_block; 28 + 29 + #endif
+2 -1
drivers/gpu/drm/amd/include/amd_shared.h
··· 52 52 AMD_IP_BLOCK_TYPE_UVD, 53 53 AMD_IP_BLOCK_TYPE_VCE, 54 54 AMD_IP_BLOCK_TYPE_ACP, 55 - AMD_IP_BLOCK_TYPE_VCN 55 + AMD_IP_BLOCK_TYPE_VCN, 56 + AMD_IP_BLOCK_TYPE_MES 56 57 }; 57 58 58 59 enum amd_clockgating_state {