1 #ifndef __NV50_KMS_WNDW_H__
2 #define __NV50_KMS_WNDW_H__
3 #define nv50_wndw(p) container_of((p), struct nv50_wndw, plane)
8 #include <nvif/notify.h>
10 struct nv50_wndw_ctxdma {
11 struct list_head head;
12 struct nvif_object object;
16 const struct nv50_wndw_func *func;
17 const struct nv50_wimm_func *immd;
19 struct nv50_disp_interlock interlock;
22 struct nvif_object *parent;
23 struct list_head list;
26 struct drm_plane plane;
30 struct nv50_dmac wndw;
31 struct nv50_dmac wimm;
33 struct nvif_notify notify;
39 int nv50_wndw_new_(const struct nv50_wndw_func *, struct drm_device *,
40 enum drm_plane_type, const char *name, int index,
41 const u32 *format, enum nv50_disp_interlock_type,
42 u32 interlock_data, u32 heads, struct nv50_wndw **);
43 void nv50_wndw_init(struct nv50_wndw *);
44 void nv50_wndw_fini(struct nv50_wndw *);
45 void nv50_wndw_flush_set(struct nv50_wndw *, u32 *interlock,
46 struct nv50_wndw_atom *);
47 void nv50_wndw_flush_clr(struct nv50_wndw *, u32 *interlock, bool flush,
48 struct nv50_wndw_atom *);
49 void nv50_wndw_ntfy_enable(struct nv50_wndw *, struct nv50_wndw_atom *);
50 int nv50_wndw_wait_armed(struct nv50_wndw *, struct nv50_wndw_atom *);
52 struct nv50_wndw_func {
53 int (*acquire)(struct nv50_wndw *, struct nv50_wndw_atom *asyw,
54 struct nv50_head_atom *asyh);
55 void (*release)(struct nv50_wndw *, struct nv50_wndw_atom *asyw,
56 struct nv50_head_atom *asyh);
57 void (*prepare)(struct nv50_wndw *, struct nv50_head_atom *asyh,
58 struct nv50_wndw_atom *asyw);
60 void (*sema_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
61 void (*sema_clr)(struct nv50_wndw *);
62 void (*ntfy_reset)(struct nouveau_bo *, u32 offset);
63 void (*ntfy_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
64 void (*ntfy_clr)(struct nv50_wndw *);
65 int (*ntfy_wait_begun)(struct nouveau_bo *, u32 offset,
66 struct nvif_device *);
67 void (*ilut)(struct nv50_wndw *, struct nv50_wndw_atom *);
68 void (*csc)(struct nv50_wndw *, struct nv50_wndw_atom *,
69 const struct drm_color_ctm *);
70 void (*csc_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
71 void (*csc_clr)(struct nv50_wndw *);
74 void (*xlut_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
75 void (*xlut_clr)(struct nv50_wndw *);
76 void (*image_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
77 void (*image_clr)(struct nv50_wndw *);
78 void (*scale_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
79 void (*blend_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
81 void (*update)(struct nv50_wndw *, u32 *interlock);
84 extern const struct drm_plane_funcs nv50_wndw;
86 void base507c_ntfy_reset(struct nouveau_bo *, u32);
87 int base507c_ntfy_wait_begun(struct nouveau_bo *, u32, struct nvif_device *);
89 void base907c_csc(struct nv50_wndw *, struct nv50_wndw_atom *,
90 const struct drm_color_ctm *);
92 struct nv50_wimm_func {
93 void (*point)(struct nv50_wndw *, struct nv50_wndw_atom *);
95 void (*update)(struct nv50_wndw *, u32 *interlock);
98 extern const struct nv50_wimm_func curs507a;
100 int wndwc37e_new(struct nouveau_drm *, enum drm_plane_type, int, s32,
101 struct nv50_wndw **);
102 int wndwc37e_new_(const struct nv50_wndw_func *, struct nouveau_drm *,
103 enum drm_plane_type type, int index, s32 oclass, u32 heads,
104 struct nv50_wndw **);
105 int wndwc37e_acquire(struct nv50_wndw *, struct nv50_wndw_atom *,
106 struct nv50_head_atom *);
107 void wndwc37e_release(struct nv50_wndw *, struct nv50_wndw_atom *,
108 struct nv50_head_atom *);
109 void wndwc37e_sema_set(struct nv50_wndw *, struct nv50_wndw_atom *);
110 void wndwc37e_sema_clr(struct nv50_wndw *);
111 void wndwc37e_ntfy_set(struct nv50_wndw *, struct nv50_wndw_atom *);
112 void wndwc37e_ntfy_clr(struct nv50_wndw *);
113 void wndwc37e_image_clr(struct nv50_wndw *);
114 void wndwc37e_blend_set(struct nv50_wndw *, struct nv50_wndw_atom *);
115 void wndwc37e_update(struct nv50_wndw *, u32 *);
117 int wndwc57e_new(struct nouveau_drm *, enum drm_plane_type, int, s32,
118 struct nv50_wndw **);
120 int nv50_wndw_new(struct nouveau_drm *, enum drm_plane_type, int index,
121 struct nv50_wndw **);