.. | .. |
---|
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 | +#include <nvhw/class/cl837d.h> |
---|
| 28 | + |
---|
| 29 | +static int |
---|
25 | 30 | sor507d_ctrl(struct nv50_core *core, int or, u32 ctrl, |
---|
26 | 31 | struct nv50_head_atom *asyh) |
---|
27 | 32 | { |
---|
28 | | - u32 *push; |
---|
29 | | - if ((push = evo_wait(&core->chan, 2))) { |
---|
30 | | - if (asyh) { |
---|
31 | | - ctrl |= asyh->or.depth << 16; |
---|
32 | | - ctrl |= asyh->or.nvsync << 13; |
---|
33 | | - ctrl |= asyh->or.nhsync << 12; |
---|
34 | | - } |
---|
35 | | - evo_mthd(push, 0x0600 + (or * 0x40), 1); |
---|
36 | | - evo_data(push, ctrl); |
---|
37 | | - evo_kick(push, &core->chan); |
---|
| 33 | + struct nvif_push *push = core->chan.push; |
---|
| 34 | + int ret; |
---|
| 35 | + |
---|
| 36 | + if (asyh) { |
---|
| 37 | + ctrl |= NVVAL(NV507D, SOR_SET_CONTROL, HSYNC_POLARITY, asyh->or.nhsync); |
---|
| 38 | + ctrl |= NVVAL(NV507D, SOR_SET_CONTROL, VSYNC_POLARITY, asyh->or.nvsync); |
---|
| 39 | + ctrl |= NVVAL(NV837D, SOR_SET_CONTROL, PIXEL_DEPTH, asyh->or.depth); |
---|
38 | 40 | } |
---|
| 41 | + |
---|
| 42 | + if ((ret = PUSH_WAIT(push, 2))) |
---|
| 43 | + return ret; |
---|
| 44 | + |
---|
| 45 | + PUSH_MTHD(push, NV507D, SOR_SET_CONTROL(or), ctrl); |
---|
| 46 | + return 0; |
---|
| 47 | +} |
---|
| 48 | + |
---|
| 49 | +static void |
---|
| 50 | +sor507d_get_caps(struct nv50_disp *core, struct nouveau_encoder *outp, int or) |
---|
| 51 | +{ |
---|
| 52 | + outp->caps.dp_interlace = true; |
---|
39 | 53 | } |
---|
40 | 54 | |
---|
41 | 55 | const struct nv50_outp_func |
---|
42 | 56 | sor507d = { |
---|
43 | 57 | .ctrl = sor507d_ctrl, |
---|
| 58 | + .get_caps = sor507d_get_caps, |
---|
44 | 59 | }; |
---|