]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
drm/amdgpu: set allow_reserved_eviction and resv when bo allocation and cs
authorRoger He <Hongbo.He@amd.com>
Fri, 8 Dec 2017 05:31:52 +0000 (13:31 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 15 Dec 2017 22:10:54 +0000 (17:10 -0500)
enable eviction of other per VM BOs during allocation and allows
reaping of deleted BOs during CS.

Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Roger He <Hongbo.He@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c

index 44523a88ebb27a300a48483a9b6b1fd279a10425..5e539fc5b05f1b6e580f9d5d6d58a569d0066364 100644 (file)
@@ -343,7 +343,12 @@ static int amdgpu_cs_bo_validate(struct amdgpu_cs_parser *p,
                                 struct amdgpu_bo *bo)
 {
        struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev);
-       struct ttm_operation_ctx ctx = { true, false };
+       struct ttm_operation_ctx ctx = {
+               .interruptible = true,
+               .no_wait_gpu = false,
+               .allow_reserved_eviction = false,
+               .resv = bo->tbo.resv
+       };
        uint32_t domain;
        int r;
 
index dc0a8be98043ee3476d774b8d043cc83688c1d10..86340cfa6be7e06eebe90687d269727b0e139f6d 100644 (file)
@@ -327,7 +327,12 @@ static int amdgpu_bo_do_create(struct amdgpu_device *adev,
                               uint64_t init_value,
                               struct amdgpu_bo **bo_ptr)
 {
-       struct ttm_operation_ctx ctx = { !kernel, false };
+       struct ttm_operation_ctx ctx = {
+               .interruptible = !kernel,
+               .no_wait_gpu = false,
+               .allow_reserved_eviction = true,
+               .resv = resv
+       };
        struct amdgpu_bo *bo;
        enum ttm_bo_type type;
        unsigned long page_align;