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

Commit 4094dc2a authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Dave Airlie
Browse files

drm/ast: inline reservations

parent 5e338405
Loading
Loading
Loading
Loading
+18 −2
Original line number Diff line number Diff line
@@ -348,8 +348,24 @@ int ast_gem_create(struct drm_device *dev,
int ast_bo_pin(struct ast_bo *bo, u32 pl_flag, u64 *gpu_addr);
int ast_bo_unpin(struct ast_bo *bo);

int ast_bo_reserve(struct ast_bo *bo, bool no_wait);
void ast_bo_unreserve(struct ast_bo *bo);
static inline int ast_bo_reserve(struct ast_bo *bo, bool no_wait)
{
	int ret;

	ret = ttm_bo_reserve(&bo->bo, true, no_wait, false, 0);
	if (ret) {
		if (ret != -ERESTARTSYS && ret != -EBUSY)
			DRM_ERROR("reserve failed %p\n", bo);
		return ret;
	}
	return 0;
}

static inline void ast_bo_unreserve(struct ast_bo *bo)
{
	ttm_bo_unreserve(&bo->bo);
}

void ast_ttm_placement(struct ast_bo *bo, int domain);
int ast_bo_push_sysram(struct ast_bo *bo);
int ast_mmap(struct file *filp, struct vm_area_struct *vma);
+0 −18
Original line number Diff line number Diff line
@@ -303,24 +303,6 @@ void ast_ttm_placement(struct ast_bo *bo, int domain)
	bo->placement.num_busy_placement = c;
}

int ast_bo_reserve(struct ast_bo *bo, bool no_wait)
{
	int ret;

	ret = ttm_bo_reserve(&bo->bo, true, no_wait, false, 0);
	if (ret) {
		if (ret != -ERESTARTSYS && ret != -EBUSY)
			DRM_ERROR("reserve failed %p\n", bo);
		return ret;
	}
	return 0;
}

void ast_bo_unreserve(struct ast_bo *bo)
{
	ttm_bo_unreserve(&bo->bo);
}

int ast_bo_create(struct drm_device *dev, int size, int align,
		  uint32_t flags, struct ast_bo **pastbo)
{