Commit 2ab91ada authored by Alex Deucher's avatar Alex Deucher

drm/radeon: re-enable PTE/PDE packet for set_page on cayman/TN

PTE/PDE doesn't support a single update (count = 1).  We had
previously disabled it since it we were hitting that case which
let to hangs.  The PTE/PDE packet is much more efficient for VM
updates where it can be used.
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 0cd9cb76
...@@ -2079,6 +2079,8 @@ void cayman_vm_set_page(struct radeon_device *rdev, ...@@ -2079,6 +2079,8 @@ void cayman_vm_set_page(struct radeon_device *rdev,
} }
} }
} else { } else {
if ((flags & RADEON_VM_PAGE_SYSTEM) ||
(count == 1)) {
while (count) { while (count) {
ndw = count * 2; ndw = count * 2;
if (ndw > 0xFFFFE) if (ndw > 0xFFFFE)
...@@ -2105,6 +2107,33 @@ void cayman_vm_set_page(struct radeon_device *rdev, ...@@ -2105,6 +2107,33 @@ void cayman_vm_set_page(struct radeon_device *rdev,
} }
while (ib->length_dw & 0x7) while (ib->length_dw & 0x7)
ib->ptr[ib->length_dw++] = DMA_PACKET(DMA_PACKET_NOP, 0, 0, 0); ib->ptr[ib->length_dw++] = DMA_PACKET(DMA_PACKET_NOP, 0, 0, 0);
} else {
while (count) {
ndw = count * 2;
if (ndw > 0xFFFFE)
ndw = 0xFFFFE;
if (flags & RADEON_VM_PAGE_VALID)
value = addr;
else
value = 0;
/* for physically contiguous pages (vram) */
ib->ptr[ib->length_dw++] = DMA_PTE_PDE_PACKET(ndw);
ib->ptr[ib->length_dw++] = pe; /* dst addr */
ib->ptr[ib->length_dw++] = upper_32_bits(pe) & 0xff;
ib->ptr[ib->length_dw++] = r600_flags; /* mask */
ib->ptr[ib->length_dw++] = 0;
ib->ptr[ib->length_dw++] = value; /* value */
ib->ptr[ib->length_dw++] = upper_32_bits(value);
ib->ptr[ib->length_dw++] = incr; /* increment size */
ib->ptr[ib->length_dw++] = 0;
pe += ndw * 4;
addr += (ndw / 2) * incr;
count -= ndw / 2;
}
}
while (ib->length_dw & 0x7)
ib->ptr[ib->length_dw++] = DMA_PACKET(DMA_PACKET_NOP, 0, 0, 0);
} }
} }
......
...@@ -684,6 +684,11 @@ ...@@ -684,6 +684,11 @@
(((vmid) & 0xF) << 20) | \ (((vmid) & 0xF) << 20) | \
(((n) & 0xFFFFF) << 0)) (((n) & 0xFFFFF) << 0))
#define DMA_PTE_PDE_PACKET(n) ((2 << 28) | \
(1 << 26) | \
(1 << 21) | \
(((n) & 0xFFFFF) << 0))
/* async DMA Packet types */ /* async DMA Packet types */
#define DMA_PACKET_WRITE 0x2 #define DMA_PACKET_WRITE 0x2
#define DMA_PACKET_COPY 0x3 #define DMA_PACKET_COPY 0x3
......
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