.. | .. |
---|
21 | 21 | */ |
---|
22 | 22 | #include "core.h" |
---|
23 | 23 | |
---|
24 | | -static void |
---|
| 24 | +#include <nvif/push507c.h> |
---|
| 25 | + |
---|
| 26 | +#include <nvhw/class/cl507d.h> |
---|
| 27 | + |
---|
| 28 | +static int |
---|
25 | 29 | dac507d_ctrl(struct nv50_core *core, int or, u32 ctrl, |
---|
26 | 30 | struct nv50_head_atom *asyh) |
---|
27 | 31 | { |
---|
28 | | - u32 *push, sync = 0; |
---|
29 | | - if ((push = evo_wait(&core->chan, 3))) { |
---|
30 | | - if (asyh) { |
---|
31 | | - sync |= asyh->or.nvsync << 1; |
---|
32 | | - sync |= asyh->or.nhsync; |
---|
33 | | - } |
---|
34 | | - evo_mthd(push, 0x0400 + (or * 0x080), 2); |
---|
35 | | - evo_data(push, ctrl); |
---|
36 | | - evo_data(push, sync); |
---|
37 | | - evo_kick(push, &core->chan); |
---|
| 32 | + struct nvif_push *push = core->chan.push; |
---|
| 33 | + u32 sync = 0; |
---|
| 34 | + int ret; |
---|
| 35 | + |
---|
| 36 | + if (asyh) { |
---|
| 37 | + sync |= NVVAL(NV507D, DAC_SET_POLARITY, HSYNC, asyh->or.nhsync); |
---|
| 38 | + sync |= NVVAL(NV507D, DAC_SET_POLARITY, VSYNC, asyh->or.nvsync); |
---|
38 | 39 | } |
---|
| 40 | + |
---|
| 41 | + if ((ret = PUSH_WAIT(push, 3))) |
---|
| 42 | + return ret; |
---|
| 43 | + |
---|
| 44 | + PUSH_MTHD(push, NV507D, DAC_SET_CONTROL(or), ctrl, |
---|
| 45 | + DAC_SET_POLARITY(or), sync); |
---|
| 46 | + return 0; |
---|
39 | 47 | } |
---|
40 | 48 | |
---|
41 | 49 | const struct nv50_outp_func |
---|