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; | |
18 | ||
19 | struct { | |
20 | struct nvif_object *parent; | |
21 | struct list_head list; | |
22 | } ctxdma; | |
23 | ||
24 | struct drm_plane plane; | |
25 | ||
26 | struct nv50_dmac wndw; | |
27 | struct nv50_dmac wimm; | |
28 | ||
29 | struct nvif_notify notify; | |
30 | u16 ntfy; | |
31 | u16 sema; | |
32 | u32 data; | |
33 | }; | |
34 | ||
35 | int nv50_wndw_new_(const struct nv50_wndw_func *, struct drm_device *, | |
36 | enum drm_plane_type, const char *name, int index, | |
37 | const u32 *format, struct nv50_wndw **); | |
38 | void nv50_wndw_init(struct nv50_wndw *); | |
39 | void nv50_wndw_fini(struct nv50_wndw *); | |
40 | u32 nv50_wndw_flush_set(struct nv50_wndw *, u32 interlock, | |
41 | struct nv50_wndw_atom *); | |
42 | u32 nv50_wndw_flush_clr(struct nv50_wndw *, u32 interlock, bool flush, | |
43 | struct nv50_wndw_atom *); | |
44 | int nv50_wndw_wait_armed(struct nv50_wndw *, struct nv50_wndw_atom *); | |
45 | ||
46 | struct nv50_wndw_func { | |
47 | int (*acquire)(struct nv50_wndw *, struct nv50_wndw_atom *asyw, | |
48 | struct nv50_head_atom *asyh); | |
49 | void (*release)(struct nv50_wndw *, struct nv50_wndw_atom *asyw, | |
50 | struct nv50_head_atom *asyh); | |
51 | void (*prepare)(struct nv50_wndw *, struct nv50_head_atom *asyh, | |
52 | struct nv50_wndw_atom *asyw); | |
53 | ||
54 | void (*sema_set)(struct nv50_wndw *, struct nv50_wndw_atom *); | |
55 | void (*sema_clr)(struct nv50_wndw *); | |
56 | void (*ntfy_set)(struct nv50_wndw *, struct nv50_wndw_atom *); | |
57 | void (*ntfy_clr)(struct nv50_wndw *); | |
58 | int (*ntfy_wait_begun)(struct nv50_wndw *, struct nv50_wndw_atom *); | |
59 | void (*image_set)(struct nv50_wndw *, struct nv50_wndw_atom *); | |
60 | void (*image_clr)(struct nv50_wndw *); | |
61 | void (*lut)(struct nv50_wndw *, struct nv50_wndw_atom *); | |
62 | ||
63 | u32 (*update)(struct nv50_wndw *, u32 interlock); | |
64 | }; | |
65 | ||
66 | extern const struct drm_plane_funcs nv50_wndw; | |
67 | ||
68 | struct nv50_wimm_func { | |
69 | void (*point)(struct nv50_wndw *, struct nv50_wndw_atom *); | |
70 | ||
71 | u32 (*update)(struct nv50_wndw *, u32 interlock); | |
72 | }; | |
73 | #endif |