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

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu: Add XCP functions for GFX v9.4.3

Add functions to suspend/resume GFX instances belonging to an XCP.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Lijo Lazar and committed by
Alex Deucher
73c84f7c 3446cb78

+47
+47
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
··· 23 23 #include <linux/firmware.h> 24 24 25 25 #include "amdgpu.h" 26 + #include "amdgpu_xcp.h" 26 27 #include "amdgpu_gfx.h" 27 28 #include "soc15.h" 28 29 #include "soc15d.h" ··· 3177 3176 .minor = 4, 3178 3177 .rev = 0, 3179 3178 .funcs = &gfx_v9_4_3_ip_funcs, 3179 + }; 3180 + 3181 + static int gfx_v9_4_3_xcp_resume(void *handle, uint32_t inst_mask) 3182 + { 3183 + struct amdgpu_device *adev = (struct amdgpu_device *)handle; 3184 + uint32_t tmp_mask; 3185 + int i, r; 3186 + 3187 + /* TODO : Initialize golden regs */ 3188 + /* gfx_v9_4_3_init_golden_registers(adev); */ 3189 + 3190 + tmp_mask = inst_mask; 3191 + for_each_inst(i, tmp_mask) 3192 + gfx_v9_4_3_xcc_constants_init(adev, i); 3193 + 3194 + tmp_mask = inst_mask; 3195 + for_each_inst(i, tmp_mask) { 3196 + r = gfx_v9_4_3_xcc_rlc_resume(adev, i); 3197 + if (r) 3198 + return r; 3199 + } 3200 + 3201 + tmp_mask = inst_mask; 3202 + for_each_inst(i, tmp_mask) { 3203 + r = gfx_v9_4_3_xcc_cp_resume(adev, i); 3204 + if (r) 3205 + return r; 3206 + } 3207 + 3208 + return 0; 3209 + } 3210 + 3211 + static int gfx_v9_4_3_xcp_suspend(void *handle, uint32_t inst_mask) 3212 + { 3213 + struct amdgpu_device *adev = (struct amdgpu_device *)handle; 3214 + int i; 3215 + 3216 + for_each_inst(i, inst_mask) 3217 + gfx_v9_4_3_xcc_fini(adev, i); 3218 + 3219 + return 0; 3220 + } 3221 + 3222 + struct amdgpu_xcp_ip_funcs gfx_v9_4_3_xcp_funcs = { 3223 + .suspend = &gfx_v9_4_3_xcp_suspend, 3224 + .resume = &gfx_v9_4_3_xcp_resume 3180 3225 };