diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2020-06-22 16:20:32 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2020-07-24 18:50:57 +1000 |
commit | fe4249afd6a94363e2ef7334d5257171da474bb6 (patch) | |
tree | 0d96a106f1fc975cc684af721e2a5dd33a2403e7 /drivers/gpu/drm/nouveau/nouveau_bo90b5.c | |
parent | 01c43a66eb7aac48b3a978158cfb45674b18a48e (diff) |
drm/nouveau/bo: convert move move() to new push macros
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_bo90b5.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bo90b5.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo90b5.c b/drivers/gpu/drm/nouveau/nouveau_bo90b5.c index 4c014f9a641f..34b79d561c7f 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo90b5.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo90b5.c @@ -23,6 +23,8 @@ #include "nouveau_dma.h" #include "nouveau_mem.h" +#include <nvif/push906f.h> + /*XXX: Fixup class to be compatible with NVIDIA's, which will allow sharing * code with KeplerDmaCopyA. */ @@ -32,6 +34,7 @@ nvc0_bo_move_copy(struct nouveau_channel *chan, struct ttm_buffer_object *bo, struct ttm_mem_reg *old_reg, struct ttm_mem_reg *new_reg) { struct nouveau_mem *mem = nouveau_mem(old_reg); + struct nvif_push *push = chan->chan.push; u64 src_offset = mem->vma[0].addr; u64 dst_offset = mem->vma[1].addr; u32 page_count = new_reg->num_pages; @@ -41,21 +44,19 @@ nvc0_bo_move_copy(struct nouveau_channel *chan, struct ttm_buffer_object *bo, while (page_count) { int line_count = (page_count > 8191) ? 8191 : page_count; - ret = RING_SPACE(chan, 11); + ret = PUSH_WAIT(push, 10); if (ret) return ret; - BEGIN_NVC0(chan, NvSubCopy, 0x030c, 8); - OUT_RING (chan, upper_32_bits(src_offset)); - OUT_RING (chan, lower_32_bits(src_offset)); - OUT_RING (chan, upper_32_bits(dst_offset)); - OUT_RING (chan, lower_32_bits(dst_offset)); - OUT_RING (chan, PAGE_SIZE); - OUT_RING (chan, PAGE_SIZE); - OUT_RING (chan, PAGE_SIZE); - OUT_RING (chan, line_count); - BEGIN_NVC0(chan, NvSubCopy, 0x0300, 1); - OUT_RING (chan, 0x00000110); + PUSH_NVSQ(push, NV90B5, 0x030c, upper_32_bits(src_offset), + 0x0310, lower_32_bits(src_offset), + 0x0314, upper_32_bits(dst_offset), + 0x0318, lower_32_bits(dst_offset), + 0x031c, PAGE_SIZE, + 0x0320, PAGE_SIZE, + 0x0324, PAGE_SIZE, + 0x0328, line_count); + PUSH_NVIM(push, NV90B5, 0x0300, 0x0110); page_count -= line_count; src_offset += (PAGE_SIZE * line_count); |