diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/r300.c')
-rw-r--r-- | drivers/gpu/drm/radeon/r300.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c index 33f2b68c680b..400b26df652a 100644 --- a/drivers/gpu/drm/radeon/r300.c +++ b/drivers/gpu/drm/radeon/r300.c | |||
@@ -74,7 +74,7 @@ void rv370_pcie_gart_tlb_flush(struct radeon_device *rdev) | |||
74 | 74 | ||
75 | int rv370_pcie_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr) | 75 | int rv370_pcie_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr) |
76 | { | 76 | { |
77 | void __iomem *ptr = (void *)rdev->gart.table.vram.ptr; | 77 | void __iomem *ptr = rdev->gart.ptr; |
78 | 78 | ||
79 | if (i < 0 || i > rdev->gart.num_gpu_pages) { | 79 | if (i < 0 || i > rdev->gart.num_gpu_pages) { |
80 | return -EINVAL; | 80 | return -EINVAL; |
@@ -93,7 +93,7 @@ int rv370_pcie_gart_init(struct radeon_device *rdev) | |||
93 | { | 93 | { |
94 | int r; | 94 | int r; |
95 | 95 | ||
96 | if (rdev->gart.table.vram.robj) { | 96 | if (rdev->gart.robj) { |
97 | WARN(1, "RV370 PCIE GART already initialized\n"); | 97 | WARN(1, "RV370 PCIE GART already initialized\n"); |
98 | return 0; | 98 | return 0; |
99 | } | 99 | } |
@@ -116,7 +116,7 @@ int rv370_pcie_gart_enable(struct radeon_device *rdev) | |||
116 | uint32_t tmp; | 116 | uint32_t tmp; |
117 | int r; | 117 | int r; |
118 | 118 | ||
119 | if (rdev->gart.table.vram.robj == NULL) { | 119 | if (rdev->gart.robj == NULL) { |
120 | dev_err(rdev->dev, "No VRAM object for PCIE GART.\n"); | 120 | dev_err(rdev->dev, "No VRAM object for PCIE GART.\n"); |
121 | return -EINVAL; | 121 | return -EINVAL; |
122 | } | 122 | } |
@@ -154,7 +154,6 @@ int rv370_pcie_gart_enable(struct radeon_device *rdev) | |||
154 | void rv370_pcie_gart_disable(struct radeon_device *rdev) | 154 | void rv370_pcie_gart_disable(struct radeon_device *rdev) |
155 | { | 155 | { |
156 | u32 tmp; | 156 | u32 tmp; |
157 | int r; | ||
158 | 157 | ||
159 | WREG32_PCIE(RADEON_PCIE_TX_GART_START_LO, 0); | 158 | WREG32_PCIE(RADEON_PCIE_TX_GART_START_LO, 0); |
160 | WREG32_PCIE(RADEON_PCIE_TX_GART_END_LO, 0); | 159 | WREG32_PCIE(RADEON_PCIE_TX_GART_END_LO, 0); |
@@ -163,14 +162,7 @@ void rv370_pcie_gart_disable(struct radeon_device *rdev) | |||
163 | tmp = RREG32_PCIE(RADEON_PCIE_TX_GART_CNTL); | 162 | tmp = RREG32_PCIE(RADEON_PCIE_TX_GART_CNTL); |
164 | tmp |= RADEON_PCIE_TX_GART_UNMAPPED_ACCESS_DISCARD; | 163 | tmp |= RADEON_PCIE_TX_GART_UNMAPPED_ACCESS_DISCARD; |
165 | WREG32_PCIE(RADEON_PCIE_TX_GART_CNTL, tmp & ~RADEON_PCIE_TX_GART_EN); | 164 | WREG32_PCIE(RADEON_PCIE_TX_GART_CNTL, tmp & ~RADEON_PCIE_TX_GART_EN); |
166 | if (rdev->gart.table.vram.robj) { | 165 | radeon_gart_table_vram_unpin(rdev); |
167 | r = radeon_bo_reserve(rdev->gart.table.vram.robj, false); | ||
168 | if (likely(r == 0)) { | ||
169 | radeon_bo_kunmap(rdev->gart.table.vram.robj); | ||
170 | radeon_bo_unpin(rdev->gart.table.vram.robj); | ||
171 | radeon_bo_unreserve(rdev->gart.table.vram.robj); | ||
172 | } | ||
173 | } | ||
174 | } | 166 | } |
175 | 167 | ||
176 | void rv370_pcie_gart_fini(struct radeon_device *rdev) | 168 | void rv370_pcie_gart_fini(struct radeon_device *rdev) |