forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/gpu/drm/nouveau/dispnv50/sor907d.c
....@@ -22,20 +22,37 @@
2222 #include "core.h"
2323
2424 #include <nvif/class.h>
25
+#include <nvif/push507c.h>
2526
26
-static void
27
+#include <nvhw/class/cl907d.h>
28
+
29
+#include <nouveau_bo.h>
30
+
31
+static int
2732 sor907d_ctrl(struct nv50_core *core, int or, u32 ctrl,
2833 struct nv50_head_atom *asyh)
2934 {
30
- u32 *push;
31
- if ((push = evo_wait(&core->chan, 2))) {
32
- evo_mthd(push, 0x0200 + (or * 0x20), 1);
33
- evo_data(push, ctrl);
34
- evo_kick(push, &core->chan);
35
- }
35
+ struct nvif_push *push = core->chan.push;
36
+ int ret;
37
+
38
+ if ((ret = PUSH_WAIT(push, 2)))
39
+ return ret;
40
+
41
+ PUSH_MTHD(push, NV907D, SOR_SET_CONTROL(or), ctrl);
42
+ return 0;
43
+}
44
+
45
+static void
46
+sor907d_get_caps(struct nv50_disp *disp, struct nouveau_encoder *outp, int or)
47
+{
48
+ struct nouveau_bo *bo = disp->sync;
49
+ const int off = or * 2;
50
+ outp->caps.dp_interlace =
51
+ NVBO_RV32(bo, off, NV907D_CORE_NOTIFIER_3, CAPABILITIES_CAP_SOR0_20, DP_INTERLACE);
3652 }
3753
3854 const struct nv50_outp_func
3955 sor907d = {
4056 .ctrl = sor907d_ctrl,
57
+ .get_caps = sor907d_get_caps,
4158 };