Commit 91f0c245 authored by Christian König's avatar Christian König
Browse files

drm/radeon: use DMA_RESV_USAGE_KERNEL

parent c35fcfa3
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -219,7 +219,12 @@ int radeon_bo_create(struct radeon_device *rdev,
int radeon_bo_kmap(struct radeon_bo *bo, void **ptr)
{
	bool is_iomem;
	int r;
	long r;

	r = dma_resv_wait_timeout(bo->tbo.base.resv, DMA_RESV_USAGE_KERNEL,
				  false, MAX_SCHEDULE_TIMEOUT);
	if (r < 0)
		return r;

	if (bo->kptr) {
		if (ptr) {
+2 −10
Original line number Diff line number Diff line
@@ -470,24 +470,16 @@ static int radeon_uvd_cs_msg(struct radeon_cs_parser *p, struct radeon_bo *bo,
	int32_t *msg, msg_type, handle;
	unsigned img_size = 0;
	void *ptr;
	long r;
	int i;
	int i, r;

	if (offset & 0x3F) {
		DRM_ERROR("UVD messages must be 64 byte aligned!\n");
		return -EINVAL;
	}

	r = dma_resv_wait_timeout(bo->tbo.base.resv, DMA_RESV_USAGE_WRITE,
				  false, MAX_SCHEDULE_TIMEOUT);
	if (r <= 0) {
		DRM_ERROR("Failed waiting for UVD message (%ld)!\n", r);
		return r ? r : -ETIME;
	}

	r = radeon_bo_kmap(bo, &ptr);
	if (r) {
		DRM_ERROR("Failed mapping the UVD message (%ld)!\n", r);
		DRM_ERROR("Failed mapping the UVD message (%d)!\n", r);
		return r;
	}