Commit 01c43a66 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/bo: convert move init() to new push macros

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent 8b9d5d63
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
#include "nouveau_dma.h" #include "nouveau_dma.h"
#include "nouveau_drv.h" #include "nouveau_drv.h"
#include <nvif/push006c.h>
static inline uint32_t static inline uint32_t
nouveau_bo_mem_ctxdma(struct ttm_buffer_object *bo, nouveau_bo_mem_ctxdma(struct ttm_buffer_object *bo,
struct nouveau_channel *chan, struct ttm_mem_reg *reg) struct nouveau_channel *chan, struct ttm_mem_reg *reg)
...@@ -88,13 +90,14 @@ nv04_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo, ...@@ -88,13 +90,14 @@ nv04_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo,
int int
nv04_bo_move_init(struct nouveau_channel *chan, u32 handle) nv04_bo_move_init(struct nouveau_channel *chan, u32 handle)
{ {
int ret = RING_SPACE(chan, 4); struct nvif_push *push = chan->chan.push;
if (ret == 0) { int ret;
BEGIN_NV04(chan, NvSubCopy, 0x0000, 1);
OUT_RING (chan, handle);
BEGIN_NV04(chan, NvSubCopy, 0x0180, 1);
OUT_RING (chan, chan->drm->ntfy.handle);
}
ret = PUSH_WAIT(push, 4);
if (ret)
return ret; return ret;
PUSH_NVSQ(push, NV039, 0x0000, handle);
PUSH_NVSQ(push, NV039, 0x0180, chan->drm->ntfy.handle);
return 0;
} }
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
#include "nouveau_drv.h" #include "nouveau_drv.h"
#include "nouveau_mem.h" #include "nouveau_mem.h"
#include <nvif/push206e.h>
int int
nv50_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo, nv50_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo,
struct ttm_mem_reg *old_reg, struct ttm_mem_reg *new_reg) struct ttm_mem_reg *old_reg, struct ttm_mem_reg *new_reg)
...@@ -107,15 +109,16 @@ nv50_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo, ...@@ -107,15 +109,16 @@ nv50_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo,
int int
nv50_bo_move_init(struct nouveau_channel *chan, u32 handle) nv50_bo_move_init(struct nouveau_channel *chan, u32 handle)
{ {
int ret = RING_SPACE(chan, 6); struct nvif_push *push = chan->chan.push;
if (ret == 0) { int ret;
BEGIN_NV04(chan, NvSubCopy, 0x0000, 1);
OUT_RING (chan, handle);
BEGIN_NV04(chan, NvSubCopy, 0x0180, 3);
OUT_RING (chan, chan->drm->ntfy.handle);
OUT_RING (chan, chan->vram.handle);
OUT_RING (chan, chan->vram.handle);
}
ret = PUSH_WAIT(push, 6);
if (ret)
return ret; return ret;
PUSH_NVSQ(push, NV5039, 0x0000, handle);
PUSH_NVSQ(push, NV5039, 0x0180, chan->drm->ntfy.handle,
0x0184, chan->vram.handle,
0x0188, chan->vram.handle);
return 0;
} }
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
#include "nouveau_dma.h" #include "nouveau_dma.h"
#include "nouveau_mem.h" #include "nouveau_mem.h"
#include <nvif/push906f.h>
int int
nvc0_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo, nvc0_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo,
struct ttm_mem_reg *old_reg, struct ttm_mem_reg *new_reg) struct ttm_mem_reg *old_reg, struct ttm_mem_reg *new_reg)
...@@ -72,10 +74,13 @@ nvc0_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo, ...@@ -72,10 +74,13 @@ nvc0_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo,
int int
nvc0_bo_move_init(struct nouveau_channel *chan, u32 handle) nvc0_bo_move_init(struct nouveau_channel *chan, u32 handle)
{ {
int ret = RING_SPACE(chan, 2); struct nvif_push *push = chan->chan.push;
if (ret == 0) { int ret;
BEGIN_NVC0(chan, NvSubCopy, 0x0000, 1);
OUT_RING (chan, handle); ret = PUSH_WAIT(push, 2);
} if (ret)
return ret; return ret;
PUSH_NVSQ(push, NV9039, 0x0000, handle);
return 0;
} }
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
#include "nouveau_dma.h" #include "nouveau_dma.h"
#include "nouveau_mem.h" #include "nouveau_mem.h"
#include <nvif/push906f.h>
int int
nve0_bo_move_copy(struct nouveau_channel *chan, struct ttm_buffer_object *bo, nve0_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 ttm_mem_reg *old_reg, struct ttm_mem_reg *new_reg)
...@@ -54,11 +56,13 @@ nve0_bo_move_copy(struct nouveau_channel *chan, struct ttm_buffer_object *bo, ...@@ -54,11 +56,13 @@ nve0_bo_move_copy(struct nouveau_channel *chan, struct ttm_buffer_object *bo,
int int
nve0_bo_move_init(struct nouveau_channel *chan, u32 handle) nve0_bo_move_init(struct nouveau_channel *chan, u32 handle)
{ {
int ret = RING_SPACE(chan, 2); struct nvif_push *push = chan->chan.push;
if (ret == 0) { int ret;
BEGIN_NVC0(chan, NvSubCopy, 0x0000, 1);
OUT_RING (chan, handle & 0x0000ffff); ret = PUSH_WAIT(push, 2);
FIRE_RING (chan); if (ret)
}
return ret; return ret;
PUSH_NVSQ(push, NVA0B5, 0x0000, handle & 0x0000ffff);
return 0;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment