summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/dispnv50/corec57d.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2020-06-20 17:04:57 +1000
committerBen Skeggs <bskeggs@redhat.com>2020-07-24 18:50:53 +1000
commit5e691222eac66e730e0fa6bd10e7564f3db202d5 (patch)
tree9864a982e1ebc2218684135cc978f848e2012c10 /drivers/gpu/drm/nouveau/dispnv50/corec57d.c
parent3afb4db782a3bf4e6f14912d7aeb534264d2d2e3 (diff)
drm/nouveau/kms/nv50-: convert core init() 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/dispnv50/corec57d.c')
-rw-r--r--drivers/gpu/drm/nouveau/dispnv50/corec57d.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/drivers/gpu/drm/nouveau/dispnv50/corec57d.c b/drivers/gpu/drm/nouveau/dispnv50/corec57d.c
index e1c11eba0ce1..afc703a05fea 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/corec57d.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/corec57d.c
@@ -22,24 +22,28 @@
#include "core.h"
#include "head.h"
-static void
+#include <nvif/pushc37b.h>
+
+static int
corec57d_init(struct nv50_core *core)
{
+ struct nvif_push *push = core->chan.push;
const u32 windows = 8; /*XXX*/
- u32 *push, i;
- if ((push = evo_wait(&core->chan, 2 + 5 * windows))) {
- evo_mthd(push, 0x0208, 1);
- evo_data(push, core->chan.sync.handle);
- for (i = 0; i < windows; i++) {
- evo_mthd(push, 0x1004 + (i * 0x080), 2);
- evo_data(push, 0x0000000f);
- evo_data(push, 0x00000000);
- evo_mthd(push, 0x1010 + (i * 0x080), 1);
- evo_data(push, 0x00117fff);
- }
- evo_kick(push, &core->chan);
- core->assign_windows = true;
+ int ret, i;
+
+ if ((ret = PUSH_WAIT(push, 2 + windows * 5)))
+ return ret;
+
+ PUSH_NVSQ(push, NVC57D, 0x0208, core->chan.sync.handle);
+
+ for (i = 0; i < windows; i++) {
+ PUSH_NVSQ(push, NVC57D, 0x1004 + (i * 0x080), 0x0000000f,
+ 0x1008 + (i * 0x080), 0x00000000);
+ PUSH_NVSQ(push, NVC57D, 0x1010 + (i * 0x080), 0x00117fff);
}
+
+ core->assign_windows = true;
+ return PUSH_KICK(push);
}
static const struct nv50_core_func