Lines Matching refs:ib
41 * IB
43 * commands are stored. You can put a pointer to the IB in the
44 * command ring and the hw will fetch the commands from the IB
52 * radeon_ib_get - request an IB (Indirect Buffer)
55 * @ring: ring index the IB is associated with
56 * @ib: IB object returned
57 * @size: requested IB size
59 * Request an IB (all asics). IBs are allocated using the
64 struct radeon_ib *ib, struct radeon_vm *vm,
69 r = radeon_sa_bo_new(rdev, &rdev->ring_tmp_bo, &ib->sa_bo, size, 256);
71 dev_err(rdev->dev, "failed to get a new IB (%d)\n", r);
75 radeon_sync_create(&ib->sync);
77 ib->ring = ring;
78 ib->fence = NULL;
79 ib->ptr = radeon_sa_bo_cpu_addr(ib->sa_bo);
80 ib->vm = vm;
82 /* ib pool is bound at RADEON_VA_IB_OFFSET in virtual address
85 ib->gpu_addr = ib->sa_bo->soffset + RADEON_VA_IB_OFFSET;
87 ib->gpu_addr = radeon_sa_bo_gpu_addr(ib->sa_bo);
89 ib->is_const_ib = false;
95 * radeon_ib_free - free an IB (Indirect Buffer)
98 * @ib: IB object to free
100 * Free an IB (all asics).
102 void radeon_ib_free(struct radeon_device *rdev, struct radeon_ib *ib)
104 radeon_sync_free(rdev, &ib->sync, ib->fence);
105 radeon_sa_bo_free(rdev, &ib->sa_bo, ib->fence);
106 radeon_fence_unref(&ib->fence);
110 * radeon_ib_schedule - schedule an IB (Indirect Buffer) on the ring
113 * @ib: IB object to schedule
114 * @const_ib: Const IB to schedule (SI only)
117 * Schedule an IB on the associated ring (all asics).
126 * IBs, one for the CE and one for the DE. If there is a CE IB (called
127 * a CONST_IB), it will be put on the ring prior to the DE IB. Prior
128 * to SI there was just a DE IB.
130 int radeon_ib_schedule(struct radeon_device *rdev, struct radeon_ib *ib,
133 struct radeon_ring *ring = &rdev->ring[ib->ring];
136 if (!ib->length_dw || !ring->ready) {
137 /* TODO: Nothings in the ib we should report. */
138 dev_err(rdev->dev, "couldn't schedule ib\n");
145 dev_err(rdev->dev, "scheduling IB failed (%d).\n", r);
150 if (ib->vm) {
152 vm_id_fence = radeon_vm_grab_id(rdev, ib->vm, ib->ring);
153 radeon_sync_fence(&ib->sync, vm_id_fence);
157 r = radeon_sync_rings(rdev, &ib->sync, ib->ring);
164 if (ib->vm)
165 radeon_vm_flush(rdev, ib->vm, ib->ring,
166 ib->sync.last_vm_update);
172 radeon_ring_ib_execute(rdev, ib->ring, ib);
173 r = radeon_fence_emit(rdev, &ib->fence, ib->ring);
175 dev_err(rdev->dev, "failed to emit fence for new IB (%d)\n", r);
180 const_ib->fence = radeon_fence_ref(ib->fence);
183 if (ib->vm)
184 radeon_vm_fence(rdev, ib->vm, ib->fence);
191 * radeon_ib_pool_init - Init the IB (Indirect Buffer) pool
239 * radeon_ib_pool_fini - Free the IB (Indirect Buffer) pool
260 * Test an IB (Indirect Buffer) on each ring.
263 * IB test fails.
284 DRM_ERROR("radeon: failed testing IB on GFX ring (%d).\n", r);
290 DRM_ERROR("radeon: failed testing IB on ring %d (%d).\n", i, r);