| .. | .. |
|---|
| 38 | 38 | |
|---|
| 39 | 39 | int nv50_wndw_new_(const struct nv50_wndw_func *, struct drm_device *, |
|---|
| 40 | 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 *); |
|---|
| 41 | + const u32 *format, u32 heads, |
|---|
| 42 | + enum nv50_disp_interlock_type, u32 interlock_data, |
|---|
| 43 | + struct nv50_wndw **); |
|---|
| 45 | 44 | void nv50_wndw_flush_set(struct nv50_wndw *, u32 *interlock, |
|---|
| 46 | 45 | struct nv50_wndw_atom *); |
|---|
| 47 | 46 | void nv50_wndw_flush_clr(struct nv50_wndw *, u32 *interlock, bool flush, |
|---|
| .. | .. |
|---|
| 57 | 56 | void (*prepare)(struct nv50_wndw *, struct nv50_head_atom *asyh, |
|---|
| 58 | 57 | struct nv50_wndw_atom *asyw); |
|---|
| 59 | 58 | |
|---|
| 60 | | - void (*sema_set)(struct nv50_wndw *, struct nv50_wndw_atom *); |
|---|
| 61 | | - void (*sema_clr)(struct nv50_wndw *); |
|---|
| 59 | + int (*sema_set)(struct nv50_wndw *, struct nv50_wndw_atom *); |
|---|
| 60 | + int (*sema_clr)(struct nv50_wndw *); |
|---|
| 62 | 61 | 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 *); |
|---|
| 62 | + int (*ntfy_set)(struct nv50_wndw *, struct nv50_wndw_atom *); |
|---|
| 63 | + int (*ntfy_clr)(struct nv50_wndw *); |
|---|
| 65 | 64 | int (*ntfy_wait_begun)(struct nouveau_bo *, u32 offset, |
|---|
| 66 | 65 | struct nvif_device *); |
|---|
| 67 | | - void (*ilut)(struct nv50_wndw *, struct nv50_wndw_atom *); |
|---|
| 66 | + bool (*ilut)(struct nv50_wndw *, struct nv50_wndw_atom *, int); |
|---|
| 67 | + void (*csc)(struct nv50_wndw *, struct nv50_wndw_atom *, |
|---|
| 68 | + const struct drm_color_ctm *); |
|---|
| 69 | + int (*csc_set)(struct nv50_wndw *, struct nv50_wndw_atom *); |
|---|
| 70 | + int (*csc_clr)(struct nv50_wndw *); |
|---|
| 71 | + bool ilut_identity; |
|---|
| 72 | + int ilut_size; |
|---|
| 68 | 73 | bool olut_core; |
|---|
| 69 | | - void (*xlut_set)(struct nv50_wndw *, struct nv50_wndw_atom *); |
|---|
| 70 | | - void (*xlut_clr)(struct nv50_wndw *); |
|---|
| 71 | | - void (*image_set)(struct nv50_wndw *, struct nv50_wndw_atom *); |
|---|
| 72 | | - void (*image_clr)(struct nv50_wndw *); |
|---|
| 73 | | - void (*scale_set)(struct nv50_wndw *, struct nv50_wndw_atom *); |
|---|
| 74 | + int (*xlut_set)(struct nv50_wndw *, struct nv50_wndw_atom *); |
|---|
| 75 | + int (*xlut_clr)(struct nv50_wndw *); |
|---|
| 76 | + int (*image_set)(struct nv50_wndw *, struct nv50_wndw_atom *); |
|---|
| 77 | + int (*image_clr)(struct nv50_wndw *); |
|---|
| 78 | + int (*scale_set)(struct nv50_wndw *, struct nv50_wndw_atom *); |
|---|
| 79 | + int (*blend_set)(struct nv50_wndw *, struct nv50_wndw_atom *); |
|---|
| 74 | 80 | |
|---|
| 75 | | - void (*update)(struct nv50_wndw *, u32 *interlock); |
|---|
| 81 | + int (*update)(struct nv50_wndw *, u32 *interlock); |
|---|
| 76 | 82 | }; |
|---|
| 77 | 83 | |
|---|
| 78 | 84 | extern const struct drm_plane_funcs nv50_wndw; |
|---|
| 79 | 85 | |
|---|
| 80 | 86 | void base507c_ntfy_reset(struct nouveau_bo *, u32); |
|---|
| 87 | +int base507c_ntfy_set(struct nv50_wndw *, struct nv50_wndw_atom *); |
|---|
| 88 | +int base507c_ntfy_clr(struct nv50_wndw *); |
|---|
| 81 | 89 | int base507c_ntfy_wait_begun(struct nouveau_bo *, u32, struct nvif_device *); |
|---|
| 90 | +int base507c_image_clr(struct nv50_wndw *); |
|---|
| 91 | +int base507c_update(struct nv50_wndw *, u32 *); |
|---|
| 92 | + |
|---|
| 93 | +void base907c_csc(struct nv50_wndw *, struct nv50_wndw_atom *, |
|---|
| 94 | + const struct drm_color_ctm *); |
|---|
| 82 | 95 | |
|---|
| 83 | 96 | struct nv50_wimm_func { |
|---|
| 84 | | - void (*point)(struct nv50_wndw *, struct nv50_wndw_atom *); |
|---|
| 97 | + int (*point)(struct nv50_wndw *, struct nv50_wndw_atom *); |
|---|
| 85 | 98 | |
|---|
| 86 | | - void (*update)(struct nv50_wndw *, u32 *interlock); |
|---|
| 99 | + int (*update)(struct nv50_wndw *, u32 *interlock); |
|---|
| 87 | 100 | }; |
|---|
| 88 | 101 | |
|---|
| 89 | 102 | extern const struct nv50_wimm_func curs507a; |
|---|
| 103 | +bool curs507a_space(struct nv50_wndw *); |
|---|
| 104 | + |
|---|
| 105 | +static inline __must_check int |
|---|
| 106 | +nvif_chan_wait(struct nv50_dmac *dmac, u32 size) |
|---|
| 107 | +{ |
|---|
| 108 | + struct nv50_wndw *wndw = container_of(dmac, typeof(*wndw), wimm); |
|---|
| 109 | + return curs507a_space(wndw) ? 0 : -ETIMEDOUT; |
|---|
| 110 | +} |
|---|
| 90 | 111 | |
|---|
| 91 | 112 | int wndwc37e_new(struct nouveau_drm *, enum drm_plane_type, int, s32, |
|---|
| 92 | 113 | struct nv50_wndw **); |
|---|
| 114 | +int wndwc37e_new_(const struct nv50_wndw_func *, struct nouveau_drm *, |
|---|
| 115 | + enum drm_plane_type type, int index, s32 oclass, u32 heads, |
|---|
| 116 | + struct nv50_wndw **); |
|---|
| 117 | +int wndwc37e_acquire(struct nv50_wndw *, struct nv50_wndw_atom *, |
|---|
| 118 | + struct nv50_head_atom *); |
|---|
| 119 | +void wndwc37e_release(struct nv50_wndw *, struct nv50_wndw_atom *, |
|---|
| 120 | + struct nv50_head_atom *); |
|---|
| 121 | +int wndwc37e_sema_set(struct nv50_wndw *, struct nv50_wndw_atom *); |
|---|
| 122 | +int wndwc37e_sema_clr(struct nv50_wndw *); |
|---|
| 123 | +int wndwc37e_ntfy_set(struct nv50_wndw *, struct nv50_wndw_atom *); |
|---|
| 124 | +int wndwc37e_ntfy_clr(struct nv50_wndw *); |
|---|
| 125 | +int wndwc37e_image_clr(struct nv50_wndw *); |
|---|
| 126 | +int wndwc37e_blend_set(struct nv50_wndw *, struct nv50_wndw_atom *); |
|---|
| 127 | +int wndwc37e_update(struct nv50_wndw *, u32 *); |
|---|
| 128 | + |
|---|
| 129 | +int wndwc57e_new(struct nouveau_drm *, enum drm_plane_type, int, s32, |
|---|
| 130 | + struct nv50_wndw **); |
|---|
| 93 | 131 | |
|---|
| 94 | 132 | int nv50_wndw_new(struct nouveau_drm *, enum drm_plane_type, int index, |
|---|
| 95 | 133 | struct nv50_wndw **); |
|---|