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 SDMA v4.4.2 XCP funcs

Add functions required to suspend/resume instances of SDMA which
are part of 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
3446cb78 dfdd6f89

+36
+36
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c
··· 27 27 #include <linux/pci.h> 28 28 29 29 #include "amdgpu.h" 30 + #include "amdgpu_xcp.h" 30 31 #include "amdgpu_ucode.h" 31 32 #include "amdgpu_trace.h" 32 33 ··· 2025 2024 .minor = 4, 2026 2025 .rev = 0, 2027 2026 .funcs = &sdma_v4_4_2_ip_funcs, 2027 + }; 2028 + 2029 + static int sdma_v4_4_2_xcp_resume(void *handle, uint32_t inst_mask) 2030 + { 2031 + struct amdgpu_device *adev = (struct amdgpu_device *)handle; 2032 + int r; 2033 + 2034 + if (!amdgpu_sriov_vf(adev)) 2035 + sdma_v4_4_2_inst_init_golden_registers(adev, inst_mask); 2036 + 2037 + r = sdma_v4_4_2_inst_start(adev, inst_mask); 2038 + 2039 + return r; 2040 + } 2041 + 2042 + static int sdma_v4_4_2_xcp_suspend(void *handle, uint32_t inst_mask) 2043 + { 2044 + struct amdgpu_device *adev = (struct amdgpu_device *)handle; 2045 + uint32_t tmp_mask = inst_mask; 2046 + int i; 2047 + 2048 + for_each_inst(i, tmp_mask) { 2049 + amdgpu_irq_put(adev, &adev->sdma.ecc_irq, 2050 + AMDGPU_SDMA_IRQ_INSTANCE0 + i); 2051 + } 2052 + 2053 + sdma_v4_4_2_inst_ctx_switch_enable(adev, false, inst_mask); 2054 + sdma_v4_4_2_inst_enable(adev, false, inst_mask); 2055 + 2056 + return 0; 2057 + } 2058 + 2059 + struct amdgpu_xcp_ip_funcs sdma_v4_4_2_xcp_funcs = { 2060 + .suspend = &sdma_v4_4_2_xcp_suspend, 2061 + .resume = &sdma_v4_4_2_xcp_resume 2028 2062 };