OSDN Git Service

drm/amdgpu: create GDS, GWS and OA in system domain
authorChristian König <christian.koenig@amd.com>
Thu, 16 May 2019 08:25:35 +0000 (10:25 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 11 Jun 2019 16:52:12 +0000 (11:52 -0500)
And only move them in on validation. This allows for better control
when multiple processes are fighting over those resources.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Tested-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c

index 93b2c5a..3049342 100644 (file)
@@ -495,7 +495,11 @@ static int amdgpu_bo_do_create(struct amdgpu_device *adev,
 #endif
 
        bo->tbo.bdev = &adev->mman.bdev;
-       amdgpu_bo_placement_from_domain(bo, bp->domain);
+       if (bp->domain & (AMDGPU_GEM_DOMAIN_GWS | AMDGPU_GEM_DOMAIN_OA |
+                         AMDGPU_GEM_DOMAIN_GDS))
+               amdgpu_bo_placement_from_domain(bo, AMDGPU_GEM_DOMAIN_CPU);
+       else
+               amdgpu_bo_placement_from_domain(bo, bp->domain);
        if (bp->type == ttm_bo_type_kernel)
                bo->tbo.priority = 1;