.. | .. |
---|
24 | 24 | #include "head.h" |
---|
25 | 25 | |
---|
26 | 26 | #include <nvif/cl507a.h> |
---|
| 27 | +#include <nvif/timer.h> |
---|
| 28 | + |
---|
| 29 | +#include <nvhw/class/cl507a.h> |
---|
27 | 30 | |
---|
28 | 31 | #include <drm/drm_atomic_helper.h> |
---|
29 | 32 | #include <drm/drm_plane_helper.h> |
---|
30 | 33 | |
---|
31 | | -static void |
---|
32 | | -curs507a_update(struct nv50_wndw *wndw, u32 *interlock) |
---|
| 34 | +bool |
---|
| 35 | +curs507a_space(struct nv50_wndw *wndw) |
---|
33 | 36 | { |
---|
34 | | - nvif_wr32(&wndw->wimm.base.user, 0x0080, 0x00000000); |
---|
| 37 | + nvif_msec(&nouveau_drm(wndw->plane.dev)->client.device, 100, |
---|
| 38 | + if (NVIF_TV32(&wndw->wimm.base.user, NV507A, FREE, COUNT, >=, 4)) |
---|
| 39 | + return true; |
---|
| 40 | + ); |
---|
| 41 | + |
---|
| 42 | + WARN_ON(1); |
---|
| 43 | + return false; |
---|
35 | 44 | } |
---|
36 | 45 | |
---|
37 | | -static void |
---|
| 46 | +static int |
---|
| 47 | +curs507a_update(struct nv50_wndw *wndw, u32 *interlock) |
---|
| 48 | +{ |
---|
| 49 | + struct nvif_object *user = &wndw->wimm.base.user; |
---|
| 50 | + int ret = nvif_chan_wait(&wndw->wimm, 1); |
---|
| 51 | + if (ret == 0) { |
---|
| 52 | + NVIF_WR32(user, NV507A, UPDATE, |
---|
| 53 | + NVDEF(NV507A, UPDATE, INTERLOCK_WITH_CORE, DISABLE)); |
---|
| 54 | + } |
---|
| 55 | + return ret; |
---|
| 56 | +} |
---|
| 57 | + |
---|
| 58 | +static int |
---|
38 | 59 | curs507a_point(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) |
---|
39 | 60 | { |
---|
40 | | - nvif_wr32(&wndw->wimm.base.user, 0x0084, asyw->point.y << 16 | |
---|
41 | | - asyw->point.x); |
---|
| 61 | + struct nvif_object *user = &wndw->wimm.base.user; |
---|
| 62 | + int ret = nvif_chan_wait(&wndw->wimm, 1); |
---|
| 63 | + if (ret == 0) { |
---|
| 64 | + NVIF_WR32(user, NV507A, SET_CURSOR_HOT_SPOT_POINT_OUT, |
---|
| 65 | + NVVAL(NV507A, SET_CURSOR_HOT_SPOT_POINT_OUT, X, asyw->point.x) | |
---|
| 66 | + NVVAL(NV507A, SET_CURSOR_HOT_SPOT_POINT_OUT, Y, asyw->point.y)); |
---|
| 67 | + } |
---|
| 68 | + return ret; |
---|
42 | 69 | } |
---|
43 | 70 | |
---|
44 | 71 | const struct nv50_wimm_func |
---|
.. | .. |
---|
123 | 150 | if (*pwndw = wndw, ret) |
---|
124 | 151 | return ret; |
---|
125 | 152 | |
---|
126 | | - ret = nvif_object_init(&disp->disp->object, 0, oclass, &args, |
---|
127 | | - sizeof(args), &wndw->wimm.base.user); |
---|
| 153 | + ret = nvif_object_ctor(&disp->disp->object, "kmsCurs", 0, oclass, |
---|
| 154 | + &args, sizeof(args), &wndw->wimm.base.user); |
---|
128 | 155 | if (ret) { |
---|
129 | 156 | NV_ERROR(drm, "curs%04x allocation failed: %d\n", oclass, ret); |
---|
130 | 157 | return ret; |
---|