Commit 203f6eaf authored by Ben Skeggs's avatar Ben Skeggs

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

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent 3c43c362
...@@ -20,7 +20,7 @@ struct nv50_core_func { ...@@ -20,7 +20,7 @@ struct nv50_core_func {
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,
struct nvif_device *); struct nvif_device *);
void (*update)(struct nv50_core *, u32 *interlock, bool ntfy); int (*update)(struct nv50_core *, u32 *interlock, bool ntfy);
struct { struct {
void (*owner)(struct nv50_core *); void (*owner)(struct nv50_core *);
...@@ -46,7 +46,7 @@ int core507d_init(struct nv50_core *); ...@@ -46,7 +46,7 @@ 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 *);
void core507d_update(struct nv50_core *, u32 *, bool); int core507d_update(struct nv50_core *, u32 *, bool);
extern const struct nv50_outp_func dac507d; extern const struct nv50_outp_func dac507d;
extern const struct nv50_outp_func sor507d; extern const struct nv50_outp_func sor507d;
...@@ -63,7 +63,7 @@ int core917d_new(struct nouveau_drm *, s32, struct nv50_core **); ...@@ -63,7 +63,7 @@ int core917d_new(struct nouveau_drm *, s32, struct nv50_core **);
int corec37d_new(struct nouveau_drm *, s32, struct nv50_core **); int corec37d_new(struct nouveau_drm *, s32, struct nv50_core **);
int corec37d_caps_init(struct nouveau_drm *, struct nv50_disp *); int corec37d_caps_init(struct nouveau_drm *, struct nv50_disp *);
int corec37d_ntfy_wait_done(struct nouveau_bo *, u32, struct nvif_device *); int corec37d_ntfy_wait_done(struct nouveau_bo *, u32, struct nvif_device *);
void corec37d_update(struct nv50_core *, u32 *, bool); int corec37d_update(struct nv50_core *, u32 *, bool);
void corec37d_wndw_owner(struct nv50_core *); void corec37d_wndw_owner(struct nv50_core *);
extern const struct nv50_outp_func sorc37d; extern const struct nv50_outp_func sorc37d;
......
...@@ -28,21 +28,22 @@ ...@@ -28,21 +28,22 @@
#include "nouveau_bo.h" #include "nouveau_bo.h"
void int
core507d_update(struct nv50_core *core, u32 *interlock, bool ntfy) core507d_update(struct nv50_core *core, u32 *interlock, bool ntfy)
{ {
u32 *push; struct nvif_push *push = core->chan.push;
if ((push = evo_wait(&core->chan, 5))) { int ret;
if (ntfy) {
evo_mthd(push, 0x0084, 1); if ((ret = PUSH_WAIT(push, 5)))
evo_data(push, 0x80000000 | NV50_DISP_CORE_NTFY); return ret;
}
evo_mthd(push, 0x0080, 2); if (ntfy)
evo_data(push, interlock[NV50_DISP_INTERLOCK_BASE] | PUSH_NVSQ(push, NV507D, 0x0084, 0x80000000 | NV50_DISP_CORE_NTFY);
interlock[NV50_DISP_INTERLOCK_OVLY]);
evo_data(push, 0x00000000); PUSH_NVSQ(push, NV507D, 0x0080, interlock[NV50_DISP_INTERLOCK_BASE] |
evo_kick(push, &core->chan); interlock[NV50_DISP_INTERLOCK_OVLY],
} 0x0084, 0x00000000);
return PUSH_KICK(push);
} }
int int
......
...@@ -42,28 +42,26 @@ corec37d_wndw_owner(struct nv50_core *core) ...@@ -42,28 +42,26 @@ corec37d_wndw_owner(struct nv50_core *core)
} }
} }
void int
corec37d_update(struct nv50_core *core, u32 *interlock, bool ntfy) corec37d_update(struct nv50_core *core, u32 *interlock, bool ntfy)
{ {
u32 *push; struct nvif_push *push = core->chan.push;
if ((push = evo_wait(&core->chan, 9))) { int ret;
if (ntfy) {
evo_mthd(push, 0x020c, 1);
evo_data(push, 0x00001000 | NV50_DISP_CORE_NTFY);
}
evo_mthd(push, 0x0218, 2); if ((ret = PUSH_WAIT(push, 9)))
evo_data(push, interlock[NV50_DISP_INTERLOCK_CURS]); return ret;
evo_data(push, interlock[NV50_DISP_INTERLOCK_WNDW]);
evo_mthd(push, 0x0200, 1);
evo_data(push, 0x00000001);
if (ntfy) { if (ntfy)
evo_mthd(push, 0x020c, 1); PUSH_NVSQ(push, NVC37D, 0x020c, 0x00001000 | NV50_DISP_CORE_NTFY);
evo_data(push, 0x00000000);
} PUSH_NVSQ(push, NVC37D, 0x0218, interlock[NV50_DISP_INTERLOCK_CURS],
evo_kick(push, &core->chan); 0x021c, interlock[NV50_DISP_INTERLOCK_WNDW]);
} PUSH_NVSQ(push, NVC37D, 0x0200, 0x00000001);
if (ntfy)
PUSH_NVSQ(push, NVC37D, 0x020c, 0x00000000);
return PUSH_KICK(push);
} }
int int
......
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