Lines Matching refs:asyw

100 nv50_wndw_wait_armed(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)  in nv50_wndw_wait_armed()  argument
103 if (asyw->set.ntfy) { in nv50_wndw_wait_armed()
105 asyw->ntfy.offset, in nv50_wndw_wait_armed()
113 struct nv50_wndw_atom *asyw) in nv50_wndw_flush_clr() argument
116 .mask = asyw->clr.mask & ~(flush ? 0 : asyw->set.mask), in nv50_wndw_flush_clr()
128 struct nv50_wndw_atom *asyw) in nv50_wndw_flush_set() argument
131 asyw->image.mode = 0; in nv50_wndw_flush_set()
132 asyw->image.interval = 1; in nv50_wndw_flush_set()
135 if (asyw->set.sema ) wndw->func->sema_set (wndw, asyw); in nv50_wndw_flush_set()
136 if (asyw->set.ntfy ) wndw->func->ntfy_set (wndw, asyw); in nv50_wndw_flush_set()
137 if (asyw->set.image) wndw->func->image_set(wndw, asyw); in nv50_wndw_flush_set()
139 if (asyw->set.xlut ) { in nv50_wndw_flush_set()
140 if (asyw->ilut) { in nv50_wndw_flush_set()
141 asyw->xlut.i.offset = in nv50_wndw_flush_set()
143 asyw->xlut.i.mode <= 1, in nv50_wndw_flush_set()
144 asyw->xlut.i.buffer, in nv50_wndw_flush_set()
145 asyw->ilut); in nv50_wndw_flush_set()
147 wndw->func->xlut_set(wndw, asyw); in nv50_wndw_flush_set()
150 if (asyw->set.scale) wndw->func->scale_set(wndw, asyw); in nv50_wndw_flush_set()
151 if (asyw->set.point) { in nv50_wndw_flush_set()
152 if (asyw->set.point = false, asyw->set.mask) in nv50_wndw_flush_set()
156 wndw->immd->point(wndw, asyw); in nv50_wndw_flush_set()
164 nv50_wndw_ntfy_enable(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) in nv50_wndw_ntfy_enable() argument
168 asyw->ntfy.handle = wndw->wndw.sync.handle; in nv50_wndw_ntfy_enable()
169 asyw->ntfy.offset = wndw->ntfy; in nv50_wndw_ntfy_enable()
170 asyw->ntfy.awaken = false; in nv50_wndw_ntfy_enable()
171 asyw->set.ntfy = true; in nv50_wndw_ntfy_enable()
179 struct nv50_wndw_atom *asyw, in nv50_wndw_atomic_check_release() argument
184 wndw->func->release(wndw, asyw, asyh); in nv50_wndw_atomic_check_release()
185 asyw->ntfy.handle = 0; in nv50_wndw_atomic_check_release()
186 asyw->sema.handle = 0; in nv50_wndw_atomic_check_release()
190 nv50_wndw_atomic_check_acquire_yuv(struct nv50_wndw_atom *asyw) in nv50_wndw_atomic_check_acquire_yuv() argument
192 switch (asyw->state.fb->format->format) { in nv50_wndw_atomic_check_acquire_yuv()
193 case DRM_FORMAT_YUYV: asyw->image.format = 0x28; break; in nv50_wndw_atomic_check_acquire_yuv()
194 case DRM_FORMAT_UYVY: asyw->image.format = 0x29; break; in nv50_wndw_atomic_check_acquire_yuv()
199 asyw->image.colorspace = 1; in nv50_wndw_atomic_check_acquire_yuv()
204 nv50_wndw_atomic_check_acquire_rgb(struct nv50_wndw_atom *asyw) in nv50_wndw_atomic_check_acquire_rgb() argument
206 switch (asyw->state.fb->format->format) { in nv50_wndw_atomic_check_acquire_rgb()
207 case DRM_FORMAT_C8 : asyw->image.format = 0x1e; break; in nv50_wndw_atomic_check_acquire_rgb()
209 case DRM_FORMAT_ARGB8888 : asyw->image.format = 0xcf; break; in nv50_wndw_atomic_check_acquire_rgb()
210 case DRM_FORMAT_RGB565 : asyw->image.format = 0xe8; break; in nv50_wndw_atomic_check_acquire_rgb()
212 case DRM_FORMAT_ARGB1555 : asyw->image.format = 0xe9; break; in nv50_wndw_atomic_check_acquire_rgb()
214 case DRM_FORMAT_ABGR2101010: asyw->image.format = 0xd1; break; in nv50_wndw_atomic_check_acquire_rgb()
216 case DRM_FORMAT_ABGR8888 : asyw->image.format = 0xd5; break; in nv50_wndw_atomic_check_acquire_rgb()
218 case DRM_FORMAT_ARGB2101010: asyw->image.format = 0xdf; break; in nv50_wndw_atomic_check_acquire_rgb()
222 asyw->image.colorspace = 0; in nv50_wndw_atomic_check_acquire_rgb()
229 struct nv50_wndw_atom *asyw, in nv50_wndw_atomic_check_acquire() argument
232 struct nouveau_framebuffer *fb = nouveau_framebuffer(asyw->state.fb); in nv50_wndw_atomic_check_acquire()
238 if (asyw->state.fb != armw->state.fb || !armw->visible || modeset) { in nv50_wndw_atomic_check_acquire()
239 asyw->image.w = fb->base.width; in nv50_wndw_atomic_check_acquire()
240 asyw->image.h = fb->base.height; in nv50_wndw_atomic_check_acquire()
241 asyw->image.kind = fb->nvbo->kind; in nv50_wndw_atomic_check_acquire()
243 ret = nv50_wndw_atomic_check_acquire_rgb(asyw); in nv50_wndw_atomic_check_acquire()
245 ret = nv50_wndw_atomic_check_acquire_yuv(asyw); in nv50_wndw_atomic_check_acquire()
250 if (asyw->image.kind) { in nv50_wndw_atomic_check_acquire()
251 asyw->image.layout = 0; in nv50_wndw_atomic_check_acquire()
253 asyw->image.blockh = fb->nvbo->mode >> 4; in nv50_wndw_atomic_check_acquire()
255 asyw->image.blockh = fb->nvbo->mode; in nv50_wndw_atomic_check_acquire()
256 asyw->image.blocks[0] = fb->base.pitches[0] / 64; in nv50_wndw_atomic_check_acquire()
257 asyw->image.pitch[0] = 0; in nv50_wndw_atomic_check_acquire()
259 asyw->image.layout = 1; in nv50_wndw_atomic_check_acquire()
260 asyw->image.blockh = 0; in nv50_wndw_atomic_check_acquire()
261 asyw->image.blocks[0] = 0; in nv50_wndw_atomic_check_acquire()
262 asyw->image.pitch[0] = fb->base.pitches[0]; in nv50_wndw_atomic_check_acquire()
266 asyw->image.interval = 1; in nv50_wndw_atomic_check_acquire()
268 asyw->image.interval = 0; in nv50_wndw_atomic_check_acquire()
269 asyw->image.mode = asyw->image.interval ? 0 : 1; in nv50_wndw_atomic_check_acquire()
270 asyw->set.image = wndw->func->image_set != NULL; in nv50_wndw_atomic_check_acquire()
274 asyw->scale.sx = asyw->state.src_x >> 16; in nv50_wndw_atomic_check_acquire()
275 asyw->scale.sy = asyw->state.src_y >> 16; in nv50_wndw_atomic_check_acquire()
276 asyw->scale.sw = asyw->state.src_w >> 16; in nv50_wndw_atomic_check_acquire()
277 asyw->scale.sh = asyw->state.src_h >> 16; in nv50_wndw_atomic_check_acquire()
278 asyw->scale.dw = asyw->state.crtc_w; in nv50_wndw_atomic_check_acquire()
279 asyw->scale.dh = asyw->state.crtc_h; in nv50_wndw_atomic_check_acquire()
280 if (memcmp(&armw->scale, &asyw->scale, sizeof(asyw->scale))) in nv50_wndw_atomic_check_acquire()
281 asyw->set.scale = true; in nv50_wndw_atomic_check_acquire()
285 asyw->point.x = asyw->state.crtc_x; in nv50_wndw_atomic_check_acquire()
286 asyw->point.y = asyw->state.crtc_y; in nv50_wndw_atomic_check_acquire()
287 if (memcmp(&armw->point, &asyw->point, sizeof(asyw->point))) in nv50_wndw_atomic_check_acquire()
288 asyw->set.point = true; in nv50_wndw_atomic_check_acquire()
291 return wndw->func->acquire(wndw, asyw, asyh); in nv50_wndw_atomic_check_acquire()
297 struct nv50_wndw_atom *asyw, in nv50_wndw_atomic_check_lut() argument
308 if (!ilut && asyw->state.fb->format->format == DRM_FORMAT_C8) { in nv50_wndw_atomic_check_lut()
315 asyw->visible = false; in nv50_wndw_atomic_check_lut()
326 memset(&asyw->xlut, 0x00, sizeof(asyw->xlut)); in nv50_wndw_atomic_check_lut()
327 if ((asyw->ilut = wndw->func->ilut ? ilut : NULL)) { in nv50_wndw_atomic_check_lut()
328 wndw->func->ilut(wndw, asyw); in nv50_wndw_atomic_check_lut()
329 asyw->xlut.handle = wndw->wndw.vram.handle; in nv50_wndw_atomic_check_lut()
330 asyw->xlut.i.buffer = !asyw->xlut.i.buffer; in nv50_wndw_atomic_check_lut()
331 asyw->set.xlut = true; in nv50_wndw_atomic_check_lut()
336 (!armw->visible || (armw->xlut.handle && !asyw->xlut.handle))) in nv50_wndw_atomic_check_lut()
337 asyw->set.xlut = true; in nv50_wndw_atomic_check_lut()
349 struct nv50_wndw_atom *asyw = nv50_wndw_atom(state); in nv50_wndw_atomic_check() local
359 if (asyw->state.crtc) { in nv50_wndw_atomic_check()
360 asyh = nv50_head_atom_get(asyw->state.state, asyw->state.crtc); in nv50_wndw_atomic_check()
364 asyw->visible = asyh->state.active; in nv50_wndw_atomic_check()
366 asyw->visible = false; in nv50_wndw_atomic_check()
371 harm = nv50_head_atom_get(asyw->state.state, armw->state.crtc); in nv50_wndw_atomic_check()
377 if (asyw->visible && wndw->func->xlut_set && in nv50_wndw_atomic_check()
380 asyw->state.fb->format->format != in nv50_wndw_atomic_check()
382 nv50_wndw_atomic_check_lut(wndw, armw, asyw, asyh); in nv50_wndw_atomic_check()
385 if (asyw->visible) { in nv50_wndw_atomic_check()
387 armw, asyw, asyh); in nv50_wndw_atomic_check()
394 nv50_wndw_atomic_check_release(wndw, asyw, harm); in nv50_wndw_atomic_check()
404 if (!asyw->visible || modeset) { in nv50_wndw_atomic_check()
405 asyw->clr.ntfy = armw->ntfy.handle != 0; in nv50_wndw_atomic_check()
406 asyw->clr.sema = armw->sema.handle != 0; in nv50_wndw_atomic_check()
407 asyw->clr.xlut = armw->xlut.handle != 0; in nv50_wndw_atomic_check()
409 asyw->clr.image = armw->image.handle[0] != 0; in nv50_wndw_atomic_check()
434 struct nv50_wndw_atom *asyw = nv50_wndw_atom(state); in nv50_wndw_prepare_fb() local
440 if (!asyw->state.fb) in nv50_wndw_prepare_fb()
454 asyw->image.handle[0] = ctxdma->object.handle; in nv50_wndw_prepare_fb()
457 asyw->state.fence = reservation_object_get_excl_rcu(fb->nvbo->bo.resv); in nv50_wndw_prepare_fb()
458 asyw->image.offset[0] = fb->nvbo->bo.offset; in nv50_wndw_prepare_fb()
461 asyh = nv50_head_atom_get(asyw->state.state, asyw->state.crtc); in nv50_wndw_prepare_fb()
465 wndw->func->prepare(wndw, asyh, asyw); in nv50_wndw_prepare_fb()
482 struct nv50_wndw_atom *asyw = nv50_wndw_atom(state); in nv50_wndw_atomic_destroy_state() local
483 __drm_atomic_helper_plane_destroy_state(&asyw->state); in nv50_wndw_atomic_destroy_state()
484 kfree(asyw); in nv50_wndw_atomic_destroy_state()
491 struct nv50_wndw_atom *asyw; in nv50_wndw_atomic_duplicate_state() local
492 if (!(asyw = kmalloc(sizeof(*asyw), GFP_KERNEL))) in nv50_wndw_atomic_duplicate_state()
494 __drm_atomic_helper_plane_duplicate_state(plane, &asyw->state); in nv50_wndw_atomic_duplicate_state()
495 asyw->sema = armw->sema; in nv50_wndw_atomic_duplicate_state()
496 asyw->ntfy = armw->ntfy; in nv50_wndw_atomic_duplicate_state()
497 asyw->ilut = NULL; in nv50_wndw_atomic_duplicate_state()
498 asyw->xlut = armw->xlut; in nv50_wndw_atomic_duplicate_state()
499 asyw->image = armw->image; in nv50_wndw_atomic_duplicate_state()
500 asyw->point = armw->point; in nv50_wndw_atomic_duplicate_state()
501 asyw->clr.mask = 0; in nv50_wndw_atomic_duplicate_state()
502 asyw->set.mask = 0; in nv50_wndw_atomic_duplicate_state()
503 return &asyw->state; in nv50_wndw_atomic_duplicate_state()
509 struct nv50_wndw_atom *asyw; in nv50_wndw_reset() local
511 if (WARN_ON(!(asyw = kzalloc(sizeof(*asyw), GFP_KERNEL)))) in nv50_wndw_reset()
516 plane->state = &asyw->state; in nv50_wndw_reset()