Skip to content

Commit

Permalink
drm/radeon: add VM GART copy optimization to NI as well
Browse files Browse the repository at this point in the history
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Christian König authored and Alex Deucher committed Aug 5, 2014
1 parent ee26d83 commit 5a341be
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion drivers/gpu/drm/radeon/ni_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,26 @@ void cayman_dma_vm_set_page(struct radeon_device *rdev,

trace_radeon_vm_set_page(pe, addr, count, incr, flags);

if ((flags & R600_PTE_SYSTEM) || (count == 1)) {
if ((flags & R600_PTE_GART_MASK) == R600_PTE_GART_MASK) {
uint64_t src = rdev->gart.table_addr + (addr >> 12) * 8;
while (count) {
ndw = count * 2;
if (ndw > 0xFFFFE)
ndw = 0xFFFFE;

ib->ptr[ib->length_dw++] = DMA_PACKET(DMA_PACKET_COPY,
0, 0, ndw);
ib->ptr[ib->length_dw++] = lower_32_bits(pe);
ib->ptr[ib->length_dw++] = lower_32_bits(src);
ib->ptr[ib->length_dw++] = upper_32_bits(pe) & 0xff;
ib->ptr[ib->length_dw++] = upper_32_bits(src) & 0xff;

pe += ndw * 4;
src += ndw * 4;
count -= ndw / 2;
}

} else if ((flags & R600_PTE_SYSTEM) || (count == 1)) {
while (count) {
ndw = count * 2;
if (ndw > 0xFFFFE)
Expand Down

0 comments on commit 5a341be

Please sign in to comment.