Commit 336ac942 authored by Gerd Hoffmann's avatar Gerd Hoffmann
parent e532a135
...@@ -122,7 +122,7 @@ static void radeon_benchmark_move(struct radeon_device *rdev, unsigned size, ...@@ -122,7 +122,7 @@ static void radeon_benchmark_move(struct radeon_device *rdev, unsigned size,
if (rdev->asic->copy.dma) { if (rdev->asic->copy.dma) {
time = radeon_benchmark_do_move(rdev, size, saddr, daddr, time = radeon_benchmark_do_move(rdev, size, saddr, daddr,
RADEON_BENCHMARK_COPY_DMA, n, RADEON_BENCHMARK_COPY_DMA, n,
dobj->tbo.resv); dobj->tbo.base.resv);
if (time < 0) if (time < 0)
goto out_cleanup; goto out_cleanup;
if (time > 0) if (time > 0)
...@@ -133,7 +133,7 @@ static void radeon_benchmark_move(struct radeon_device *rdev, unsigned size, ...@@ -133,7 +133,7 @@ static void radeon_benchmark_move(struct radeon_device *rdev, unsigned size,
if (rdev->asic->copy.blit) { if (rdev->asic->copy.blit) {
time = radeon_benchmark_do_move(rdev, size, saddr, daddr, time = radeon_benchmark_do_move(rdev, size, saddr, daddr,
RADEON_BENCHMARK_COPY_BLIT, n, RADEON_BENCHMARK_COPY_BLIT, n,
dobj->tbo.resv); dobj->tbo.base.resv);
if (time < 0) if (time < 0)
goto out_cleanup; goto out_cleanup;
if (time > 0) if (time > 0)
......
...@@ -257,7 +257,7 @@ static int radeon_cs_sync_rings(struct radeon_cs_parser *p) ...@@ -257,7 +257,7 @@ static int radeon_cs_sync_rings(struct radeon_cs_parser *p)
list_for_each_entry(reloc, &p->validated, tv.head) { list_for_each_entry(reloc, &p->validated, tv.head) {
struct reservation_object *resv; struct reservation_object *resv;
resv = reloc->robj->tbo.resv; resv = reloc->robj->tbo.base.resv;
r = radeon_sync_resv(p->rdev, &p->ib.sync, resv, r = radeon_sync_resv(p->rdev, &p->ib.sync, resv,
reloc->tv.num_shared); reloc->tv.num_shared);
if (r) if (r)
......
...@@ -533,7 +533,7 @@ static int radeon_crtc_page_flip_target(struct drm_crtc *crtc, ...@@ -533,7 +533,7 @@ static int radeon_crtc_page_flip_target(struct drm_crtc *crtc,
DRM_ERROR("failed to pin new rbo buffer before flip\n"); DRM_ERROR("failed to pin new rbo buffer before flip\n");
goto cleanup; goto cleanup;
} }
work->fence = dma_fence_get(reservation_object_get_excl(new_rbo->tbo.resv)); work->fence = dma_fence_get(reservation_object_get_excl(new_rbo->tbo.base.resv));
radeon_bo_get_tiling_flags(new_rbo, &tiling_flags, NULL); radeon_bo_get_tiling_flags(new_rbo, &tiling_flags, NULL);
radeon_bo_unreserve(new_rbo); radeon_bo_unreserve(new_rbo);
......
...@@ -114,7 +114,7 @@ static int radeon_gem_set_domain(struct drm_gem_object *gobj, ...@@ -114,7 +114,7 @@ static int radeon_gem_set_domain(struct drm_gem_object *gobj,
} }
if (domain == RADEON_GEM_DOMAIN_CPU) { if (domain == RADEON_GEM_DOMAIN_CPU) {
/* Asking for cpu access wait for object idle */ /* Asking for cpu access wait for object idle */
r = reservation_object_wait_timeout_rcu(robj->tbo.resv, true, true, 30 * HZ); r = reservation_object_wait_timeout_rcu(robj->tbo.base.resv, true, true, 30 * HZ);
if (!r) if (!r)
r = -EBUSY; r = -EBUSY;
...@@ -449,7 +449,7 @@ int radeon_gem_busy_ioctl(struct drm_device *dev, void *data, ...@@ -449,7 +449,7 @@ int radeon_gem_busy_ioctl(struct drm_device *dev, void *data,
} }
robj = gem_to_radeon_bo(gobj); robj = gem_to_radeon_bo(gobj);
r = reservation_object_test_signaled_rcu(robj->tbo.resv, true); r = reservation_object_test_signaled_rcu(robj->tbo.base.resv, true);
if (r == 0) if (r == 0)
r = -EBUSY; r = -EBUSY;
else else
...@@ -478,7 +478,7 @@ int radeon_gem_wait_idle_ioctl(struct drm_device *dev, void *data, ...@@ -478,7 +478,7 @@ int radeon_gem_wait_idle_ioctl(struct drm_device *dev, void *data,
} }
robj = gem_to_radeon_bo(gobj); robj = gem_to_radeon_bo(gobj);
ret = reservation_object_wait_timeout_rcu(robj->tbo.resv, true, true, 30 * HZ); ret = reservation_object_wait_timeout_rcu(robj->tbo.base.resv, true, true, 30 * HZ);
if (ret == 0) if (ret == 0)
r = -EBUSY; r = -EBUSY;
else if (ret < 0) else if (ret < 0)
......
...@@ -163,7 +163,7 @@ static int radeon_mn_invalidate_range_start(struct mmu_notifier *mn, ...@@ -163,7 +163,7 @@ static int radeon_mn_invalidate_range_start(struct mmu_notifier *mn,
continue; continue;
} }
r = reservation_object_wait_timeout_rcu(bo->tbo.resv, r = reservation_object_wait_timeout_rcu(bo->tbo.base.resv,
true, false, MAX_SCHEDULE_TIMEOUT); true, false, MAX_SCHEDULE_TIMEOUT);
if (r <= 0) if (r <= 0)
DRM_ERROR("(%ld) failed to wait for user bo\n", r); DRM_ERROR("(%ld) failed to wait for user bo\n", r);
......
...@@ -262,7 +262,6 @@ int radeon_bo_create(struct radeon_device *rdev, ...@@ -262,7 +262,6 @@ int radeon_bo_create(struct radeon_device *rdev,
r = ttm_bo_init(&rdev->mman.bdev, &bo->tbo, size, type, r = ttm_bo_init(&rdev->mman.bdev, &bo->tbo, size, type,
&bo->placement, page_align, !kernel, acc_size, &bo->placement, page_align, !kernel, acc_size,
sg, resv, &radeon_ttm_bo_destroy); sg, resv, &radeon_ttm_bo_destroy);
bo->tbo.base.resv = bo->tbo.resv;
up_read(&rdev->pm.mclk_lock); up_read(&rdev->pm.mclk_lock);
if (unlikely(r != 0)) { if (unlikely(r != 0)) {
return r; return r;
...@@ -611,7 +610,7 @@ int radeon_bo_get_surface_reg(struct radeon_bo *bo) ...@@ -611,7 +610,7 @@ int radeon_bo_get_surface_reg(struct radeon_bo *bo)
int steal; int steal;
int i; int i;
reservation_object_assert_held(bo->tbo.resv); reservation_object_assert_held(bo->tbo.base.resv);
if (!bo->tiling_flags) if (!bo->tiling_flags)
return 0; return 0;
...@@ -737,7 +736,7 @@ void radeon_bo_get_tiling_flags(struct radeon_bo *bo, ...@@ -737,7 +736,7 @@ void radeon_bo_get_tiling_flags(struct radeon_bo *bo,
uint32_t *tiling_flags, uint32_t *tiling_flags,
uint32_t *pitch) uint32_t *pitch)
{ {
reservation_object_assert_held(bo->tbo.resv); reservation_object_assert_held(bo->tbo.base.resv);
if (tiling_flags) if (tiling_flags)
*tiling_flags = bo->tiling_flags; *tiling_flags = bo->tiling_flags;
...@@ -749,7 +748,7 @@ int radeon_bo_check_tiling(struct radeon_bo *bo, bool has_moved, ...@@ -749,7 +748,7 @@ int radeon_bo_check_tiling(struct radeon_bo *bo, bool has_moved,
bool force_drop) bool force_drop)
{ {
if (!force_drop) if (!force_drop)
reservation_object_assert_held(bo->tbo.resv); reservation_object_assert_held(bo->tbo.base.resv);
if (!(bo->tiling_flags & RADEON_TILING_SURFACE)) if (!(bo->tiling_flags & RADEON_TILING_SURFACE))
return 0; return 0;
...@@ -871,7 +870,7 @@ int radeon_bo_wait(struct radeon_bo *bo, u32 *mem_type, bool no_wait) ...@@ -871,7 +870,7 @@ int radeon_bo_wait(struct radeon_bo *bo, u32 *mem_type, bool no_wait)
void radeon_bo_fence(struct radeon_bo *bo, struct radeon_fence *fence, void radeon_bo_fence(struct radeon_bo *bo, struct radeon_fence *fence,
bool shared) bool shared)
{ {
struct reservation_object *resv = bo->tbo.resv; struct reservation_object *resv = bo->tbo.base.resv;
if (shared) if (shared)
reservation_object_add_shared_fence(resv, &fence->base); reservation_object_add_shared_fence(resv, &fence->base);
......
...@@ -120,11 +120,11 @@ static void radeon_do_test_moves(struct radeon_device *rdev, int flag) ...@@ -120,11 +120,11 @@ static void radeon_do_test_moves(struct radeon_device *rdev, int flag)
if (ring == R600_RING_TYPE_DMA_INDEX) if (ring == R600_RING_TYPE_DMA_INDEX)
fence = radeon_copy_dma(rdev, gtt_addr, vram_addr, fence = radeon_copy_dma(rdev, gtt_addr, vram_addr,
size / RADEON_GPU_PAGE_SIZE, size / RADEON_GPU_PAGE_SIZE,
vram_obj->tbo.resv); vram_obj->tbo.base.resv);
else else
fence = radeon_copy_blit(rdev, gtt_addr, vram_addr, fence = radeon_copy_blit(rdev, gtt_addr, vram_addr,
size / RADEON_GPU_PAGE_SIZE, size / RADEON_GPU_PAGE_SIZE,
vram_obj->tbo.resv); vram_obj->tbo.base.resv);
if (IS_ERR(fence)) { if (IS_ERR(fence)) {
DRM_ERROR("Failed GTT->VRAM copy %d\n", i); DRM_ERROR("Failed GTT->VRAM copy %d\n", i);
r = PTR_ERR(fence); r = PTR_ERR(fence);
...@@ -171,11 +171,11 @@ static void radeon_do_test_moves(struct radeon_device *rdev, int flag) ...@@ -171,11 +171,11 @@ static void radeon_do_test_moves(struct radeon_device *rdev, int flag)
if (ring == R600_RING_TYPE_DMA_INDEX) if (ring == R600_RING_TYPE_DMA_INDEX)
fence = radeon_copy_dma(rdev, vram_addr, gtt_addr, fence = radeon_copy_dma(rdev, vram_addr, gtt_addr,
size / RADEON_GPU_PAGE_SIZE, size / RADEON_GPU_PAGE_SIZE,
vram_obj->tbo.resv); vram_obj->tbo.base.resv);
else else
fence = radeon_copy_blit(rdev, vram_addr, gtt_addr, fence = radeon_copy_blit(rdev, vram_addr, gtt_addr,
size / RADEON_GPU_PAGE_SIZE, size / RADEON_GPU_PAGE_SIZE,
vram_obj->tbo.resv); vram_obj->tbo.base.resv);
if (IS_ERR(fence)) { if (IS_ERR(fence)) {
DRM_ERROR("Failed VRAM->GTT copy %d\n", i); DRM_ERROR("Failed VRAM->GTT copy %d\n", i);
r = PTR_ERR(fence); r = PTR_ERR(fence);
......
...@@ -244,7 +244,7 @@ static int radeon_move_blit(struct ttm_buffer_object *bo, ...@@ -244,7 +244,7 @@ static int radeon_move_blit(struct ttm_buffer_object *bo,
BUILD_BUG_ON((PAGE_SIZE % RADEON_GPU_PAGE_SIZE) != 0); BUILD_BUG_ON((PAGE_SIZE % RADEON_GPU_PAGE_SIZE) != 0);
num_pages = new_mem->num_pages * (PAGE_SIZE / RADEON_GPU_PAGE_SIZE); num_pages = new_mem->num_pages * (PAGE_SIZE / RADEON_GPU_PAGE_SIZE);
fence = radeon_copy(rdev, old_start, new_start, num_pages, bo->resv); fence = radeon_copy(rdev, old_start, new_start, num_pages, bo->base.resv);
if (IS_ERR(fence)) if (IS_ERR(fence))
return PTR_ERR(fence); return PTR_ERR(fence);
......
...@@ -477,7 +477,7 @@ static int radeon_uvd_cs_msg(struct radeon_cs_parser *p, struct radeon_bo *bo, ...@@ -477,7 +477,7 @@ static int radeon_uvd_cs_msg(struct radeon_cs_parser *p, struct radeon_bo *bo,
return -EINVAL; return -EINVAL;
} }
f = reservation_object_get_excl(bo->tbo.resv); f = reservation_object_get_excl(bo->tbo.base.resv);
if (f) { if (f) {
r = radeon_fence_wait((struct radeon_fence *)f, false); r = radeon_fence_wait((struct radeon_fence *)f, false);
if (r) { if (r) {
......
...@@ -702,7 +702,7 @@ int radeon_vm_update_page_directory(struct radeon_device *rdev, ...@@ -702,7 +702,7 @@ int radeon_vm_update_page_directory(struct radeon_device *rdev,
if (ib.length_dw != 0) { if (ib.length_dw != 0) {
radeon_asic_vm_pad_ib(rdev, &ib); radeon_asic_vm_pad_ib(rdev, &ib);
radeon_sync_resv(rdev, &ib.sync, pd->tbo.resv, true); radeon_sync_resv(rdev, &ib.sync, pd->tbo.base.resv, true);
WARN_ON(ib.length_dw > ndw); WARN_ON(ib.length_dw > ndw);
r = radeon_ib_schedule(rdev, &ib, NULL, false); r = radeon_ib_schedule(rdev, &ib, NULL, false);
if (r) { if (r) {
...@@ -830,8 +830,8 @@ static int radeon_vm_update_ptes(struct radeon_device *rdev, ...@@ -830,8 +830,8 @@ static int radeon_vm_update_ptes(struct radeon_device *rdev,
uint64_t pte; uint64_t pte;
int r; int r;
radeon_sync_resv(rdev, &ib->sync, pt->tbo.resv, true); radeon_sync_resv(rdev, &ib->sync, pt->tbo.base.resv, true);
r = reservation_object_reserve_shared(pt->tbo.resv, 1); r = reservation_object_reserve_shared(pt->tbo.base.resv, 1);
if (r) if (r)
return r; return r;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment