diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2011-02-15 18:10:20 -0500 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2011-02-24 15:45:37 -0500 |
commit | a67047883410ee37d27806bb8415a84673934b4f (patch) | |
tree | 03dfd0e94e4a78d54dc171dbdccbb3982eefd7e1 /drivers/gpu | |
parent | d550c41e4ff11fe69b5f92868157253d27937d1f (diff) |
drm/nv50: simplify bo moves now that they're all through the vm
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bo.c | 26 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_dma.c | 10 |
2 files changed, 15 insertions, 21 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index 897c55509a6b..931dade12edd 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c | |||
@@ -497,15 +497,6 @@ nouveau_bo_move_accel_cleanup(struct nouveau_channel *chan, | |||
497 | return ret; | 497 | return ret; |
498 | } | 498 | } |
499 | 499 | ||
500 | static inline uint32_t | ||
501 | nouveau_bo_mem_ctxdma(struct ttm_buffer_object *bo, | ||
502 | struct nouveau_channel *chan, struct ttm_mem_reg *mem) | ||
503 | { | ||
504 | if (mem->mem_type == TTM_PL_TT) | ||
505 | return chan->gart_handle; | ||
506 | return chan->vram_handle; | ||
507 | } | ||
508 | |||
509 | static int | 500 | static int |
510 | nvc0_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo, | 501 | nvc0_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo, |
511 | struct ttm_mem_reg *old_mem, struct ttm_mem_reg *new_mem) | 502 | struct ttm_mem_reg *old_mem, struct ttm_mem_reg *new_mem) |
@@ -579,14 +570,6 @@ nv50_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo, | |||
579 | else | 570 | else |
580 | dst_offset += dev_priv->gart_info.aper_base; | 571 | dst_offset += dev_priv->gart_info.aper_base; |
581 | 572 | ||
582 | ret = RING_SPACE(chan, 3); | ||
583 | if (ret) | ||
584 | return ret; | ||
585 | |||
586 | BEGIN_RING(chan, NvSubM2MF, 0x0184, 2); | ||
587 | OUT_RING (chan, nouveau_bo_mem_ctxdma(bo, chan, old_mem)); | ||
588 | OUT_RING (chan, nouveau_bo_mem_ctxdma(bo, chan, new_mem)); | ||
589 | |||
590 | while (length) { | 573 | while (length) { |
591 | u32 amount, stride, height; | 574 | u32 amount, stride, height; |
592 | 575 | ||
@@ -666,6 +649,15 @@ nv50_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo, | |||
666 | return 0; | 649 | return 0; |
667 | } | 650 | } |
668 | 651 | ||
652 | static inline uint32_t | ||
653 | nouveau_bo_mem_ctxdma(struct ttm_buffer_object *bo, | ||
654 | struct nouveau_channel *chan, struct ttm_mem_reg *mem) | ||
655 | { | ||
656 | if (mem->mem_type == TTM_PL_TT) | ||
657 | return chan->gart_handle; | ||
658 | return chan->vram_handle; | ||
659 | } | ||
660 | |||
669 | static int | 661 | static int |
670 | nv04_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo, | 662 | nv04_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo, |
671 | struct ttm_mem_reg *old_mem, struct ttm_mem_reg *new_mem) | 663 | struct ttm_mem_reg *old_mem, struct ttm_mem_reg *new_mem) |
diff --git a/drivers/gpu/drm/nouveau/nouveau_dma.c b/drivers/gpu/drm/nouveau/nouveau_dma.c index 65699bfaaaea..1ef39be996ed 100644 --- a/drivers/gpu/drm/nouveau/nouveau_dma.c +++ b/drivers/gpu/drm/nouveau/nouveau_dma.c | |||
@@ -96,13 +96,15 @@ nouveau_dma_init(struct nouveau_channel *chan) | |||
96 | OUT_RING(chan, 0); | 96 | OUT_RING(chan, 0); |
97 | 97 | ||
98 | /* Initialise NV_MEMORY_TO_MEMORY_FORMAT */ | 98 | /* Initialise NV_MEMORY_TO_MEMORY_FORMAT */ |
99 | ret = RING_SPACE(chan, 4); | 99 | ret = RING_SPACE(chan, 6); |
100 | if (ret) | 100 | if (ret) |
101 | return ret; | 101 | return ret; |
102 | BEGIN_RING(chan, NvSubM2MF, NV_MEMORY_TO_MEMORY_FORMAT_NAME, 1); | 102 | BEGIN_RING(chan, NvSubM2MF, NV_MEMORY_TO_MEMORY_FORMAT_NAME, 1); |
103 | OUT_RING(chan, NvM2MF); | 103 | OUT_RING (chan, NvM2MF); |
104 | BEGIN_RING(chan, NvSubM2MF, NV_MEMORY_TO_MEMORY_FORMAT_DMA_NOTIFY, 1); | 104 | BEGIN_RING(chan, NvSubM2MF, NV_MEMORY_TO_MEMORY_FORMAT_DMA_NOTIFY, 3); |
105 | OUT_RING(chan, NvNotify0); | 105 | OUT_RING (chan, NvNotify0); |
106 | OUT_RING (chan, chan->vram_handle); | ||
107 | OUT_RING (chan, chan->gart_handle); | ||
106 | 108 | ||
107 | /* Sit back and pray the channel works.. */ | 109 | /* Sit back and pray the channel works.. */ |
108 | FIRE_RING(chan); | 110 | FIRE_RING(chan); |