This source file includes following definitions.
- corec37d_update
- corec37d_ntfy_wait_done
- corec37d_ntfy_init
- corec37d_init
- corec37d_new
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 #include "core.h"
23 #include "head.h"
24
25 #include <nouveau_bo.h>
26
27 void
28 corec37d_update(struct nv50_core *core, u32 *interlock, bool ntfy)
29 {
30 u32 *push;
31 if ((push = evo_wait(&core->chan, 9))) {
32 if (ntfy) {
33 evo_mthd(push, 0x020c, 1);
34 evo_data(push, 0x00001000 | NV50_DISP_CORE_NTFY);
35 }
36
37 evo_mthd(push, 0x0218, 2);
38 evo_data(push, interlock[NV50_DISP_INTERLOCK_CURS]);
39 evo_data(push, interlock[NV50_DISP_INTERLOCK_WNDW]);
40 evo_mthd(push, 0x0200, 1);
41 evo_data(push, 0x00000001);
42
43 if (ntfy) {
44 evo_mthd(push, 0x020c, 1);
45 evo_data(push, 0x00000000);
46 }
47 evo_kick(push, &core->chan);
48 }
49 }
50
51 int
52 corec37d_ntfy_wait_done(struct nouveau_bo *bo, u32 offset,
53 struct nvif_device *device)
54 {
55 u32 data;
56 s64 time = nvif_msec(device, 2000ULL,
57 data = nouveau_bo_rd32(bo, offset / 4 + 0);
58 if ((data & 0xc0000000) == 0x80000000)
59 break;
60 usleep_range(1, 2);
61 );
62 return time < 0 ? time : 0;
63 }
64
65 void
66 corec37d_ntfy_init(struct nouveau_bo *bo, u32 offset)
67 {
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, 0x00000000);
72 }
73
74 static void
75 corec37d_init(struct nv50_core *core)
76 {
77 const u32 windows = 8;
78 u32 *push, i;
79 if ((push = evo_wait(&core->chan, 2 + 6 * windows + 2))) {
80 evo_mthd(push, 0x0208, 1);
81 evo_data(push, core->chan.sync.handle);
82 for (i = 0; i < windows; i++) {
83 evo_mthd(push, 0x1000 + (i * 0x080), 3);
84 evo_data(push, i >> 1);
85 evo_data(push, 0x0000001f);
86 evo_data(push, 0x00000000);
87 evo_mthd(push, 0x1010 + (i * 0x080), 1);
88 evo_data(push, 0x00127fff);
89 }
90 evo_mthd(push, 0x0200, 1);
91 evo_data(push, 0x00000001);
92 evo_kick(push, &core->chan);
93 }
94 }
95
96 static const struct nv50_core_func
97 corec37d = {
98 .init = corec37d_init,
99 .ntfy_init = corec37d_ntfy_init,
100 .ntfy_wait_done = corec37d_ntfy_wait_done,
101 .update = corec37d_update,
102 .head = &headc37d,
103 .sor = &sorc37d,
104 };
105
106 int
107 corec37d_new(struct nouveau_drm *drm, s32 oclass, struct nv50_core **pcore)
108 {
109 return core507d_new_(&corec37d, drm, oclass, pcore);
110 }