Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 489797d5 authored by Dave Airlie's avatar Dave Airlie
Browse files

drm/radeon/prime: reserve/unreserve around pin



I finally got to test this code a bit more and hit the ttm
no reserved assert, so add the reservations around the pinning.

Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 0ec0612a
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -169,11 +169,17 @@ struct dma_buf *radeon_gem_prime_export(struct drm_device *dev,
	struct radeon_bo *bo = gem_to_radeon_bo(obj);
	int ret = 0;

	ret = radeon_bo_reserve(bo, false);
	if (unlikely(ret != 0))
		return ERR_PTR(ret);

	/* pin buffer into GTT */
	ret = radeon_bo_pin(bo, RADEON_GEM_DOMAIN_GTT, NULL);
	if (ret)
	if (ret) {
		radeon_bo_unreserve(bo);
		return ERR_PTR(ret);

	}
	radeon_bo_unreserve(bo);
	return dma_buf_export(bo, &radeon_dmabuf_ops, obj->size, flags);
}