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 | * them until the pointers are equal again. |
43 | * them until the pointers are equal again. |
44 | */ |
44 | */ |
45 | static int radeon_debugfs_ring_init(struct radeon_device *rdev, struct radeon_ring *ring); |
45 | static int radeon_debugfs_ring_init(struct radeon_device *rdev, struct radeon_ring *ring); |
Line 46... | Line 46... | ||
46 | 46 | ||
47 | /** |
- | |
48 | * radeon_ring_write - write a value to the ring |
- | |
49 | * |
- | |
50 | * @ring: radeon_ring structure holding ring information |
- | |
51 | * @v: dword (dw) value to write |
- | |
52 | * |
- | |
53 | * Write a value to the requested ring buffer (all asics). |
- | |
54 | */ |
- | |
55 | void radeon_ring_write(struct radeon_ring *ring, uint32_t v) |
- | |
56 | { |
- | |
57 | #if DRM_DEBUG_CODE |
- | |
58 | if (ring->count_dw <= 0) { |
- | |
59 | DRM_ERROR("radeon: writing more dwords to the ring than expected!\n"); |
- | |
60 | } |
- | |
61 | #endif |
- | |
62 | ring->ring[ring->wptr++] = v; |
- | |
63 | ring->wptr &= ring->ptr_mask; |
- | |
64 | ring->count_dw--; |
- | |
65 | ring->ring_free_dw--; |
- | |
66 | } |
- | |
67 | - | ||
68 | /** |
47 | /** |
69 | * radeon_ring_supports_scratch_reg - check if the ring supports |
48 | * radeon_ring_supports_scratch_reg - check if the ring supports |
70 | * writing to scratch registers |
49 | * writing to scratch registers |
71 | * |
50 | * |
72 | * @rdev: radeon_device pointer |
51 | * @rdev: radeon_device pointer |
Line 402... | Line 381... | ||
402 | ring->rptr_offs = rptr_offs; |
381 | ring->rptr_offs = rptr_offs; |
403 | ring->nop = nop; |
382 | ring->nop = nop; |
404 | /* Allocate ring buffer */ |
383 | /* Allocate ring buffer */ |
405 | if (ring->ring_obj == NULL) { |
384 | if (ring->ring_obj == NULL) { |
406 | r = radeon_bo_create(rdev, ring->ring_size, PAGE_SIZE, true, |
385 | r = radeon_bo_create(rdev, ring->ring_size, PAGE_SIZE, true, |
407 | RADEON_GEM_DOMAIN_GTT, 0, |
386 | RADEON_GEM_DOMAIN_GTT, 0, NULL, |
408 | NULL, &ring->ring_obj); |
387 | NULL, &ring->ring_obj); |
409 | if (r) { |
388 | if (r) { |
410 | dev_err(rdev->dev, "(%d) ring create failed\n", r); |
389 | dev_err(rdev->dev, "(%d) ring create failed\n", r); |
411 | return r; |
390 | return r; |
412 | } |
391 | } |