Commit 5e691222 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/kms/nv50-: convert core init() to new push macros

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent 3afb4db7
...@@ -15,7 +15,7 @@ int nv50_core_new(struct nouveau_drm *, struct nv50_core **); ...@@ -15,7 +15,7 @@ int nv50_core_new(struct nouveau_drm *, struct nv50_core **);
void nv50_core_del(struct nv50_core **); void nv50_core_del(struct nv50_core **);
struct nv50_core_func { struct nv50_core_func {
void (*init)(struct nv50_core *); int (*init)(struct nv50_core *);
void (*ntfy_init)(struct nouveau_bo *, u32 offset); void (*ntfy_init)(struct nouveau_bo *, u32 offset);
int (*caps_init)(struct nouveau_drm *, struct nv50_disp *); int (*caps_init)(struct nouveau_drm *, struct nv50_disp *);
int (*ntfy_wait_done)(struct nouveau_bo *, u32 offset, int (*ntfy_wait_done)(struct nouveau_bo *, u32 offset,
...@@ -42,7 +42,7 @@ struct nv50_core_func { ...@@ -42,7 +42,7 @@ struct nv50_core_func {
int core507d_new(struct nouveau_drm *, s32, struct nv50_core **); int core507d_new(struct nouveau_drm *, s32, struct nv50_core **);
int core507d_new_(const struct nv50_core_func *, struct nouveau_drm *, s32, int core507d_new_(const struct nv50_core_func *, struct nouveau_drm *, s32,
struct nv50_core **); struct nv50_core **);
void core507d_init(struct nv50_core *); int core507d_init(struct nv50_core *);
void core507d_ntfy_init(struct nouveau_bo *, u32); void core507d_ntfy_init(struct nouveau_bo *, u32);
int core507d_caps_init(struct nouveau_drm *, struct nv50_disp *); int core507d_caps_init(struct nouveau_drm *, struct nv50_disp *);
int core507d_ntfy_wait_done(struct nouveau_bo *, u32, struct nvif_device *); int core507d_ntfy_wait_done(struct nouveau_bo *, u32, struct nvif_device *);
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "head.h" #include "head.h"
#include <nvif/cl507d.h> #include <nvif/cl507d.h>
#include <nvif/push507c.h>
#include <nvif/timer.h> #include <nvif/timer.h>
#include "nouveau_bo.h" #include "nouveau_bo.h"
...@@ -76,15 +77,17 @@ core507d_caps_init(struct nouveau_drm *drm, struct nv50_disp *disp) ...@@ -76,15 +77,17 @@ core507d_caps_init(struct nouveau_drm *drm, struct nv50_disp *disp)
return 0; return 0;
} }
void int
core507d_init(struct nv50_core *core) core507d_init(struct nv50_core *core)
{ {
u32 *push; struct nvif_push *push = core->chan.push;
if ((push = evo_wait(&core->chan, 2))) { int ret;
evo_mthd(push, 0x0088, 1);
evo_data(push, core->chan.sync.handle); if ((ret = PUSH_WAIT(push, 2)))
evo_kick(push, &core->chan); return ret;
}
PUSH_NVSQ(push, NV507D, 0x0088, core->chan.sync.handle);
return PUSH_KICK(push);
} }
static const struct nv50_core_func static const struct nv50_core_func
......
...@@ -23,10 +23,11 @@ ...@@ -23,10 +23,11 @@
#include "head.h" #include "head.h"
#include <nvif/class.h> #include <nvif/class.h>
#include <nouveau_bo.h> #include <nvif/pushc37b.h>
#include <nvif/timer.h> #include <nvif/timer.h>
#include <nouveau_bo.h>
void void
corec37d_wndw_owner(struct nv50_core *core) corec37d_wndw_owner(struct nv50_core *core)
{ {
...@@ -112,24 +113,26 @@ int corec37d_caps_init(struct nouveau_drm *drm, struct nv50_disp *disp) ...@@ -112,24 +113,26 @@ int corec37d_caps_init(struct nouveau_drm *drm, struct nv50_disp *disp)
return 0; return 0;
} }
static void static int
corec37d_init(struct nv50_core *core) corec37d_init(struct nv50_core *core)
{ {
struct nvif_push *push = core->chan.push;
const u32 windows = 8; /*XXX*/ const u32 windows = 8; /*XXX*/
u32 *push, i; int ret, i;
if ((push = evo_wait(&core->chan, 2 + 5 * windows))) {
evo_mthd(push, 0x0208, 1); if ((ret = PUSH_WAIT(push, 2 + windows * 5)))
evo_data(push, core->chan.sync.handle); return ret;
PUSH_NVSQ(push, NVC37D, 0x0208, core->chan.sync.handle);
for (i = 0; i < windows; i++) { for (i = 0; i < windows; i++) {
evo_mthd(push, 0x1004 + (i * 0x080), 2); PUSH_NVSQ(push, NVC37D, 0x1004 + (i * 0x080), 0x0000001f,
evo_data(push, 0x0000001f); 0x1008 + (i * 0x080), 0x00000000);
evo_data(push, 0x00000000); PUSH_NVSQ(push, NVC37D, 0x1010 + (i * 0x080), 0x00127fff);
evo_mthd(push, 0x1010 + (i * 0x080), 1);
evo_data(push, 0x00127fff);
} }
evo_kick(push, &core->chan);
core->assign_windows = true; core->assign_windows = true;
} return PUSH_KICK(push);
} }
static const struct nv50_core_func static const struct nv50_core_func
......
...@@ -22,24 +22,28 @@ ...@@ -22,24 +22,28 @@
#include "core.h" #include "core.h"
#include "head.h" #include "head.h"
static void #include <nvif/pushc37b.h>
static int
corec57d_init(struct nv50_core *core) corec57d_init(struct nv50_core *core)
{ {
struct nvif_push *push = core->chan.push;
const u32 windows = 8; /*XXX*/ const u32 windows = 8; /*XXX*/
u32 *push, i; int ret, i;
if ((push = evo_wait(&core->chan, 2 + 5 * windows))) {
evo_mthd(push, 0x0208, 1); if ((ret = PUSH_WAIT(push, 2 + windows * 5)))
evo_data(push, core->chan.sync.handle); return ret;
PUSH_NVSQ(push, NVC57D, 0x0208, core->chan.sync.handle);
for (i = 0; i < windows; i++) { for (i = 0; i < windows; i++) {
evo_mthd(push, 0x1004 + (i * 0x080), 2); PUSH_NVSQ(push, NVC57D, 0x1004 + (i * 0x080), 0x0000000f,
evo_data(push, 0x0000000f); 0x1008 + (i * 0x080), 0x00000000);
evo_data(push, 0x00000000); PUSH_NVSQ(push, NVC57D, 0x1010 + (i * 0x080), 0x00117fff);
evo_mthd(push, 0x1010 + (i * 0x080), 1);
evo_data(push, 0x00117fff);
} }
evo_kick(push, &core->chan);
core->assign_windows = true; core->assign_windows = true;
} return PUSH_KICK(push);
} }
static const struct nv50_core_func static const struct nv50_core_func
......
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