diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index fd9c4beeaaa4..ec9e45004bff 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | |||
@@ -1285,6 +1285,30 @@ void amdgpu_bo_fence(struct amdgpu_bo *bo, struct dma_fence *fence, | |||
1285 | } | 1285 | } |
1286 | 1286 | ||
1287 | /** | 1287 | /** |
1288 | * amdgpu_sync_wait_resv - Wait for BO reservation fences | ||
1289 | * | ||
1290 | * @bo: buffer object | ||
1291 | * @owner: fence owner | ||
1292 | * @intr: Whether the wait is interruptible | ||
1293 | * | ||
1294 | * Returns: | ||
1295 | * 0 on success, errno otherwise. | ||
1296 | */ | ||
1297 | int amdgpu_bo_sync_wait(struct amdgpu_bo *bo, void *owner, bool intr) | ||
1298 | { | ||
1299 | struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev); | ||
1300 | struct amdgpu_sync sync; | ||
1301 | int r; | ||
1302 | |||
1303 | amdgpu_sync_create(&sync); | ||
1304 | amdgpu_sync_resv(adev, &sync, bo->tbo.resv, owner, false); | ||
1305 | r = amdgpu_sync_wait(&sync, intr); | ||
1306 | amdgpu_sync_free(&sync); | ||
1307 | |||
1308 | return r; | ||
1309 | } | ||
1310 | |||
1311 | /** | ||
1288 | * amdgpu_bo_gpu_offset - return GPU offset of bo | 1312 | * amdgpu_bo_gpu_offset - return GPU offset of bo |
1289 | * @bo: amdgpu object for which we query the offset | 1313 | * @bo: amdgpu object for which we query the offset |
1290 | * | 1314 | * |