Commit d7025d89 authored by Christian König's avatar Christian König Committed by Alex Deucher

drm/radeon: fix si_set_page v2

Handle requests that won't fit into a single packet.

v2: pe needs to increase as well.
Signed-off-by: default avatarChristian König <deathsimple@vodafone.de>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent f9fdffa5
...@@ -2808,26 +2808,31 @@ void si_vm_set_page(struct radeon_device *rdev, uint64_t pe, ...@@ -2808,26 +2808,31 @@ void si_vm_set_page(struct radeon_device *rdev, uint64_t pe,
{ {
struct radeon_ring *ring = &rdev->ring[rdev->asic->vm.pt_ring_index]; struct radeon_ring *ring = &rdev->ring[rdev->asic->vm.pt_ring_index];
uint32_t r600_flags = cayman_vm_page_flags(rdev, flags); uint32_t r600_flags = cayman_vm_page_flags(rdev, flags);
int i;
uint64_t value;
radeon_ring_write(ring, PACKET3(PACKET3_WRITE_DATA, 2 + count * 2)); while (count) {
radeon_ring_write(ring, (WRITE_DATA_ENGINE_SEL(0) | unsigned ndw = 2 + count * 2;
WRITE_DATA_DST_SEL(1))); if (ndw > 0x3FFE)
radeon_ring_write(ring, pe); ndw = 0x3FFE;
radeon_ring_write(ring, upper_32_bits(pe));
for (i = 0; i < count; ++i) { radeon_ring_write(ring, PACKET3(PACKET3_WRITE_DATA, ndw));
if (flags & RADEON_VM_PAGE_SYSTEM) { radeon_ring_write(ring, (WRITE_DATA_ENGINE_SEL(0) |
value = radeon_vm_map_gart(rdev, addr); WRITE_DATA_DST_SEL(1)));
value &= 0xFFFFFFFFFFFFF000ULL; radeon_ring_write(ring, pe);
} else if (flags & RADEON_VM_PAGE_VALID) radeon_ring_write(ring, upper_32_bits(pe));
value = addr; for (; ndw > 2; ndw -= 2, --count, pe += 8) {
else uint64_t value;
value = 0; if (flags & RADEON_VM_PAGE_SYSTEM) {
addr += incr; value = radeon_vm_map_gart(rdev, addr);
value |= r600_flags; value &= 0xFFFFFFFFFFFFF000ULL;
radeon_ring_write(ring, value); } else if (flags & RADEON_VM_PAGE_VALID)
radeon_ring_write(ring, upper_32_bits(value)); value = addr;
else
value = 0;
addr += incr;
value |= r600_flags;
radeon_ring_write(ring, value);
radeon_ring_write(ring, upper_32_bits(value));
}
} }
} }
......
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