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