Commit 9ec5e820 authored by Ben Skeggs's avatar Ben Skeggs

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

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent b505935e
...@@ -31,7 +31,7 @@ struct nv50_core_func { ...@@ -31,7 +31,7 @@ struct nv50_core_func {
const struct nv50_crc_func *crc; const struct nv50_crc_func *crc;
#endif #endif
const struct nv50_outp_func { const struct nv50_outp_func {
void (*ctrl)(struct nv50_core *, int or, u32 ctrl, int (*ctrl)(struct nv50_core *, int or, u32 ctrl,
struct nv50_head_atom *); struct nv50_head_atom *);
/* XXX: Only used by SORs and PIORs for now */ /* XXX: Only used by SORs and PIORs for now */
void (*get_caps)(struct nv50_disp *, void (*get_caps)(struct nv50_disp *,
......
...@@ -21,21 +21,27 @@ ...@@ -21,21 +21,27 @@
*/ */
#include "core.h" #include "core.h"
static void #include <nvif/push507c.h>
static int
dac507d_ctrl(struct nv50_core *core, int or, u32 ctrl, dac507d_ctrl(struct nv50_core *core, int or, u32 ctrl,
struct nv50_head_atom *asyh) struct nv50_head_atom *asyh)
{ {
u32 *push, sync = 0; struct nvif_push *push = core->chan.push;
if ((push = evo_wait(&core->chan, 3))) { u32 sync = 0;
int ret;
if (asyh) { if (asyh) {
sync |= asyh->or.nvsync << 1; sync |= asyh->or.nvsync << 1;
sync |= asyh->or.nhsync; sync |= asyh->or.nhsync;
} }
evo_mthd(push, 0x0400 + (or * 0x080), 2);
evo_data(push, ctrl); if ((ret = PUSH_WAIT(push, 3)))
evo_data(push, sync); return ret;
evo_kick(push, &core->chan);
} PUSH_NVSQ(push, NV507D, 0x0400 + (or * 0x080), ctrl,
0x0404 + (or * 0x080), sync);
return 0;
} }
const struct nv50_outp_func const struct nv50_outp_func
......
...@@ -21,16 +21,20 @@ ...@@ -21,16 +21,20 @@
*/ */
#include "core.h" #include "core.h"
static void #include <nvif/push507c.h>
static int
dac907d_ctrl(struct nv50_core *core, int or, u32 ctrl, dac907d_ctrl(struct nv50_core *core, int or, u32 ctrl,
struct nv50_head_atom *asyh) struct nv50_head_atom *asyh)
{ {
u32 *push; struct nvif_push *push = core->chan.push;
if ((push = evo_wait(&core->chan, 2))) { int ret;
evo_mthd(push, 0x0180 + (or * 0x020), 1);
evo_data(push, ctrl); if ((ret = PUSH_WAIT(push, 2)))
evo_kick(push, &core->chan); return ret;
}
PUSH_NVSQ(push, NV907D, 0x0180 + (or * 0x020), ctrl);
return 0;
} }
const struct nv50_outp_func const struct nv50_outp_func
......
...@@ -21,21 +21,26 @@ ...@@ -21,21 +21,26 @@
*/ */
#include "core.h" #include "core.h"
static void #include <nvif/push507c.h>
static int
pior507d_ctrl(struct nv50_core *core, int or, u32 ctrl, pior507d_ctrl(struct nv50_core *core, int or, u32 ctrl,
struct nv50_head_atom *asyh) struct nv50_head_atom *asyh)
{ {
u32 *push; struct nvif_push *push = core->chan.push;
if ((push = evo_wait(&core->chan, 2))) { int ret;
if (asyh) { if (asyh) {
ctrl |= asyh->or.depth << 16; ctrl |= asyh->or.depth << 16;
ctrl |= asyh->or.nvsync << 13; ctrl |= asyh->or.nvsync << 13;
ctrl |= asyh->or.nhsync << 12; ctrl |= asyh->or.nhsync << 12;
} }
evo_mthd(push, 0x0700 + (or * 0x040), 1);
evo_data(push, ctrl); if ((ret = PUSH_WAIT(push, 2)))
evo_kick(push, &core->chan); return ret;
}
PUSH_NVSQ(push, NV507D, 0x0700 + (or * 0x040), ctrl);
return 0;
} }
static void static void
......
...@@ -21,21 +21,26 @@ ...@@ -21,21 +21,26 @@
*/ */
#include "core.h" #include "core.h"
static void #include <nvif/push507c.h>
static int
sor507d_ctrl(struct nv50_core *core, int or, u32 ctrl, sor507d_ctrl(struct nv50_core *core, int or, u32 ctrl,
struct nv50_head_atom *asyh) struct nv50_head_atom *asyh)
{ {
u32 *push; struct nvif_push *push = core->chan.push;
if ((push = evo_wait(&core->chan, 2))) { int ret;
if (asyh) { if (asyh) {
ctrl |= asyh->or.depth << 16; ctrl |= asyh->or.depth << 16;
ctrl |= asyh->or.nvsync << 13; ctrl |= asyh->or.nvsync << 13;
ctrl |= asyh->or.nhsync << 12; ctrl |= asyh->or.nhsync << 12;
} }
evo_mthd(push, 0x0600 + (or * 0x40), 1);
evo_data(push, ctrl); if ((ret = PUSH_WAIT(push, 2)))
evo_kick(push, &core->chan); return ret;
}
PUSH_NVSQ(push, NV507D, 0x0600 + (or * 0x40), ctrl);
return 0;
} }
static void static void
......
...@@ -21,19 +21,23 @@ ...@@ -21,19 +21,23 @@
*/ */
#include "core.h" #include "core.h"
#include <nouveau_bo.h>
#include <nvif/class.h> #include <nvif/class.h>
#include <nvif/push507c.h>
static void #include <nouveau_bo.h>
static int
sor907d_ctrl(struct nv50_core *core, int or, u32 ctrl, sor907d_ctrl(struct nv50_core *core, int or, u32 ctrl,
struct nv50_head_atom *asyh) struct nv50_head_atom *asyh)
{ {
u32 *push; struct nvif_push *push = core->chan.push;
if ((push = evo_wait(&core->chan, 2))) { int ret;
evo_mthd(push, 0x0200 + (or * 0x20), 1);
evo_data(push, ctrl); if ((ret = PUSH_WAIT(push, 2)))
evo_kick(push, &core->chan); return ret;
}
PUSH_NVSQ(push, NV907D, 0x0200 + (or * 0x20), ctrl);
return 0;
} }
static void static void
......
...@@ -21,16 +21,20 @@ ...@@ -21,16 +21,20 @@
*/ */
#include "core.h" #include "core.h"
static void #include <nvif/push507c.h>
static int
sorc37d_ctrl(struct nv50_core *core, int or, u32 ctrl, sorc37d_ctrl(struct nv50_core *core, int or, u32 ctrl,
struct nv50_head_atom *asyh) struct nv50_head_atom *asyh)
{ {
u32 *push; struct nvif_push *push = core->chan.push;
if ((push = evo_wait(&core->chan, 2))) { int ret;
evo_mthd(push, 0x0300 + (or * 0x20), 1);
evo_data(push, ctrl); if ((ret = PUSH_WAIT(push, 2)))
evo_kick(push, &core->chan); return ret;
}
PUSH_NVSQ(push, NVC37D, 0x0300 + (or * 0x20), ctrl);
return 0;
} }
static void static void
......
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