]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amdgpu: move getting pcie info to common code
authorAlex Deucher <alexander.deucher@amd.com>
Fri, 9 Mar 2018 20:14:11 +0000 (15:14 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 14 Mar 2018 21:01:16 +0000 (16:01 -0500)
No need to replicate it in several places.

Reviewed-by: Rex Zhu <rezhu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdgpu/cik.c
drivers/gpu/drm/amd/amdgpu/soc15.c
drivers/gpu/drm/amd/amdgpu/vi.c

index fea4ea286368853f4fa98f09ec13f14e597a84f4..dd8a6661fbebb6c133d162bb851d5983e4a5eff8 100644 (file)
@@ -1081,8 +1081,6 @@ struct amdgpu_wb {
 int amdgpu_device_wb_get(struct amdgpu_device *adev, u32 *wb);
 void amdgpu_device_wb_free(struct amdgpu_device *adev, u32 wb);
 
-void amdgpu_device_get_pcie_info(struct amdgpu_device *adev);
-
 /*
  * SDMA
  */
index b054fea358767498ca9a13fa91b7c13a3a7af8cc..7d7d30b8a719ff4486e3b8e6c2fd6b30dbeb07ac 100644 (file)
@@ -87,6 +87,8 @@ static const char *amdgpu_asic_name[] = {
        "LAST",
 };
 
+static void amdgpu_device_get_pcie_info(struct amdgpu_device *adev);
+
 bool amdgpu_device_is_px(struct drm_device *dev)
 {
        struct amdgpu_device *adev = dev->dev_private;
@@ -1909,6 +1911,8 @@ int amdgpu_device_init(struct amdgpu_device *adev,
        if (adev->rio_mem == NULL)
                DRM_INFO("PCI I/O BAR is not found.\n");
 
+       amdgpu_device_get_pcie_info(adev);
+
        /* early init functions */
        r = amdgpu_device_ip_early_init(adev);
        if (r)
@@ -2786,7 +2790,7 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
        return r;
 }
 
-void amdgpu_device_get_pcie_info(struct amdgpu_device *adev)
+static void amdgpu_device_get_pcie_info(struct amdgpu_device *adev)
 {
        u32 mask;
        int ret;
index f14dd1b073e9763376067bc94a1fc6774be2468f..71b35623b32d6d40669ec5293715e8a2f0251ef2 100644 (file)
@@ -1887,8 +1887,6 @@ static int cik_common_early_init(void *handle)
                return -EINVAL;
        }
 
-       amdgpu_device_get_pcie_info(adev);
-
        return 0;
 }
 
index b2cf0bea41d28590ddba0560bebc59b7553495ec..28b0dbf859863fbd6b900ac47db046bc2ed52cbf 100644 (file)
@@ -691,8 +691,6 @@ static int soc15_common_early_init(void *handle)
                xgpu_ai_mailbox_set_irq_funcs(adev);
        }
 
-       amdgpu_device_get_pcie_info(adev);
-
        return 0;
 }
 
index dec7de3be78aa15d947e2556e355845aec82076d..e7cf752c3c879598a2dca8d0b4bda0d4a78e6409 100644 (file)
@@ -1097,8 +1097,6 @@ static int vi_common_early_init(void *handle)
                xgpu_vi_mailbox_set_irq_funcs(adev);
        }
 
-       amdgpu_device_get_pcie_info(adev);
-
        return 0;
 }