aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/r300.c
diff options
context:
space:
mode:
authorPauli Nieminen <suokkos@gmail.com>2010-02-11 12:25:47 -0500
committerDave Airlie <airlied@redhat.com>2010-02-17 23:47:54 -0500
commit44ca7478d46aaad488d916f7262253e000ee60f9 (patch)
tree112f20f173526a087f3a9e8c419f0ad1875bd1cb /drivers/gpu/drm/radeon/r300.c
parentd80eeb0f347b6effa06e11e7cbcb2e6c559bf404 (diff)
drm/radeon: Add asic hook for dma copy to r200 cards.
r200 cards have dma engine which can be used to tranfer data between vram and system memory. r300 dma engine registers match r200 dma engine. Enabling dma copy for r200 is simple as hooking r200 asic to already existing function r300_copy_dma. Rename r300_dma_copy to r200_dma_copyto reflect that supports starts from r200 cards. v2: Created a new asic object for r200 cards. Signed-off-by: Pauli Nieminen <suokkos@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/r300.c')
-rw-r--r--drivers/gpu/drm/radeon/r300.c44
1 files changed, 0 insertions, 44 deletions
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c
index 654aca1cdf0..a4f395226b3 100644
--- a/drivers/gpu/drm/radeon/r300.c
+++ b/drivers/gpu/drm/radeon/r300.c
@@ -201,50 +201,6 @@ void r300_fence_ring_emit(struct radeon_device *rdev,
201 radeon_ring_write(rdev, RADEON_SW_INT_FIRE); 201 radeon_ring_write(rdev, RADEON_SW_INT_FIRE);
202} 202}
203 203
204int r300_copy_dma(struct radeon_device *rdev,
205 uint64_t src_offset,
206 uint64_t dst_offset,
207 unsigned num_pages,
208 struct radeon_fence *fence)
209{
210 uint32_t size;
211 uint32_t cur_size;
212 int i, num_loops;
213 int r = 0;
214
215 /* radeon pitch is /64 */
216 size = num_pages << PAGE_SHIFT;
217 num_loops = DIV_ROUND_UP(size, 0x1FFFFF);
218 r = radeon_ring_lock(rdev, num_loops * 4 + 64);
219 if (r) {
220 DRM_ERROR("radeon: moving bo (%d).\n", r);
221 return r;
222 }
223 /* Must wait for 2D idle & clean before DMA or hangs might happen */
224 radeon_ring_write(rdev, PACKET0(RADEON_WAIT_UNTIL, 0 ));
225 radeon_ring_write(rdev, RADEON_WAIT_2D_IDLECLEAN);
226 for (i = 0; i < num_loops; i++) {
227 cur_size = size;
228 if (cur_size > 0x1FFFFF) {
229 cur_size = 0x1FFFFF;
230 }
231 size -= cur_size;
232 radeon_ring_write(rdev, PACKET0(0x720, 2));
233 radeon_ring_write(rdev, src_offset);
234 radeon_ring_write(rdev, dst_offset);
235 radeon_ring_write(rdev, cur_size | (1 << 31) | (1 << 30));
236 src_offset += cur_size;
237 dst_offset += cur_size;
238 }
239 radeon_ring_write(rdev, PACKET0(RADEON_WAIT_UNTIL, 0));
240 radeon_ring_write(rdev, RADEON_WAIT_DMA_GUI_IDLE);
241 if (fence) {
242 r = radeon_fence_emit(rdev, fence);
243 }
244 radeon_ring_unlock_commit(rdev);
245 return r;
246}
247
248void r300_ring_start(struct radeon_device *rdev) 204void r300_ring_start(struct radeon_device *rdev)
249{ 205{
250 unsigned gb_tile_config; 206 unsigned gb_tile_config;