forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/gpu/drm/nouveau/dispnv50/cursc37a.c
....@@ -22,17 +22,29 @@
2222 #include "curs.h"
2323 #include "atom.h"
2424
25
-static void
25
+#include <nvhw/class/clc37a.h>
26
+
27
+static int
2628 cursc37a_update(struct nv50_wndw *wndw, u32 *interlock)
2729 {
28
- nvif_wr32(&wndw->wimm.base.user, 0x0200, 0x00000001);
30
+ struct nvif_object *user = &wndw->wimm.base.user;
31
+ int ret = nvif_chan_wait(&wndw->wimm, 1);
32
+ if (ret == 0)
33
+ NVIF_WR32(user, NVC37A, UPDATE, 0x00000001);
34
+ return ret;
2935 }
3036
31
-static void
37
+static int
3238 cursc37a_point(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
3339 {
34
- nvif_wr32(&wndw->wimm.base.user, 0x0208, asyw->point.y << 16 |
35
- asyw->point.x);
40
+ struct nvif_object *user = &wndw->wimm.base.user;
41
+ int ret = nvif_chan_wait(&wndw->wimm, 1);
42
+ if (ret == 0) {
43
+ NVIF_WR32(user, NVC37A, SET_CURSOR_HOT_SPOT_POINT_OUT(0),
44
+ NVVAL(NVC37A, SET_CURSOR_HOT_SPOT_POINT_OUT, X, asyw->point.x) |
45
+ NVVAL(NVC37A, SET_CURSOR_HOT_SPOT_POINT_OUT, Y, asyw->point.y));
46
+ }
47
+ return ret;
3648 }
3749
3850 static const struct nv50_wimm_func