Lines Matching refs:asyw

115 nv50_wndw_wait_armed(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
118 if (asyw->set.ntfy) {
120 asyw->ntfy.offset,
128 struct nv50_wndw_atom *asyw)
131 .mask = asyw->clr.mask & ~(flush ? 0 : asyw->set.mask),
144 struct nv50_wndw_atom *asyw)
147 asyw->image.mode = NV507C_SET_PRESENT_CONTROL_BEGIN_MODE_NON_TEARING;
148 asyw->image.interval = 1;
151 if (asyw->set.sema ) wndw->func->sema_set (wndw, asyw);
152 if (asyw->set.ntfy ) wndw->func->ntfy_set (wndw, asyw);
153 if (asyw->set.image) wndw->func->image_set(wndw, asyw);
155 if (asyw->set.xlut ) {
156 if (asyw->ilut) {
157 asyw->xlut.i.offset =
158 nv50_lut_load(&wndw->ilut, asyw->xlut.i.buffer,
159 asyw->ilut, asyw->xlut.i.load);
161 wndw->func->xlut_set(wndw, asyw);
164 if (asyw->set.csc ) wndw->func->csc_set (wndw, asyw);
165 if (asyw->set.scale) wndw->func->scale_set(wndw, asyw);
166 if (asyw->set.blend) wndw->func->blend_set(wndw, asyw);
167 if (asyw->set.point) {
168 if (asyw->set.point = false, asyw->set.mask)
172 wndw->immd->point(wndw, asyw);
180 nv50_wndw_ntfy_enable(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
184 asyw->ntfy.handle = wndw->wndw.sync.handle;
185 asyw->ntfy.offset = wndw->ntfy;
186 asyw->ntfy.awaken = false;
187 asyw->set.ntfy = true;
195 struct nv50_wndw_atom *asyw,
200 wndw->func->release(wndw, asyw, asyh);
201 asyw->ntfy.handle = 0;
202 asyw->sema.handle = 0;
203 asyw->xlut.handle = 0;
204 memset(asyw->image.handle, 0x00, sizeof(asyw->image.handle));
208 nv50_wndw_atomic_check_acquire_yuv(struct nv50_wndw_atom *asyw)
210 switch (asyw->state.fb->format->format) {
212 asyw->image.format = NV507E_SURFACE_SET_PARAMS_FORMAT_VE8YO8UE8YE8;
215 asyw->image.format = NV507E_SURFACE_SET_PARAMS_FORMAT_YO8VE8YE8UE8;
222 asyw->image.colorspace = NV507E_SURFACE_SET_PARAMS_COLOR_SPACE_YUV_601;
227 nv50_wndw_atomic_check_acquire_rgb(struct nv50_wndw_atom *asyw)
229 switch (asyw->state.fb->format->format) {
231 asyw->image.format = NV507C_SURFACE_SET_PARAMS_FORMAT_I8;
235 asyw->image.format = NV507C_SURFACE_SET_PARAMS_FORMAT_A8R8G8B8;
238 asyw->image.format = NV507C_SURFACE_SET_PARAMS_FORMAT_R5G6B5;
242 asyw->image.format = NV507C_SURFACE_SET_PARAMS_FORMAT_A1R5G5B5;
246 asyw->image.format = NV507C_SURFACE_SET_PARAMS_FORMAT_A2B10G10R10;
250 asyw->image.format = NV507C_SURFACE_SET_PARAMS_FORMAT_A8B8G8R8;
254 asyw->image.format = NVC37E_SET_PARAMS_FORMAT_A2R10G10B10;
258 asyw->image.format = NV507C_SURFACE_SET_PARAMS_FORMAT_RF16_GF16_BF16_AF16;
264 asyw->image.colorspace = NV507E_SURFACE_SET_PARAMS_COLOR_SPACE_RGB;
271 struct nv50_wndw_atom *asyw,
274 struct drm_framebuffer *fb = asyw->state.fb;
285 asyw->image.w = fb->width;
286 asyw->image.h = fb->height;
287 asyw->image.kind = kind;
289 ret = nv50_wndw_atomic_check_acquire_rgb(asyw);
291 ret = nv50_wndw_atomic_check_acquire_yuv(asyw);
296 if (asyw->image.kind) {
297 asyw->image.layout = NV507C_SURFACE_SET_STORAGE_MEMORY_LAYOUT_BLOCKLINEAR;
299 asyw->image.blockh = tile_mode >> 4;
301 asyw->image.blockh = tile_mode;
302 asyw->image.blocks[0] = fb->pitches[0] / 64;
303 asyw->image.pitch[0] = 0;
305 asyw->image.layout = NV507C_SURFACE_SET_STORAGE_MEMORY_LAYOUT_PITCH;
306 asyw->image.blockh = NV507C_SURFACE_SET_STORAGE_BLOCK_HEIGHT_ONE_GOB;
307 asyw->image.blocks[0] = 0;
308 asyw->image.pitch[0] = fb->pitches[0];
312 asyw->image.interval = 1;
314 asyw->image.interval = 0;
316 if (asyw->image.interval)
317 asyw->image.mode = NV507C_SET_PRESENT_CONTROL_BEGIN_MODE_NON_TEARING;
319 asyw->image.mode = NV507C_SET_PRESENT_CONTROL_BEGIN_MODE_IMMEDIATE;
321 asyw->set.image = wndw->func->image_set != NULL;
325 asyw->scale.sx = asyw->state.src_x >> 16;
326 asyw->scale.sy = asyw->state.src_y >> 16;
327 asyw->scale.sw = asyw->state.src_w >> 16;
328 asyw->scale.sh = asyw->state.src_h >> 16;
329 asyw->scale.dw = asyw->state.crtc_w;
330 asyw->scale.dh = asyw->state.crtc_h;
331 if (memcmp(&armw->scale, &asyw->scale, sizeof(asyw->scale)))
332 asyw->set.scale = true;
336 asyw->blend.depth = 255 - asyw->state.normalized_zpos;
337 asyw->blend.k1 = asyw->state.alpha >> 8;
338 switch (asyw->state.pixel_blend_mode) {
340 asyw->blend.src_color = NVC37E_SET_COMPOSITION_FACTOR_SELECT_SRC_COLOR_FACTOR_MATCH_SELECT_K1;
341 asyw->blend.dst_color = NVC37E_SET_COMPOSITION_FACTOR_SELECT_DST_COLOR_FACTOR_MATCH_SELECT_NEG_K1_TIMES_SRC;
344 asyw->blend.src_color = NVC37E_SET_COMPOSITION_FACTOR_SELECT_SRC_COLOR_FACTOR_MATCH_SELECT_K1_TIMES_SRC;
345 asyw->blend.dst_color = NVC37E_SET_COMPOSITION_FACTOR_SELECT_DST_COLOR_FACTOR_MATCH_SELECT_NEG_K1_TIMES_SRC;
349 asyw->blend.src_color = NVC37E_SET_COMPOSITION_FACTOR_SELECT_SRC_COLOR_FACTOR_MATCH_SELECT_K1;
350 asyw->blend.dst_color = NVC37E_SET_COMPOSITION_FACTOR_SELECT_DST_COLOR_FACTOR_MATCH_SELECT_NEG_K1;
353 if (memcmp(&armw->blend, &asyw->blend, sizeof(asyw->blend)))
354 asyw->set.blend = true;
358 asyw->point.x = asyw->state.crtc_x;
359 asyw->point.y = asyw->state.crtc_y;
360 if (memcmp(&armw->point, &asyw->point, sizeof(asyw->point)))
361 asyw->set.point = true;
364 return wndw->func->acquire(wndw, asyw, asyh);
370 struct nv50_wndw_atom *asyw,
381 if (!ilut && asyw->state.fb->format->format == DRM_FORMAT_C8) {
388 asyw->visible = false;
399 asyw->state.fb->format->format != DRM_FORMAT_XBGR16161616F &&
400 asyw->state.fb->format->format != DRM_FORMAT_ABGR16161616F) {
406 memset(&asyw->xlut, 0x00, sizeof(asyw->xlut));
407 if ((asyw->ilut = wndw->func->ilut ? ilut : NULL)) {
408 wndw->func->ilut(wndw, asyw, drm_color_lut_size(ilut));
409 asyw->xlut.handle = wndw->wndw.vram.handle;
410 asyw->xlut.i.buffer = !asyw->xlut.i.buffer;
411 asyw->set.xlut = true;
413 asyw->clr.xlut = armw->xlut.handle != 0;
418 (!armw->visible || (armw->xlut.handle && !asyw->xlut.handle)))
419 asyw->set.xlut = true;
423 wndw->func->csc(wndw, asyw, ctm);
424 asyw->csc.valid = true;
425 asyw->set.csc = true;
427 asyw->csc.valid = false;
428 asyw->clr.csc = armw->csc.valid;
445 struct nv50_wndw_atom *asyw = nv50_wndw_atom(new_plane_state);
455 if (asyw->state.crtc) {
456 asyh = nv50_head_atom_get(asyw->state.state, asyw->state.crtc);
460 asyw->visible = asyh->state.active;
462 asyw->visible = false;
467 harm = nv50_head_atom_get(asyw->state.state, armw->state.crtc);
473 if (asyw->visible && wndw->func->xlut_set &&
476 asyw->state.fb->format->format !=
478 ret = nv50_wndw_atomic_check_lut(wndw, armw, asyw, asyh);
484 if (asyw->visible) {
486 armw, asyw, asyh);
493 nv50_wndw_atomic_check_release(wndw, asyw, harm);
503 if (!asyw->visible || modeset) {
504 asyw->clr.ntfy = armw->ntfy.handle != 0;
505 asyw->clr.sema = armw->sema.handle != 0;
506 asyw->clr.xlut = armw->xlut.handle != 0;
507 if (asyw->clr.xlut && asyw->visible)
508 asyw->set.xlut = asyw->xlut.handle != 0;
509 asyw->clr.csc = armw->csc.valid;
511 asyw->clr.image = armw->image.handle[0] != 0;
537 struct nv50_wndw_atom *asyw = nv50_wndw_atom(state);
544 if (!asyw->state.fb)
559 if (asyw->visible)
560 asyw->image.handle[0] = ctxdma->object.handle;
567 asyw->image.offset[0] = nvbo->offset;
570 asyh = nv50_head_atom_get(asyw->state.state, asyw->state.crtc);
574 wndw->func->prepare(wndw, asyh, asyw);
591 struct nv50_wndw_atom *asyw = nv50_wndw_atom(state);
592 __drm_atomic_helper_plane_destroy_state(&asyw->state);
593 kfree(asyw);
600 struct nv50_wndw_atom *asyw;
601 if (!(asyw = kmalloc(sizeof(*asyw), GFP_KERNEL)))
603 __drm_atomic_helper_plane_duplicate_state(plane, &asyw->state);
604 asyw->sema = armw->sema;
605 asyw->ntfy = armw->ntfy;
606 asyw->ilut = NULL;
607 asyw->xlut = armw->xlut;
608 asyw->csc = armw->csc;
609 asyw->image = armw->image;
610 asyw->point = armw->point;
611 asyw->clr.mask = 0;
612 asyw->set.mask = 0;
613 return &asyw->state;
626 struct nv50_wndw_atom *asyw;
628 if (WARN_ON(!(asyw = kzalloc(sizeof(*asyw), GFP_KERNEL))))
634 __drm_atomic_helper_plane_reset(plane, &asyw->state);