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

drm/amdgpu: add query device id and revision id into system info entry at CGS

This patch adds device id and revision into system info entry at CGS,
it's able to get PCI device id and revision id from amdgpu, it might
get more info in future.

PCI device id will be also used on powerplay part at current.

Suggested-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Huang Rui and committed by
Alex Deucher
09fc7eff e595d7f0

+9 -1
+7 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
··· 810 810 } 811 811 812 812 static int amdgpu_cgs_query_system_info(struct cgs_device *cgs_device, 813 - struct cgs_system_info *sys_info) 813 + struct cgs_system_info *sys_info) 814 814 { 815 815 CGS_FUNC_ADEV; 816 816 ··· 829 829 break; 830 830 case CGS_SYSTEM_INFO_PCIE_MLW: 831 831 sys_info->value = adev->pm.pcie_mlw_mask; 832 + break; 833 + case CGS_SYSTEM_INFO_PCIE_DEV: 834 + sys_info->value = adev->pdev->device; 835 + break; 836 + case CGS_SYSTEM_INFO_PCIE_REV: 837 + sys_info->value = adev->pdev->revision; 832 838 break; 833 839 case CGS_SYSTEM_INFO_CG_FLAGS: 834 840 sys_info->value = adev->cg_flags;
+2
drivers/gpu/drm/amd/include/cgs_common.h
··· 113 113 CGS_SYSTEM_INFO_ADAPTER_BDF_ID = 1, 114 114 CGS_SYSTEM_INFO_PCIE_GEN_INFO, 115 115 CGS_SYSTEM_INFO_PCIE_MLW, 116 + CGS_SYSTEM_INFO_PCIE_DEV, 117 + CGS_SYSTEM_INFO_PCIE_REV, 116 118 CGS_SYSTEM_INFO_CG_FLAGS, 117 119 CGS_SYSTEM_INFO_PG_FLAGS, 118 120 CGS_SYSTEM_INFO_GFX_CU_INFO,