drm/amdgpu: add query device id and revision id into system info entry at CGS
authorHuang Rui <ray.huang@amd.com>
Tue, 12 Jul 2016 05:54:05 +0000 (13:54 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 29 Jul 2016 18:37:12 +0000 (14:37 -0400)
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>
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
drivers/gpu/drm/amd/include/cgs_common.h

index 347f458d3c311a31eacda2e0fea4d42247f6dc97..bc0440f7a31d3be5018c6eacb01c5a719dcc8db6 100644 (file)
@@ -810,7 +810,7 @@ static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device,
 }
 
 static int amdgpu_cgs_query_system_info(struct cgs_device *cgs_device,
-                               struct cgs_system_info *sys_info)
+                                       struct cgs_system_info *sys_info)
 {
        CGS_FUNC_ADEV;
 
@@ -830,6 +830,12 @@ static int amdgpu_cgs_query_system_info(struct cgs_device *cgs_device,
        case CGS_SYSTEM_INFO_PCIE_MLW:
                sys_info->value = adev->pm.pcie_mlw_mask;
                break;
+       case CGS_SYSTEM_INFO_PCIE_DEV:
+               sys_info->value = adev->pdev->device;
+               break;
+       case CGS_SYSTEM_INFO_PCIE_REV:
+               sys_info->value = adev->pdev->revision;
+               break;
        case CGS_SYSTEM_INFO_CG_FLAGS:
                sys_info->value = adev->cg_flags;
                break;
index ed5fa335736443e467c0b8481a5f8523d84839fc..b86aba9d019fbe7bf00f22c798d0c8bd50cdcf29 100644 (file)
@@ -113,6 +113,8 @@ enum cgs_system_info_id {
        CGS_SYSTEM_INFO_ADAPTER_BDF_ID = 1,
        CGS_SYSTEM_INFO_PCIE_GEN_INFO,
        CGS_SYSTEM_INFO_PCIE_MLW,
+       CGS_SYSTEM_INFO_PCIE_DEV,
+       CGS_SYSTEM_INFO_PCIE_REV,
        CGS_SYSTEM_INFO_CG_FLAGS,
        CGS_SYSTEM_INFO_PG_FLAGS,
        CGS_SYSTEM_INFO_GFX_CU_INFO,