Lines Matching refs:wndw
22 #include "wndw.h"
48 nv50_wndw_ctxdma_new(struct nv50_wndw *wndw, struct drm_framebuffer *fb)
69 list_for_each_entry(ctxdma, &wndw->ctxdma.list, head) {
76 list_add(&ctxdma->head, &wndw->ctxdma.list);
101 ret = nvif_object_ctor(wndw->ctxdma.parent, "kmsFbCtxDma", handle,
112 nv50_wndw_wait_armed(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
114 struct nv50_disp *disp = nv50_disp(wndw->plane.dev);
116 return wndw->func->ntfy_wait_begun(disp->sync,
118 wndw->wndw.base.device);
124 nv50_wndw_flush_clr(struct nv50_wndw *wndw, u32 *interlock, bool flush,
130 if (clr.sema ) wndw->func-> sema_clr(wndw);
131 if (clr.ntfy ) wndw->func-> ntfy_clr(wndw);
132 if (clr.xlut ) wndw->func-> xlut_clr(wndw);
133 if (clr.csc ) wndw->func-> csc_clr(wndw);
134 if (clr.image) wndw->func->image_clr(wndw);
136 interlock[wndw->interlock.type] |= wndw->interlock.data;
140 nv50_wndw_flush_set(struct nv50_wndw *wndw, u32 *interlock,
148 if (asyw->set.sema ) wndw->func->sema_set (wndw, asyw);
149 if (asyw->set.ntfy ) wndw->func->ntfy_set (wndw, asyw);
150 if (asyw->set.image) wndw->func->image_set(wndw, asyw);
155 nv50_lut_load(&wndw->ilut, asyw->xlut.i.buffer,
158 wndw->func->xlut_set(wndw, asyw);
161 if (asyw->set.csc ) wndw->func->csc_set (wndw, asyw);
162 if (asyw->set.scale) wndw->func->scale_set(wndw, asyw);
163 if (asyw->set.blend) wndw->func->blend_set(wndw, asyw);
166 interlock[wndw->interlock.type] |= wndw->interlock.data;
167 interlock[NV50_DISP_INTERLOCK_WIMM] |= wndw->interlock.wimm;
169 wndw->immd->point(wndw, asyw);
170 wndw->immd->update(wndw, interlock);
172 interlock[wndw->interlock.type] |= wndw->interlock.data;
177 nv50_wndw_ntfy_enable(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
179 struct nv50_disp *disp = nv50_disp(wndw->plane.dev);
181 asyw->ntfy.handle = wndw->wndw.sync.handle;
182 asyw->ntfy.offset = wndw->ntfy;
186 wndw->func->ntfy_reset(disp->sync, wndw->ntfy);
187 wndw->ntfy ^= 0x10;
191 nv50_wndw_atomic_check_release(struct nv50_wndw *wndw,
195 struct nouveau_drm *drm = nouveau_drm(wndw->plane.dev);
196 NV_ATOMIC(drm, "%s release\n", wndw->plane.name);
197 wndw->func->release(wndw, asyw, asyh);
266 nv50_wndw_atomic_check_acquire(struct nv50_wndw *wndw, bool modeset,
272 struct nouveau_drm *drm = nouveau_drm(wndw->plane.dev);
277 NV_ATOMIC(drm, "%s acquire\n", wndw->plane.name);
318 asyw->set.image = wndw->func->image_set != NULL;
321 if (wndw->func->scale_set) {
332 if (wndw->func->blend_set) {
354 if (wndw->immd) {
361 return wndw->func->acquire(wndw, asyw, asyh);
365 nv50_wndw_atomic_check_lut(struct nv50_wndw *wndw,
389 if (wndw->func->ilut)
390 asyh->wndw.olut |= BIT(wndw->id);
392 asyh->wndw.olut &= ~BIT(wndw->id);
395 if (!ilut && wndw->func->ilut_identity &&
404 if ((asyw->ilut = wndw->func->ilut ? ilut : NULL)) {
405 if (!wndw->func->ilut(wndw, asyw, drm_color_lut_size(ilut))) {
409 asyw->xlut.handle = wndw->wndw.vram.handle;
417 if (wndw->func->olut_core &&
421 if (wndw->func->csc && asyh->state.ctm) {
423 wndw->func->csc(wndw, asyw, ctm);
440 struct nv50_wndw *wndw = nv50_wndw(plane);
441 struct nv50_wndw_atom *armw = nv50_wndw_atom(wndw->plane.state);
470 if (asyw->visible && wndw->func->xlut_set &&
475 ret = nv50_wndw_atomic_check_lut(wndw, armw, asyw, asyh);
482 ret = nv50_wndw_atomic_check_acquire(wndw, modeset,
487 asyh->wndw.mask |= BIT(wndw->id);
490 nv50_wndw_atomic_check_release(wndw, asyw, harm);
491 harm->wndw.mask &= ~BIT(wndw->id);
507 if (wndw->func->image_clr)
533 struct nv50_wndw *wndw = nv50_wndw(plane);
549 if (wndw->ctxdma.parent) {
550 ctxdma = nv50_wndw_ctxdma_new(wndw, fb);
563 if (wndw->func->prepare) {
568 wndw->func->prepare(wndw, asyh, asyw);
636 struct nv50_wndw *wndw = nv50_wndw(plane);
639 list_for_each_entry_safe(ctxdma, ctxtmp, &wndw->ctxdma.list, head) {
643 nvif_notify_dtor(&wndw->notify);
644 nv50_dmac_destroy(&wndw->wimm);
645 nv50_dmac_destroy(&wndw->wndw);
647 nv50_lut_fini(&wndw->ilut);
649 drm_plane_cleanup(&wndw->plane);
650 kfree(wndw);
708 struct nv50_wndw *wndw;
713 if (!(wndw = *pwndw = kzalloc(sizeof(*wndw), GFP_KERNEL)))
715 wndw->func = func;
716 wndw->id = index;
717 wndw->interlock.type = interlock_type;
718 wndw->interlock.data = interlock_data;
720 wndw->ctxdma.parent = &wndw->wndw.base.user;
721 INIT_LIST_HEAD(&wndw->ctxdma.list);
730 ret = drm_universal_plane_init(dev, &wndw->plane, heads, &nv50_wndw, format, nformat,
738 drm_plane_helper_add(&wndw->plane, &nv50_wndw_helper);
740 if (wndw->func->ilut) {
741 ret = nv50_lut_init(disp, mmu, &wndw->ilut);
746 wndw->notify.func = nv50_wndw_notify;
748 if (wndw->func->blend_set) {
749 ret = drm_plane_create_zpos_property(&wndw->plane,
750 nv50_wndw_zpos_default(&wndw->plane), 0, 254);
754 ret = drm_plane_create_alpha_property(&wndw->plane);
758 ret = drm_plane_create_blend_mode_property(&wndw->plane,
765 ret = drm_plane_create_zpos_immutable_property(&wndw->plane,
766 nv50_wndw_zpos_default(&wndw->plane));