forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/gpu/drm/nouveau/dispnv50/sorc37d.c
....@@ -21,19 +21,34 @@
2121 */
2222 #include "core.h"
2323
24
-static void
24
+#include <nvif/pushc37b.h>
25
+
26
+#include <nvhw/class/clc37d.h>
27
+
28
+static int
2529 sorc37d_ctrl(struct nv50_core *core, int or, u32 ctrl,
2630 struct nv50_head_atom *asyh)
2731 {
28
- u32 *push;
29
- if ((push = evo_wait(&core->chan, 2))) {
30
- evo_mthd(push, 0x0300 + (or * 0x20), 1);
31
- evo_data(push, ctrl);
32
- evo_kick(push, &core->chan);
33
- }
32
+ struct nvif_push *push = core->chan.push;
33
+ int ret;
34
+
35
+ if ((ret = PUSH_WAIT(push, 2)))
36
+ return ret;
37
+
38
+ PUSH_MTHD(push, NVC37D, SOR_SET_CONTROL(or), ctrl);
39
+ return 0;
40
+}
41
+
42
+static void
43
+sorc37d_get_caps(struct nv50_disp *disp, struct nouveau_encoder *outp, int or)
44
+{
45
+ u32 tmp = nvif_rd32(&disp->caps, 0x000144 + (or * 8));
46
+
47
+ outp->caps.dp_interlace = !!(tmp & 0x04000000);
3448 }
3549
3650 const struct nv50_outp_func
3751 sorc37d = {
3852 .ctrl = sorc37d_ctrl,
53
+ .get_caps = sorc37d_get_caps,
3954 };