Commit | Line | Data |
---|---|---|
1590700d BS |
1 | #ifndef __NV50_KMS_WNDW_H__ |
2 | #define __NV50_KMS_WNDW_H__ | |
3 | #define nv50_wndw(p) container_of((p), struct nv50_wndw, plane) | |
4 | #include "disp.h" | |
5 | #include "atom.h" | |
6 | ||
7 | #include <nvif/notify.h> | |
8 | ||
9 | struct nv50_wndw_ctxdma { | |
10 | struct list_head head; | |
11 | struct nvif_object object; | |
12 | }; | |
13 | ||
14 | struct nv50_wndw { | |
15 | const struct nv50_wndw_func *func; | |
16 | const struct nv50_wimm_func *immd; | |
17 | int id; | |
53e0a3e7 | 18 | struct nv50_disp_interlock interlock; |
1590700d BS |
19 | |
20 | struct { | |
21 | struct nvif_object *parent; | |
22 | struct list_head list; | |
23 | } ctxdma; | |
24 | ||
25 | struct drm_plane plane; | |
26 | ||
27 | struct nv50_dmac wndw; | |
28 | struct nv50_dmac wimm; | |
29 | ||
30 | struct nvif_notify notify; | |
31 | u16 ntfy; | |
32 | u16 sema; | |
33 | u32 data; | |
34 | }; | |
35 | ||
36 | int nv50_wndw_new_(const struct nv50_wndw_func *, struct drm_device *, | |
37 | enum drm_plane_type, const char *name, int index, | |
53e0a3e7 BS |
38 | const u32 *format, enum nv50_disp_interlock_type, |
39 | u32 interlock_data, u32 heads, struct nv50_wndw **); | |
1590700d BS |
40 | void nv50_wndw_init(struct nv50_wndw *); |
41 | void nv50_wndw_fini(struct nv50_wndw *); | |
53e0a3e7 BS |
42 | void nv50_wndw_flush_set(struct nv50_wndw *, u32 *interlock, |
43 | struct nv50_wndw_atom *); | |
44 | void nv50_wndw_flush_clr(struct nv50_wndw *, u32 *interlock, bool flush, | |
45 | struct nv50_wndw_atom *); | |
ccd27db8 | 46 | void nv50_wndw_ntfy_enable(struct nv50_wndw *, struct nv50_wndw_atom *); |
1590700d BS |
47 | int nv50_wndw_wait_armed(struct nv50_wndw *, struct nv50_wndw_atom *); |
48 | ||
49 | struct nv50_wndw_func { | |
50 | int (*acquire)(struct nv50_wndw *, struct nv50_wndw_atom *asyw, | |
51 | struct nv50_head_atom *asyh); | |
52 | void (*release)(struct nv50_wndw *, struct nv50_wndw_atom *asyw, | |
53 | struct nv50_head_atom *asyh); | |
54 | void (*prepare)(struct nv50_wndw *, struct nv50_head_atom *asyh, | |
55 | struct nv50_wndw_atom *asyw); | |
56 | ||
57 | void (*sema_set)(struct nv50_wndw *, struct nv50_wndw_atom *); | |
58 | void (*sema_clr)(struct nv50_wndw *); | |
ccd27db8 | 59 | void (*ntfy_reset)(struct nouveau_bo *, u32 offset); |
1590700d BS |
60 | void (*ntfy_set)(struct nv50_wndw *, struct nv50_wndw_atom *); |
61 | void (*ntfy_clr)(struct nv50_wndw *); | |
ccd27db8 BS |
62 | int (*ntfy_wait_begun)(struct nouveau_bo *, u32 offset, |
63 | struct nvif_device *); | |
1590700d BS |
64 | void (*image_set)(struct nv50_wndw *, struct nv50_wndw_atom *); |
65 | void (*image_clr)(struct nv50_wndw *); | |
66 | void (*lut)(struct nv50_wndw *, struct nv50_wndw_atom *); | |
67 | ||
53e0a3e7 | 68 | void (*update)(struct nv50_wndw *, u32 *interlock); |
1590700d BS |
69 | }; |
70 | ||
71 | extern const struct drm_plane_funcs nv50_wndw; | |
72 | ||
73 | struct nv50_wimm_func { | |
74 | void (*point)(struct nv50_wndw *, struct nv50_wndw_atom *); | |
75 | ||
53e0a3e7 | 76 | void (*update)(struct nv50_wndw *, u32 *interlock); |
1590700d BS |
77 | }; |
78 | #endif |