forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/drivers/gpu/drm/nouveau/dispnv50/dac507d.c
....@@ -21,21 +21,29 @@
2121 */
2222 #include "core.h"
2323
24
-static void
24
+#include <nvif/push507c.h>
25
+
26
+#include <nvhw/class/cl507d.h>
27
+
28
+static int
2529 dac507d_ctrl(struct nv50_core *core, int or, u32 ctrl,
2630 struct nv50_head_atom *asyh)
2731 {
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);
3839 }
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;
3947 }
4048
4149 const struct nv50_outp_func