aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Min <Frank.Min@amd.com>2016-04-27 08:04:58 -0400
committerAlex Deucher <alexander.deucher@amd.com>2016-10-25 14:38:22 -0400
commitac00bbf32b02b74cf9ff1b9e861de9befaf00be5 (patch)
treef27b4cd5ebdf3a4634a3b3974f5d815f811c633e
parentf501a7e550015bc3170c24d18ba1a008e38bddbf (diff)
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>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c7
-rwxr-xr-xdrivers/gpu/drm/amd/include/cgs_common.h5
2 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
index 44f565465b09..1950c25557de 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
@@ -853,6 +853,12 @@ static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device,
853 return 0; 853 return 0;
854} 854}
855 855
856static int amdgpu_cgs_is_virtualization_enabled(void *cgs_device)
857{
858 CGS_FUNC_ADEV;
859 return amdgpu_sriov_vf(adev);
860}
861
856static int amdgpu_cgs_query_system_info(struct cgs_device *cgs_device, 862static int amdgpu_cgs_query_system_info(struct cgs_device *cgs_device,
857 struct cgs_system_info *sys_info) 863 struct cgs_system_info *sys_info)
858{ 864{
@@ -1206,6 +1212,7 @@ static const struct cgs_ops amdgpu_cgs_ops = {
1206 amdgpu_cgs_notify_dpm_enabled, 1212 amdgpu_cgs_notify_dpm_enabled,
1207 amdgpu_cgs_call_acpi_method, 1213 amdgpu_cgs_call_acpi_method,
1208 amdgpu_cgs_query_system_info, 1214 amdgpu_cgs_query_system_info,
1215 amdgpu_cgs_is_virtualization_enabled
1209}; 1216};
1210 1217
1211static const struct cgs_os_ops amdgpu_cgs_os_ops = { 1218static const struct cgs_os_ops amdgpu_cgs_os_ops = {
diff --git a/drivers/gpu/drm/amd/include/cgs_common.h b/drivers/gpu/drm/amd/include/cgs_common.h
index df7c18b6a02a..9695c2ebd92a 100755
--- a/drivers/gpu/drm/amd/include/cgs_common.h
+++ b/drivers/gpu/drm/amd/include/cgs_common.h
@@ -619,6 +619,8 @@ typedef int (*cgs_call_acpi_method)(struct cgs_device *cgs_device,
619typedef int (*cgs_query_system_info)(struct cgs_device *cgs_device, 619typedef int (*cgs_query_system_info)(struct cgs_device *cgs_device,
620 struct cgs_system_info *sys_info); 620 struct cgs_system_info *sys_info);
621 621
622typedef int (*cgs_is_virtualization_enabled_t)(void *cgs_device);
623
622struct cgs_ops { 624struct cgs_ops {
623 /* memory management calls (similar to KFD interface) */ 625 /* memory management calls (similar to KFD interface) */
624 cgs_gpu_mem_info_t gpu_mem_info; 626 cgs_gpu_mem_info_t gpu_mem_info;
@@ -670,6 +672,7 @@ struct cgs_ops {
670 cgs_call_acpi_method call_acpi_method; 672 cgs_call_acpi_method call_acpi_method;
671 /* get system info */ 673 /* get system info */
672 cgs_query_system_info query_system_info; 674 cgs_query_system_info query_system_info;
675 cgs_is_virtualization_enabled_t is_virtualization_enabled;
673}; 676};
674 677
675struct cgs_os_ops; /* To be define in OS-specific CGS header */ 678struct cgs_os_ops; /* To be define in OS-specific CGS header */
@@ -773,4 +776,6 @@ struct cgs_device
773 CGS_CALL(get_pci_resource, cgs_device, resource_type, size, offset, \ 776 CGS_CALL(get_pci_resource, cgs_device, resource_type, size, offset, \
774 resource_base) 777 resource_base)
775 778
779#define cgs_is_virtualization_enabled(cgs_device) \
780 CGS_CALL(is_virtualization_enabled, cgs_device)
776#endif /* _CGS_COMMON_H */ 781#endif /* _CGS_COMMON_H */