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 GFXHUB v1.2 XCP funcs

Add functions required for suspend/resume of GFXHUB instances 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
dfdd6f89 8e7fd193

+35
+35
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c
··· 21 21 * 22 22 */ 23 23 #include "amdgpu.h" 24 + #include "amdgpu_xcp.h" 24 25 #include "gfxhub_v1_2.h" 25 26 #include "gfxhub_v1_1.h" 26 27 ··· 638 637 .set_fault_enable_default = gfxhub_v1_2_set_fault_enable_default, 639 638 .init = gfxhub_v1_2_init, 640 639 .get_xgmi_info = gfxhub_v1_2_get_xgmi_info, 640 + }; 641 + 642 + static int gfxhub_v1_2_xcp_resume(void *handle, uint32_t inst_mask) 643 + { 644 + struct amdgpu_device *adev = (struct amdgpu_device *)handle; 645 + bool value; 646 + int ret; 647 + 648 + if (amdgpu_vm_fault_stop == AMDGPU_VM_FAULT_STOP_ALWAYS) 649 + value = false; 650 + else 651 + value = true; 652 + 653 + gfxhub_v1_2_xcc_set_fault_enable_default(adev, value, inst_mask); 654 + 655 + if (!amdgpu_sriov_vf(adev)) 656 + ret = gfxhub_v1_2_xcc_gart_enable(adev, inst_mask); 657 + 658 + return ret; 659 + } 660 + 661 + static int gfxhub_v1_2_xcp_suspend(void *handle, uint32_t inst_mask) 662 + { 663 + struct amdgpu_device *adev = (struct amdgpu_device *)handle; 664 + 665 + if (!amdgpu_sriov_vf(adev)) 666 + gfxhub_v1_2_xcc_gart_disable(adev, inst_mask); 667 + 668 + return 0; 669 + } 670 + 671 + struct amdgpu_xcp_ip_funcs gfxhub_v1_2_xcp_funcs = { 672 + .suspend = &gfxhub_v1_2_xcp_suspend, 673 + .resume = &gfxhub_v1_2_xcp_resume 641 674 };