Lines Matching defs:rdev
49 static int radeon_debugfs_ring_init(struct radeon_device *rdev, struct radeon_ring *ring);
55 * @rdev: radeon_device pointer
61 bool radeon_ring_supports_scratch_reg(struct radeon_device *rdev,
77 * @rdev: radeon_device pointer
82 void radeon_ring_free_size(struct radeon_device *rdev, struct radeon_ring *ring)
84 uint32_t rptr = radeon_ring_get_rptr(rdev, ring);
94 radeon_ring_lockup_update(rdev, ring);
101 * @rdev: radeon_device pointer
108 int radeon_ring_alloc(struct radeon_device *rdev, struct radeon_ring *ring, unsigned ndw)
117 radeon_ring_free_size(rdev, ring);
120 radeon_ring_free_size(rdev, ring);
124 r = radeon_fence_wait_next(rdev, ring->idx);
136 * @rdev: radeon_device pointer
144 int radeon_ring_lock(struct radeon_device *rdev, struct radeon_ring *ring, unsigned ndw)
148 mutex_lock(&rdev->ring_lock);
149 r = radeon_ring_alloc(rdev, ring, ndw);
151 mutex_unlock(&rdev->ring_lock);
161 * @rdev: radeon_device pointer
168 void radeon_ring_commit(struct radeon_device *rdev, struct radeon_ring *ring,
174 if (hdp_flush && rdev->asic->ring[ring->idx]->hdp_flush)
175 rdev->asic->ring[ring->idx]->hdp_flush(rdev, ring);
184 if (hdp_flush && rdev->asic->mmio_hdp_flush)
185 rdev->asic->mmio_hdp_flush(rdev);
186 radeon_ring_set_wptr(rdev, ring);
194 * @rdev: radeon_device pointer
200 void radeon_ring_unlock_commit(struct radeon_device *rdev, struct radeon_ring *ring,
203 radeon_ring_commit(rdev, ring, hdp_flush);
204 mutex_unlock(&rdev->ring_lock);
226 void radeon_ring_unlock_undo(struct radeon_device *rdev, struct radeon_ring *ring)
229 mutex_unlock(&rdev->ring_lock);
239 void radeon_ring_lockup_update(struct radeon_device *rdev,
242 atomic_set(&ring->last_rptr, radeon_ring_get_rptr(rdev, ring));
248 * @rdev: radeon device structure
252 bool radeon_ring_test_lockup(struct radeon_device *rdev, struct radeon_ring *ring)
254 uint32_t rptr = radeon_ring_get_rptr(rdev, ring);
260 radeon_ring_lockup_update(rdev, ring);
266 dev_err(rdev->dev, "ring %d stalled for more than %llumsec\n",
277 * @rdev: radeon_device pointer
282 unsigned radeon_ring_backup(struct radeon_device *rdev, struct radeon_ring *ring,
288 mutex_lock(&rdev->ring_lock);
292 mutex_unlock(&rdev->ring_lock);
297 if (!radeon_fence_count_emitted(rdev, ring->idx)) {
298 mutex_unlock(&rdev->ring_lock);
305 else if (rdev->wb.enabled)
309 mutex_unlock(&rdev->ring_lock);
317 mutex_unlock(&rdev->ring_lock);
324 mutex_unlock(&rdev->ring_lock);
332 mutex_unlock(&rdev->ring_lock);
339 * @rdev: radeon_device pointer
346 int radeon_ring_restore(struct radeon_device *rdev, struct radeon_ring *ring,
355 r = radeon_ring_lock(rdev, ring, size);
363 radeon_ring_unlock_commit(rdev, ring, false);
371 * @rdev: radeon_device pointer
380 int radeon_ring_init(struct radeon_device *rdev, struct radeon_ring *ring, unsigned ring_size,
390 r = radeon_bo_create(rdev, ring->ring_size, PAGE_SIZE, true,
394 dev_err(rdev->dev, "(%d) ring create failed\n", r);
404 dev_err(rdev->dev, "(%d) ring pin failed\n", r);
411 dev_err(rdev->dev, "(%d) ring map failed\n", r);
417 if (rdev->wb.enabled) {
419 ring->next_rptr_gpu_addr = rdev->wb.gpu_addr + index;
420 ring->next_rptr_cpu_addr = &rdev->wb.wb[index/4];
422 if (radeon_debugfs_ring_init(rdev, ring)) {
425 radeon_ring_lockup_update(rdev, ring);
432 * @rdev: radeon_device pointer
437 void radeon_ring_fini(struct radeon_device *rdev, struct radeon_ring *ring)
442 mutex_lock(&rdev->ring_lock);
447 mutex_unlock(&rdev->ring_lock);
469 struct radeon_device *rdev = dev->dev_private;
471 struct radeon_ring *ring = &rdev->ring[ridx];
476 radeon_ring_free_size(rdev, ring);
479 wptr = radeon_ring_get_wptr(rdev, ring);
483 rptr = radeon_ring_get_rptr(rdev, ring);
544 static int radeon_debugfs_ring_init(struct radeon_device *rdev, struct radeon_ring *ring)
553 if (&rdev->ring[ridx] != ring)
556 r = radeon_debugfs_add_files(rdev, info, 1);