forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/drivers/gpu/drm/nouveau/dispnv50/wimmc37b.c
....@@ -24,30 +24,38 @@
2424 #include "wndw.h"
2525
2626 #include <nvif/clc37b.h>
27
+#include <nvif/pushc37b.h>
2728
28
-static void
29
+#include <nvhw/class/clc37b.h>
30
+
31
+static int
2932 wimmc37b_update(struct nv50_wndw *wndw, u32 *interlock)
3033 {
31
- u32 *push;
32
- if ((push = evo_wait(&wndw->wimm, 2))) {
33
- evo_mthd(push, 0x0200, 1);
34
- if (interlock[NV50_DISP_INTERLOCK_WNDW] & wndw->interlock.data)
35
- evo_data(push, 0x00000003);
36
- else
37
- evo_data(push, 0x00000001);
38
- evo_kick(push, &wndw->wimm);
39
- }
34
+ struct nvif_push *push = wndw->wimm.push;
35
+ int ret;
36
+
37
+ if ((ret = PUSH_WAIT(push, 2)))
38
+ return ret;
39
+
40
+ PUSH_MTHD(push, NVC37B, UPDATE, 0x00000001 |
41
+ NVVAL(NVC37B, UPDATE, INTERLOCK_WITH_WINDOW,
42
+ !!(interlock[NV50_DISP_INTERLOCK_WNDW] & wndw->interlock.data)));
43
+ return PUSH_KICK(push);
4044 }
4145
42
-static void
46
+static int
4347 wimmc37b_point(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
4448 {
45
- u32 *push;
46
- if ((push = evo_wait(&wndw->wimm, 2))) {
47
- evo_mthd(push, 0x0208, 1);
48
- evo_data(push, asyw->point.y << 16 | asyw->point.x);
49
- evo_kick(push, &wndw->wimm);
50
- }
49
+ struct nvif_push *push = wndw->wimm.push;
50
+ int ret;
51
+
52
+ if ((ret = PUSH_WAIT(push, 2)))
53
+ return ret;
54
+
55
+ PUSH_MTHD(push, NVC37B, SET_POINT_OUT(0),
56
+ NVVAL(NVC37B, SET_POINT_OUT, X, asyw->point.x) |
57
+ NVVAL(NVC37B, SET_POINT_OUT, Y, asyw->point.y));
58
+ return 0;
5159 }
5260
5361 static const struct nv50_wimm_func