aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/si_dma.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/radeon/si_dma.c')
-rw-r--r--drivers/gpu/drm/radeon/si_dma.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/gpu/drm/radeon/si_dma.c b/drivers/gpu/drm/radeon/si_dma.c
index 49909d23dfce..8e8f46133532 100644
--- a/drivers/gpu/drm/radeon/si_dma.c
+++ b/drivers/gpu/drm/radeon/si_dma.c
@@ -24,6 +24,7 @@
24#include <drm/drmP.h> 24#include <drm/drmP.h>
25#include "radeon.h" 25#include "radeon.h"
26#include "radeon_asic.h" 26#include "radeon_asic.h"
27#include "radeon_trace.h"
27#include "sid.h" 28#include "sid.h"
28 29
29u32 si_gpu_check_soft_reset(struct radeon_device *rdev); 30u32 si_gpu_check_soft_reset(struct radeon_device *rdev);
@@ -75,11 +76,12 @@ void si_dma_vm_set_page(struct radeon_device *rdev,
75 uint64_t addr, unsigned count, 76 uint64_t addr, unsigned count,
76 uint32_t incr, uint32_t flags) 77 uint32_t incr, uint32_t flags)
77{ 78{
78 uint32_t r600_flags = cayman_vm_page_flags(rdev, flags);
79 uint64_t value; 79 uint64_t value;
80 unsigned ndw; 80 unsigned ndw;
81 81
82 if (flags & RADEON_VM_PAGE_SYSTEM) { 82 trace_radeon_vm_set_page(pe, addr, count, incr, flags);
83
84 if (flags & R600_PTE_SYSTEM) {
83 while (count) { 85 while (count) {
84 ndw = count * 2; 86 ndw = count * 2;
85 if (ndw > 0xFFFFE) 87 if (ndw > 0xFFFFE)
@@ -90,16 +92,10 @@ void si_dma_vm_set_page(struct radeon_device *rdev,
90 ib->ptr[ib->length_dw++] = pe; 92 ib->ptr[ib->length_dw++] = pe;
91 ib->ptr[ib->length_dw++] = upper_32_bits(pe) & 0xff; 93 ib->ptr[ib->length_dw++] = upper_32_bits(pe) & 0xff;
92 for (; ndw > 0; ndw -= 2, --count, pe += 8) { 94 for (; ndw > 0; ndw -= 2, --count, pe += 8) {
93 if (flags & RADEON_VM_PAGE_SYSTEM) { 95 value = radeon_vm_map_gart(rdev, addr);
94 value = radeon_vm_map_gart(rdev, addr); 96 value &= 0xFFFFFFFFFFFFF000ULL;
95 value &= 0xFFFFFFFFFFFFF000ULL;
96 } else if (flags & RADEON_VM_PAGE_VALID) {
97 value = addr;
98 } else {
99 value = 0;
100 }
101 addr += incr; 97 addr += incr;
102 value |= r600_flags; 98 value |= flags;
103 ib->ptr[ib->length_dw++] = value; 99 ib->ptr[ib->length_dw++] = value;
104 ib->ptr[ib->length_dw++] = upper_32_bits(value); 100 ib->ptr[ib->length_dw++] = upper_32_bits(value);
105 } 101 }
@@ -110,7 +106,7 @@ void si_dma_vm_set_page(struct radeon_device *rdev,
110 if (ndw > 0xFFFFE) 106 if (ndw > 0xFFFFE)
111 ndw = 0xFFFFE; 107 ndw = 0xFFFFE;
112 108
113 if (flags & RADEON_VM_PAGE_VALID) 109 if (flags & R600_PTE_VALID)
114 value = addr; 110 value = addr;
115 else 111 else
116 value = 0; 112 value = 0;
@@ -118,7 +114,7 @@ void si_dma_vm_set_page(struct radeon_device *rdev,
118 ib->ptr[ib->length_dw++] = DMA_PTE_PDE_PACKET(ndw); 114 ib->ptr[ib->length_dw++] = DMA_PTE_PDE_PACKET(ndw);
119 ib->ptr[ib->length_dw++] = pe; /* dst addr */ 115 ib->ptr[ib->length_dw++] = pe; /* dst addr */
120 ib->ptr[ib->length_dw++] = upper_32_bits(pe) & 0xff; 116 ib->ptr[ib->length_dw++] = upper_32_bits(pe) & 0xff;
121 ib->ptr[ib->length_dw++] = r600_flags; /* mask */ 117 ib->ptr[ib->length_dw++] = flags; /* mask */
122 ib->ptr[ib->length_dw++] = 0; 118 ib->ptr[ib->length_dw++] = 0;
123 ib->ptr[ib->length_dw++] = value; /* value */ 119 ib->ptr[ib->length_dw++] = value; /* value */
124 ib->ptr[ib->length_dw++] = upper_32_bits(value); 120 ib->ptr[ib->length_dw++] = upper_32_bits(value);