drm/amdgpu: disable agp for sriov
authorFrank.Min <Frank.Min@amd.com>
Wed, 21 Aug 2019 09:20:34 +0000 (17:20 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 22 Aug 2019 22:15:06 +0000 (17:15 -0500)
Since agp is not used for sriov, just disable it

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Frank.Min <Frank.Min@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c

index 924d83e711efd182f26888e24f9065fd30a58d8c..5790db61fa2c013711d7438f9a92e7441f280f0b 100644 (file)
@@ -220,6 +220,14 @@ void amdgpu_gmc_agp_location(struct amdgpu_device *adev, struct amdgpu_gmc *mc)
        const uint64_t sixteen_gb_mask = ~(sixteen_gb - 1);
        u64 size_af, size_bf;
 
+       if (amdgpu_sriov_vf(adev)) {
+               mc->agp_start = 0xffffffff;
+               mc->agp_end = 0x0;
+               mc->agp_size = 0;
+
+               return;
+       }
+
        if (mc->fb_start > mc->gart_start) {
                size_bf = (mc->fb_start & sixteen_gb_mask) -
                        ALIGN(mc->gart_end + 1, sixteen_gb);
index e5949d7f3b932b2a8d7f786a7958bfb47fa562a2..6d61a531bb5380e23e2b0c9f45df4a108a3d6ff6 100644 (file)
@@ -934,8 +934,7 @@ static void gmc_v9_0_vram_gtt_location(struct amdgpu_device *adev,
        base += adev->gmc.xgmi.physical_node_id * adev->gmc.xgmi.node_segment_size;
        amdgpu_gmc_vram_location(adev, mc, base);
        amdgpu_gmc_gart_location(adev, mc);
-       if (!amdgpu_sriov_vf(adev))
-               amdgpu_gmc_agp_location(adev, mc);
+       amdgpu_gmc_agp_location(adev, mc);
        /* base offset of vram pages */
        adev->vm_manager.vram_base_offset = gfxhub_v1_0_get_mc_fb_offset(adev);