drm/radeon/r6xx: fix DMA engine for ttm bo transfers
authorAlex Deucher <alexander.deucher@amd.com>
Wed, 2 Jan 2013 23:30:21 +0000 (18:30 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 3 Jan 2013 18:17:31 +0000 (13:17 -0500)
count must be a multiple of 2. Fixes crashes on
R6xx chips reported by a number of people.

Cc: Borislav Petkov <bp@alien8.de>
Cc: Markus Trippelsdorf <markus@trippelsdorf.de>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Tested-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/r600.c

index 2aaf147..9f4ce5e 100644 (file)
@@ -2636,8 +2636,8 @@ int r600_copy_dma(struct radeon_device *rdev,
 
        for (i = 0; i < num_loops; i++) {
                cur_size_in_dw = size_in_dw;
-               if (cur_size_in_dw > 0xFFFF)
-                       cur_size_in_dw = 0xFFFF;
+               if (cur_size_in_dw > 0xFFFE)
+                       cur_size_in_dw = 0xFFFE;
                size_in_dw -= cur_size_in_dw;
                radeon_ring_write(ring, DMA_PACKET(DMA_PACKET_COPY, 0, 0, cur_size_in_dw));
                radeon_ring_write(ring, dst_offset & 0xfffffffc);