.. | .. |
---|
24 | 24 | |
---|
25 | 25 | #include <nouveau_bo.h> |
---|
26 | 26 | |
---|
27 | | -static void |
---|
| 27 | +#include <nvif/push507c.h> |
---|
| 28 | +#include <nvif/timer.h> |
---|
| 29 | + |
---|
| 30 | +#include <nvhw/class/cl827e.h> |
---|
| 31 | + |
---|
| 32 | +static int |
---|
28 | 33 | ovly827e_image_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) |
---|
29 | 34 | { |
---|
30 | | - u32 *push; |
---|
31 | | - if ((push = evo_wait(&wndw->wndw, 12))) { |
---|
32 | | - evo_mthd(push, 0x0084, 1); |
---|
33 | | - evo_data(push, asyw->image.interval << 4); |
---|
34 | | - evo_mthd(push, 0x00c0, 1); |
---|
35 | | - evo_data(push, asyw->image.handle[0]); |
---|
36 | | - evo_mthd(push, 0x0100, 1); |
---|
37 | | - evo_data(push, 0x00000002); |
---|
38 | | - evo_mthd(push, 0x0800, 1); |
---|
39 | | - evo_data(push, asyw->image.offset[0] >> 8); |
---|
40 | | - evo_mthd(push, 0x0808, 3); |
---|
41 | | - evo_data(push, asyw->image.h << 16 | asyw->image.w); |
---|
42 | | - evo_data(push, asyw->image.layout << 20 | |
---|
43 | | - (asyw->image.pitch[0] >> 8) << 8 | |
---|
44 | | - asyw->image.blocks[0] << 8 | |
---|
45 | | - asyw->image.blockh); |
---|
46 | | - evo_data(push, asyw->image.format << 8 | |
---|
47 | | - asyw->image.colorspace); |
---|
48 | | - evo_kick(push, &wndw->wndw); |
---|
49 | | - } |
---|
| 35 | + struct nvif_push *push = wndw->wndw.push; |
---|
| 36 | + int ret; |
---|
| 37 | + |
---|
| 38 | + if ((ret = PUSH_WAIT(push, 12))) |
---|
| 39 | + return ret; |
---|
| 40 | + |
---|
| 41 | + PUSH_MTHD(push, NV827E, SET_PRESENT_CONTROL, |
---|
| 42 | + NVDEF(NV827E, SET_PRESENT_CONTROL, BEGIN_MODE, ASAP) | |
---|
| 43 | + NVVAL(NV827E, SET_PRESENT_CONTROL, MIN_PRESENT_INTERVAL, asyw->image.interval)); |
---|
| 44 | + |
---|
| 45 | + PUSH_MTHD(push, NV827E, SET_CONTEXT_DMA_ISO, asyw->image.handle[0]); |
---|
| 46 | + |
---|
| 47 | + PUSH_MTHD(push, NV827E, SET_COMPOSITION_CONTROL, |
---|
| 48 | + NVDEF(NV827E, SET_COMPOSITION_CONTROL, MODE, OPAQUE_SUSPEND_BASE)); |
---|
| 49 | + |
---|
| 50 | + PUSH_MTHD(push, NV827E, SURFACE_SET_OFFSET, asyw->image.offset[0] >> 8); |
---|
| 51 | + |
---|
| 52 | + PUSH_MTHD(push, NV827E, SURFACE_SET_SIZE, |
---|
| 53 | + NVVAL(NV827E, SURFACE_SET_SIZE, WIDTH, asyw->image.w) | |
---|
| 54 | + NVVAL(NV827E, SURFACE_SET_SIZE, HEIGHT, asyw->image.h), |
---|
| 55 | + |
---|
| 56 | + SURFACE_SET_STORAGE, |
---|
| 57 | + NVVAL(NV827E, SURFACE_SET_STORAGE, BLOCK_HEIGHT, asyw->image.blockh) | |
---|
| 58 | + NVVAL(NV827E, SURFACE_SET_STORAGE, PITCH, (asyw->image.pitch[0] >> 8)) | |
---|
| 59 | + NVVAL(NV827E, SURFACE_SET_STORAGE, PITCH, asyw->image.blocks[0]) | |
---|
| 60 | + NVVAL(NV827E, SURFACE_SET_STORAGE, MEMORY_LAYOUT, asyw->image.layout), |
---|
| 61 | + |
---|
| 62 | + SURFACE_SET_PARAMS, |
---|
| 63 | + NVVAL(NV827E, SURFACE_SET_PARAMS, FORMAT, asyw->image.format) | |
---|
| 64 | + NVVAL(NV827E, SURFACE_SET_PARAMS, COLOR_SPACE, asyw->image.colorspace)); |
---|
| 65 | + return 0; |
---|
50 | 66 | } |
---|
51 | 67 | |
---|
52 | 68 | int |
---|
.. | .. |
---|
54 | 70 | struct nvif_device *device) |
---|
55 | 71 | { |
---|
56 | 72 | s64 time = nvif_msec(device, 2000ULL, |
---|
57 | | - u32 data = nouveau_bo_rd32(bo, offset / 4 + 3); |
---|
58 | | - if ((data & 0xffff0000) == 0xffff0000) |
---|
| 73 | + if (NVBO_TD32(bo, offset, NV_DISP_NOTIFICATION_1, _3, STATUS, ==, BEGUN)) |
---|
59 | 74 | break; |
---|
60 | 75 | usleep_range(1, 2); |
---|
61 | 76 | ); |
---|
.. | .. |
---|
65 | 80 | void |
---|
66 | 81 | ovly827e_ntfy_reset(struct nouveau_bo *bo, u32 offset) |
---|
67 | 82 | { |
---|
68 | | - nouveau_bo_wr32(bo, offset / 4 + 0, 0x00000000); |
---|
69 | | - nouveau_bo_wr32(bo, offset / 4 + 1, 0x00000000); |
---|
70 | | - nouveau_bo_wr32(bo, offset / 4 + 2, 0x00000000); |
---|
71 | | - nouveau_bo_wr32(bo, offset / 4 + 3, 0x80000000); |
---|
| 83 | + NVBO_WR32(bo, offset, NV_DISP_NOTIFICATION_1, TIME_STAMP_0, 0); |
---|
| 84 | + NVBO_WR32(bo, offset, NV_DISP_NOTIFICATION_1, TIME_STAMP_1, 0); |
---|
| 85 | + NVBO_WR32(bo, offset, NV_DISP_NOTIFICATION_1, _2, 0); |
---|
| 86 | + NVBO_WR32(bo, offset, NV_DISP_NOTIFICATION_1, _3, |
---|
| 87 | + NVDEF(NV_DISP_NOTIFICATION_1, _3, STATUS, NOT_BEGUN)); |
---|
72 | 88 | } |
---|
73 | 89 | |
---|
74 | 90 | static const struct nv50_wndw_func |
---|
75 | 91 | ovly827e = { |
---|
76 | 92 | .acquire = ovly507e_acquire, |
---|
77 | 93 | .release = ovly507e_release, |
---|
78 | | - .ntfy_set = ovly507e_ntfy_set, |
---|
79 | | - .ntfy_clr = ovly507e_ntfy_clr, |
---|
| 94 | + .ntfy_set = base507c_ntfy_set, |
---|
| 95 | + .ntfy_clr = base507c_ntfy_clr, |
---|
80 | 96 | .ntfy_reset = ovly827e_ntfy_reset, |
---|
81 | 97 | .ntfy_wait_begun = ovly827e_ntfy_wait_begun, |
---|
82 | 98 | .image_set = ovly827e_image_set, |
---|
83 | | - .image_clr = ovly507e_image_clr, |
---|
| 99 | + .image_clr = base507c_image_clr, |
---|
84 | 100 | .scale_set = ovly507e_scale_set, |
---|
85 | | - .update = ovly507e_update, |
---|
| 101 | + .update = base507c_update, |
---|
86 | 102 | }; |
---|
87 | 103 | |
---|
88 | 104 | const u32 |
---|
.. | .. |
---|
90 | 106 | DRM_FORMAT_YUYV, |
---|
91 | 107 | DRM_FORMAT_UYVY, |
---|
92 | 108 | DRM_FORMAT_XRGB8888, |
---|
93 | | - DRM_FORMAT_ARGB8888, |
---|
94 | 109 | DRM_FORMAT_XRGB1555, |
---|
95 | | - DRM_FORMAT_ARGB1555, |
---|
96 | 110 | DRM_FORMAT_XBGR2101010, |
---|
97 | | - DRM_FORMAT_ABGR2101010, |
---|
98 | 111 | 0 |
---|
99 | 112 | }; |
---|
100 | 113 | |
---|