drm/amdgpu: move reserving GDS/GWS/OA into common code
authorChristian König <christian.koenig@amd.com>
Fri, 14 Sep 2018 19:08:57 +0000 (21:08 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 19 Sep 2018 17:39:02 +0000 (12:39 -0500)
We don't need that in the per ASIC code.

Signed-off-by: Christian König <christian.koenig@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_ttm.c
drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c

index d83f4e265c5ceef14c1c8d53d1b1fdab73edc2de..a44fc12ae1f9eba9eaa7460f536c00f008eaf481 100644 (file)
@@ -1852,6 +1852,12 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
                return r;
        }
 
+       r = amdgpu_bo_create_kernel(adev, adev->gds.mem.gfx_partition_size,
+                                   PAGE_SIZE, AMDGPU_GEM_DOMAIN_GDS,
+                                   &adev->gds.gds_gfx_bo, NULL, NULL);
+       if (r)
+               return r;
+
        r = ttm_bo_init_mm(&adev->mman.bdev, AMDGPU_PL_GWS,
                           adev->gds.gws.total_size);
        if (r) {
@@ -1859,6 +1865,12 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
                return r;
        }
 
+       r = amdgpu_bo_create_kernel(adev, adev->gds.gws.gfx_partition_size,
+                                   PAGE_SIZE, AMDGPU_GEM_DOMAIN_GWS,
+                                   &adev->gds.gws_gfx_bo, NULL, NULL);
+       if (r)
+               return r;
+
        r = ttm_bo_init_mm(&adev->mman.bdev, AMDGPU_PL_OA,
                           adev->gds.oa.total_size);
        if (r) {
@@ -1866,6 +1878,12 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
                return r;
        }
 
+       r = amdgpu_bo_create_kernel(adev, adev->gds.oa.gfx_partition_size,
+                                   PAGE_SIZE, AMDGPU_GEM_DOMAIN_OA,
+                                   &adev->gds.oa_gfx_bo, NULL, NULL);
+       if (r)
+               return r;
+
        /* Register debugfs entries for amdgpu_ttm */
        r = amdgpu_ttm_debugfs_init(adev);
        if (r) {
index c0f9732cbaf799eba896d78b8cc97ac421cc447e..fc39ebbc9d9fd6dfc4ccfdd6d140ac046667d8a9 100644 (file)
@@ -4582,25 +4582,6 @@ static int gfx_v7_0_sw_init(void *handle)
                }
        }
 
-       /* reserve GDS, GWS and OA resource for gfx */
-       r = amdgpu_bo_create_kernel(adev, adev->gds.mem.gfx_partition_size,
-                                   PAGE_SIZE, AMDGPU_GEM_DOMAIN_GDS,
-                                   &adev->gds.gds_gfx_bo, NULL, NULL);
-       if (r)
-               return r;
-
-       r = amdgpu_bo_create_kernel(adev, adev->gds.gws.gfx_partition_size,
-                                   PAGE_SIZE, AMDGPU_GEM_DOMAIN_GWS,
-                                   &adev->gds.gws_gfx_bo, NULL, NULL);
-       if (r)
-               return r;
-
-       r = amdgpu_bo_create_kernel(adev, adev->gds.oa.gfx_partition_size,
-                                   PAGE_SIZE, AMDGPU_GEM_DOMAIN_OA,
-                                   &adev->gds.oa_gfx_bo, NULL, NULL);
-       if (r)
-               return r;
-
        adev->gfx.ce_ram_size = 0x8000;
 
        gfx_v7_0_gpu_early_init(adev);
index 96df23c99cfbd7d4b610b3bb09eb4c3c176ee3c8..470dc80f4fe72a520e58e55e3b84d0cc36bc2dbe 100644 (file)
@@ -2161,25 +2161,6 @@ static int gfx_v8_0_sw_init(void *handle)
        if (r)
                return r;
 
-       /* reserve GDS, GWS and OA resource for gfx */
-       r = amdgpu_bo_create_kernel(adev, adev->gds.mem.gfx_partition_size,
-                                   PAGE_SIZE, AMDGPU_GEM_DOMAIN_GDS,
-                                   &adev->gds.gds_gfx_bo, NULL, NULL);
-       if (r)
-               return r;
-
-       r = amdgpu_bo_create_kernel(adev, adev->gds.gws.gfx_partition_size,
-                                   PAGE_SIZE, AMDGPU_GEM_DOMAIN_GWS,
-                                   &adev->gds.gws_gfx_bo, NULL, NULL);
-       if (r)
-               return r;
-
-       r = amdgpu_bo_create_kernel(adev, adev->gds.oa.gfx_partition_size,
-                                   PAGE_SIZE, AMDGPU_GEM_DOMAIN_OA,
-                                   &adev->gds.oa_gfx_bo, NULL, NULL);
-       if (r)
-               return r;
-
        adev->gfx.ce_ram_size = 0x8000;
 
        r = gfx_v8_0_gpu_early_init(adev);
index 528a8a5676338bb3d072cdbe9bccea68cdceacbb..f369d960343573aec5ea3c20f75bb54e177dcfb5 100644 (file)
@@ -1700,25 +1700,6 @@ static int gfx_v9_0_sw_init(void *handle)
        if (r)
                return r;
 
-       /* reserve GDS, GWS and OA resource for gfx */
-       r = amdgpu_bo_create_kernel(adev, adev->gds.mem.gfx_partition_size,
-                                   PAGE_SIZE, AMDGPU_GEM_DOMAIN_GDS,
-                                   &adev->gds.gds_gfx_bo, NULL, NULL);
-       if (r)
-               return r;
-
-       r = amdgpu_bo_create_kernel(adev, adev->gds.gws.gfx_partition_size,
-                                   PAGE_SIZE, AMDGPU_GEM_DOMAIN_GWS,
-                                   &adev->gds.gws_gfx_bo, NULL, NULL);
-       if (r)
-               return r;
-
-       r = amdgpu_bo_create_kernel(adev, adev->gds.oa.gfx_partition_size,
-                                   PAGE_SIZE, AMDGPU_GEM_DOMAIN_OA,
-                                   &adev->gds.oa_gfx_bo, NULL, NULL);
-       if (r)
-               return r;
-
        adev->gfx.ce_ram_size = 0x8000;
 
        r = gfx_v9_0_gpu_early_init(adev);