drm/amdgpu/gfx6: drop gds unrefs
Subsystems (2)
PATCH 1/2 drm/amdgpu/gfx6: drop gds unrefs
Leftover from gfx7 code. gfx6 never sets up the gds buffers in the first place.
--- drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c +0 -4
@@ -3308,10 +3308,6 @@ static int gfx_v6_0_sw_fini(void *handle)int i;struct amdgpu_device *adev = (struct amdgpu_device *)handle; -amdgpu_bo_unref (&adev->gds.oa_gfx_bo); -amdgpu_bo_unref (&adev->gds.gws_gfx_bo); -amdgpu_bo_unref (&adev->gds.gds_gfx_bo); -for (i =0 ; i < adev->gfx.num_gfx_rings; i++)amdgpu_ring_fini (&adev->gfx.gfx_ring[i]);for (i =0 ; i < adev->gfx.num_compute_rings; i++)
Signature · 6 lines
2.5.5 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1489586194-13113-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org
PATCH 2/2 drm/amdgpu: don't init GDS pool if GDS size is 0
SI cards don't expose GDS as a separate pool. The CP manages GDS and the UMDs use special CP packets to allocate GDS memory.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 47 ++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 18 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +29 -18
@@ -1148,6 +1148,7 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)DRM_INFO ("amdgpu: %uM of GTT memory ready.\n" , (unsigned )(adev->mc.gtt_size / (1024 *1024 ))); + adev->gds.mem.total_size = adev->gds.mem.total_size <<AMDGPU_GDS_SHIFT ; adev->gds.mem.gfx_partition_size = adev->gds.mem.gfx_partition_size <<AMDGPU_GDS_SHIFT ; adev->gds.mem.cs_partition_size = adev->gds.mem.cs_partition_size <<AMDGPU_GDS_SHIFT ;
@@ -1157,28 +1158,35 @@ int amdgpu_ttm_init(struct amdgpu_device *adev) adev->gds.oa.total_size = adev->gds.oa.total_size <<AMDGPU_OA_SHIFT ; adev->gds.oa.gfx_partition_size = adev->gds.oa.gfx_partition_size <<AMDGPU_OA_SHIFT ; adev->gds.oa.cs_partition_size = adev->gds.oa.cs_partition_size <<AMDGPU_OA_SHIFT ; +/* GDS Memory */ - r =ttm_bo_init_mm (&adev->mman.bdev,AMDGPU_PL_GDS , - adev->gds.mem.total_size >>PAGE_SHIFT ); -if (r) { -DRM_ERROR ("Failed initializing GDS heap.\n" ); -return r; +if (adev->gds.mem.total_size) { + r =ttm_bo_init_mm (&adev->mman.bdev,AMDGPU_PL_GDS , + adev->gds.mem.total_size >>PAGE_SHIFT ); +if (r) { +DRM_ERROR ("Failed initializing GDS heap.\n" ); +return r; + } }/* GWS */ - r =ttm_bo_init_mm (&adev->mman.bdev,AMDGPU_PL_GWS , - adev->gds.gws.total_size >>PAGE_SHIFT ); -if (r) { -DRM_ERROR ("Failed initializing gws heap.\n" ); -return r; +if (adev->gds.gws.total_size) { + r =ttm_bo_init_mm (&adev->mman.bdev,AMDGPU_PL_GWS , + adev->gds.gws.total_size >>PAGE_SHIFT ); +if (r) { +DRM_ERROR ("Failed initializing gws heap.\n" ); +return r; + } }/* OA */ - r =ttm_bo_init_mm (&adev->mman.bdev,AMDGPU_PL_OA , - adev->gds.oa.total_size >>PAGE_SHIFT ); -if (r) { -DRM_ERROR ("Failed initializing oa heap.\n" ); -return r; +if (adev->gds.oa.total_size) { + r =ttm_bo_init_mm (&adev->mman.bdev,AMDGPU_PL_OA , + adev->gds.oa.total_size >>PAGE_SHIFT ); +if (r) { +DRM_ERROR ("Failed initializing oa heap.\n" ); +return r; + } } r =amdgpu_ttm_debugfs_init (adev);
@@ -1206,9 +1214,12 @@ void amdgpu_ttm_fini(struct amdgpu_device *adev) }ttm_bo_clean_mm (&adev->mman.bdev,TTM_PL_VRAM );ttm_bo_clean_mm (&adev->mman.bdev,TTM_PL_TT ); -ttm_bo_clean_mm (&adev->mman.bdev,AMDGPU_PL_GDS ); -ttm_bo_clean_mm (&adev->mman.bdev,AMDGPU_PL_GWS ); -ttm_bo_clean_mm (&adev->mman.bdev,AMDGPU_PL_OA ); +if (adev->gds.mem.total_size) +ttm_bo_clean_mm (&adev->mman.bdev,AMDGPU_PL_GDS ); +if (adev->gds.gws.total_size) +ttm_bo_clean_mm (&adev->mman.bdev,AMDGPU_PL_GWS ); +if (adev->gds.oa.total_size) +ttm_bo_clean_mm (&adev->mman.bdev,AMDGPU_PL_OA );ttm_bo_device_release (&adev->mman.bdev);amdgpu_gart_fini (adev);amdgpu_ttm_global_fini (adev);
Signature · 6 lines
2.5.5 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Christian König
Reviewed-byAm 15.03.2017 um 14:56 schrieb Alex Deucher:
Quoted 4 lines
Leftover from gfx7 code. gfx6 never sets up the gds buffers in the first place.
Signed-off-by Alex Deucher <[email protected]>
Quoted 9 lines
--- drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | 4 ---- 1 file changed, 4 deletions(-)drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c +0
-0
drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c static int gfx_v6_0_sw_fini(void *handle) · line 3313
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c +0
-4@@ -3308,10 +3308,6 @@ static int gfx_v6_0_sw_fini(void *handle)int i;struct amdgpu_device *adev = (struct amdgpu_device *)handle; -amdgpu_bo_unref (&adev->gds.oa_gfx_bo); -amdgpu_bo_unref (&adev->gds.gws_gfx_bo); -amdgpu_bo_unref (&adev->gds.gds_gfx_bo); -for (i =0 ; i < adev->gfx.num_gfx_rings; i++)amdgpu_ring_fini (&adev->gfx.gfx_ring[i]);for (i =0 ; i < adev->gfx.num_compute_rings; i++)
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx