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

drm/amdgpu:add callback in cgs for sriov detect

Signed-off-by: Frank Min <Frank.Min@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Frank Min and committed by
Alex Deucher
ac00bbf3 f501a7e5

+12
+7
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
··· 853 853 return 0; 854 854 } 855 855 856 + static int amdgpu_cgs_is_virtualization_enabled(void *cgs_device) 857 + { 858 + CGS_FUNC_ADEV; 859 + return amdgpu_sriov_vf(adev); 860 + } 861 + 856 862 static int amdgpu_cgs_query_system_info(struct cgs_device *cgs_device, 857 863 struct cgs_system_info *sys_info) 858 864 { ··· 1212 1206 amdgpu_cgs_notify_dpm_enabled, 1213 1207 amdgpu_cgs_call_acpi_method, 1214 1208 amdgpu_cgs_query_system_info, 1209 + amdgpu_cgs_is_virtualization_enabled 1215 1210 }; 1216 1211 1217 1212 static const struct cgs_os_ops amdgpu_cgs_os_ops = {
+5
drivers/gpu/drm/amd/include/cgs_common.h
··· 619 619 typedef int (*cgs_query_system_info)(struct cgs_device *cgs_device, 620 620 struct cgs_system_info *sys_info); 621 621 622 + typedef int (*cgs_is_virtualization_enabled_t)(void *cgs_device); 623 + 622 624 struct cgs_ops { 623 625 /* memory management calls (similar to KFD interface) */ 624 626 cgs_gpu_mem_info_t gpu_mem_info; ··· 672 670 cgs_call_acpi_method call_acpi_method; 673 671 /* get system info */ 674 672 cgs_query_system_info query_system_info; 673 + cgs_is_virtualization_enabled_t is_virtualization_enabled; 675 674 }; 676 675 677 676 struct cgs_os_ops; /* To be define in OS-specific CGS header */ ··· 776 773 CGS_CALL(get_pci_resource, cgs_device, resource_type, size, offset, \ 777 774 resource_base) 778 775 776 + #define cgs_is_virtualization_enabled(cgs_device) \ 777 + CGS_CALL(is_virtualization_enabled, cgs_device) 779 778 #endif /* _CGS_COMMON_H */