summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nouveau_bo74c1.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2020-06-22 09:20:32 +0300
committerBen Skeggs <bskeggs@redhat.com>2020-07-24 11:50:57 +0300
commitfe4249afd6a94363e2ef7334d5257171da474bb6 (patch)
tree0d96a106f1fc975cc684af721e2a5dd33a2403e7 /drivers/gpu/drm/nouveau/nouveau_bo74c1.c
parent01c43a66eb7aac48b3a978158cfb45674b18a48e (diff)
downloadlinux-fe4249afd6a94363e2ef7334d5257171da474bb6.tar.xz
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_bo74c1.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_bo74c1.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo74c1.c b/drivers/gpu/drm/nouveau/nouveau_bo74c1.c
index 7528a03229b2..1b5fd78ddcba 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo74c1.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bo74c1.c
@@ -30,20 +30,25 @@
#include "nouveau_dma.h"
#include "nouveau_mem.h"
+#include <nvif/push206e.h>
+
int
nv84_bo_move_exec(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);
- int ret = RING_SPACE(chan, 7);
- if (ret == 0) {
- BEGIN_NV04(chan, NvSubCopy, 0x0304, 6);
- OUT_RING (chan, new_reg->num_pages << PAGE_SHIFT);
- OUT_RING (chan, upper_32_bits(mem->vma[0].addr));
- OUT_RING (chan, lower_32_bits(mem->vma[0].addr));
- OUT_RING (chan, upper_32_bits(mem->vma[1].addr));
- OUT_RING (chan, lower_32_bits(mem->vma[1].addr));
- OUT_RING (chan, 0x00000000 /* MODE_COPY, QUERY_NONE */);
- }
- return ret;
+ struct nvif_push *push = chan->chan.push;
+ int ret;
+
+ ret = PUSH_WAIT(push, 7);
+ if (ret)
+ return ret;
+
+ PUSH_NVSQ(push, NV74C1, 0x0304, new_reg->num_pages << PAGE_SHIFT,
+ 0x0308, upper_32_bits(mem->vma[0].addr),
+ 0x030c, lower_32_bits(mem->vma[0].addr),
+ 0x0310, upper_32_bits(mem->vma[1].addr),
+ 0x0314, lower_32_bits(mem->vma[1].addr),
+ 0x0318, 0x00000000 /* MODE_COPY, QUERY_NONE */);
+ return 0;
}