Subversion Repositories Kolibri OS

Rev

Rev 5078 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5078 Rev 5271
Line 43... Line 43...
43
 
43
 
44
	start_jiffies = jiffies;
44
	start_jiffies = jiffies;
45
	for (i = 0; i < n; i++) {
45
	for (i = 0; i < n; i++) {
46
		switch (flag) {
46
		switch (flag) {
47
		case RADEON_BENCHMARK_COPY_DMA:
47
		case RADEON_BENCHMARK_COPY_DMA:
48
			r = radeon_copy_dma(rdev, saddr, daddr,
48
			fence = radeon_copy_dma(rdev, saddr, daddr,
49
					    size / RADEON_GPU_PAGE_SIZE,
49
					    size / RADEON_GPU_PAGE_SIZE,
50
					    &fence);
50
						NULL);
51
			break;
51
			break;
52
		case RADEON_BENCHMARK_COPY_BLIT:
52
		case RADEON_BENCHMARK_COPY_BLIT:
53
			r = radeon_copy_blit(rdev, saddr, daddr,
53
			fence = radeon_copy_blit(rdev, saddr, daddr,
54
					     size / RADEON_GPU_PAGE_SIZE,
54
					     size / RADEON_GPU_PAGE_SIZE,
55
					     &fence);
55
						 NULL);
56
			break;
56
			break;
57
		default:
57
		default:
58
			DRM_ERROR("Unknown copy method\n");
58
			DRM_ERROR("Unknown copy method\n");
59
			r = -EINVAL;
59
			return -EINVAL;
60
		}
60
		}
61
		if (r)
61
		if (IS_ERR(fence))
-
 
62
			return PTR_ERR(fence);
62
			goto exit_do_move;
63
 
63
		r = radeon_fence_wait(fence, false);
-
 
64
		if (r)
-
 
65
			goto exit_do_move;
64
		r = radeon_fence_wait(fence, false);
-
 
65
		radeon_fence_unref(&fence);
-
 
66
		if (r)
66
		radeon_fence_unref(&fence);
67
			return r;
67
	}
68
	}
68
	end_jiffies = jiffies;
69
	end_jiffies = jiffies;
69
	r = jiffies_to_msecs(end_jiffies - start_jiffies);
-
 
70
 
-
 
71
exit_do_move:
-
 
72
	if (fence)
-
 
73
		radeon_fence_unref(&fence);
-
 
74
	return r;
70
	return jiffies_to_msecs(end_jiffies - start_jiffies);
Line 75... Line 71...
75
}
71
}
76
 
72
 
Line 98... Line 94...
98
 
94
 
Line 99... Line 95...
99
 
95
 
100
    ENTER();
96
    ENTER();
101
 
97
 
102
	n = RADEON_BENCHMARK_ITERATIONS;
98
	n = RADEON_BENCHMARK_ITERATIONS;
103
	r = radeon_bo_create(rdev, size, PAGE_SIZE, true, sdomain, 0, NULL, &sobj);
99
	r = radeon_bo_create(rdev, size, PAGE_SIZE, true, sdomain, 0, NULL, NULL, &sobj);
104
	if (r) {
100
	if (r) {
105
		goto out_cleanup;
101
		goto out_cleanup;
Line 110... Line 106...
110
	r = radeon_bo_pin(sobj, sdomain, &saddr);
106
	r = radeon_bo_pin(sobj, sdomain, &saddr);
111
	radeon_bo_unreserve(sobj);
107
	radeon_bo_unreserve(sobj);
112
	if (r) {
108
	if (r) {
113
		goto out_cleanup;
109
		goto out_cleanup;
114
	}
110
	}
115
	r = radeon_bo_create(rdev, size, PAGE_SIZE, true, ddomain, 0, NULL, &dobj);
111
	r = radeon_bo_create(rdev, size, PAGE_SIZE, true, ddomain, 0, NULL, NULL, &dobj);
116
	if (r) {
112
	if (r) {
117
		goto out_cleanup;
113
		goto out_cleanup;
118
	}
114
	}
119
	r = radeon_bo_reserve(dobj, false);
115
	r = radeon_bo_reserve(dobj, false);
120
	if (unlikely(r != 0))
116
	if (unlikely(r != 0))