Lines Matching refs:asyh

41 		    struct nv50_head_atom *asyh, bool flush)
44 .mask = asyh->clr.mask & ~(flush ? 0 : asyh->set.mask),
53 nv50_head_flush_set_wndw(struct nv50_head *head, struct nv50_head_atom *asyh)
55 if (asyh->set.curs ) head->func->curs_set(head, asyh);
56 if (asyh->set.olut ) {
57 asyh->olut.offset = nv50_lut_load(&head->olut,
58 asyh->olut.buffer,
59 asyh->state.gamma_lut,
60 asyh->olut.load);
61 head->func->olut_set(head, asyh);
66 nv50_head_flush_set(struct nv50_head *head, struct nv50_head_atom *asyh)
68 if (asyh->set.view ) head->func->view (head, asyh);
69 if (asyh->set.mode ) head->func->mode (head, asyh);
70 if (asyh->set.core ) head->func->core_set(head, asyh);
71 if (asyh->set.base ) head->func->base (head, asyh);
72 if (asyh->set.ovly ) head->func->ovly (head, asyh);
73 if (asyh->set.dither ) head->func->dither (head, asyh);
74 if (asyh->set.procamp) head->func->procamp (head, asyh);
75 if (asyh->set.crc ) nv50_crc_atomic_set (head, asyh);
76 if (asyh->set.or ) head->func->or (head, asyh);
81 struct nv50_head_atom *asyh,
87 asyh->procamp.sat.cos = ((vib * 2047 + adj) / 100) & 0xfff;
88 asyh->procamp.sat.sin = ((hue * 2047) / 100) & 0xfff;
89 asyh->set.procamp = true;
94 struct nv50_head_atom *asyh,
101 if (asyh->base.depth > asyh->or.bpc * 3)
108 if (asyh->or.bpc >= 8)
115 asyh->dither.enable = NVVAL_GET(mode, NV507D, HEAD_SET_DITHER_CONTROL, ENABLE);
116 asyh->dither.bits = NVVAL_GET(mode, NV507D, HEAD_SET_DITHER_CONTROL, BITS);
117 asyh->dither.mode = NVVAL_GET(mode, NV507D, HEAD_SET_DITHER_CONTROL, MODE);
118 asyh->set.dither = true;
123 struct nv50_head_atom *asyh,
127 struct drm_display_mode *omode = &asyh->state.adjusted_mode;
128 struct drm_display_mode *umode = &asyh->state.mode;
152 asyh->view.iW = umode->hdisplay;
153 asyh->view.iH = umode_vdisplay;
156 asyh->view.oW = omode_hdisplay;
157 asyh->view.oH = omode_vdisplay;
168 u32 r = (asyh->view.oH << 19) / asyh->view.oW;
171 asyh->view.oW -= (bX * 2);
172 if (bY) asyh->view.oH -= (bY * 2);
173 else asyh->view.oH = ((asyh->view.oW * r) + (r / 2)) >> 19;
175 asyh->view.oW -= (asyh->view.oW >> 4) + 32;
176 if (bY) asyh->view.oH -= (bY * 2);
177 else asyh->view.oH = ((asyh->view.oW * r) + (r / 2)) >> 19;
189 asyh->view.oW = min(asyh->view.iW, asyh->view.oW);
190 asyh->view.oH = min(asyh->view.iH, asyh->view.oH);
208 if (asyh->view.oW * asyh->view.iH > asyh->view.iW * asyh->view.oH) {
210 u32 r = (asyh->view.iW << 19) / asyh->view.iH;
211 asyh->view.oW = ((asyh->view.oH * r) + (r / 2)) >> 19;
214 u32 r = (asyh->view.iH << 19) / asyh->view.iW;
215 asyh->view.oH = ((asyh->view.oW * r) + (r / 2)) >> 19;
222 asyh->set.view = true;
227 struct nv50_head_atom *asyh)
233 struct drm_property_blob *olut = asyh->state.gamma_lut,
234 *ilut = asyh->state.degamma_lut;
252 if (asyh->wndw.olut) {
256 if (asyh->wndw.olut != asyh->wndw.mask)
264 asyh->olut.handle = 0;
272 if (!head->func->olut(head, asyh, size)) {
277 asyh->olut.handle = disp->core->chan.vram.handle;
278 asyh->olut.buffer = !asyh->olut.buffer;
284 nv50_head_atomic_check_mode(struct nv50_head *head, struct nv50_head_atom *asyh)
286 struct drm_display_mode *mode = &asyh->state.adjusted_mode;
287 struct nv50_head_mode *m = &asyh->mode;
327 asyh->or.nhsync = !!(mode->flags & DRM_MODE_FLAG_NHSYNC);
328 asyh->or.nvsync = !!(mode->flags & DRM_MODE_FLAG_NVSYNC);
329 asyh->set.or = head->func->or != NULL;
330 asyh->set.mode = true;
343 struct nv50_head_atom *asyh = nv50_head_atom(crtc_state);
348 bool check_lut = asyh->state.color_mgmt_changed ||
349 memcmp(&armh->wndw, &asyh->wndw, sizeof(asyh->wndw));
351 NV_ATOMIC(drm, "%s atomic_check %d\n", crtc->name, asyh->state.active);
354 ret = nv50_head_atomic_check_lut(head, asyh);
359 if (asyh->state.active) {
360 for_each_new_connector_in_state(asyh->state.state, conn, conns, i) {
369 if (asyh->state.mode_changed)
371 if (armh->base.depth != asyh->base.depth)
377 asyh->set.mask = ~0;
378 asyh->set.or = head->func->or != NULL;
381 if (asyh->state.mode_changed || asyh->state.connectors_changed)
382 nv50_head_atomic_check_mode(head, asyh);
385 asyh->olut.visible = asyh->olut.handle != 0;
389 nv50_head_atomic_check_view(armh, asyh, asyc);
391 nv50_head_atomic_check_dither(armh, asyh, asyc);
393 nv50_head_atomic_check_procamp(armh, asyh, asyc);
397 head->func->core_calc(head, asyh);
398 if (!asyh->core.visible)
399 asyh->olut.visible = false;
402 asyh->set.base = armh->base.cpp != asyh->base.cpp;
403 asyh->set.ovly = armh->ovly.cpp != asyh->ovly.cpp;
405 asyh->olut.visible = false;
406 asyh->core.visible = false;
407 asyh->curs.visible = false;
408 asyh->base.cpp = 0;
409 asyh->ovly.cpp = 0;
412 if (!drm_atomic_crtc_needs_modeset(&asyh->state)) {
413 if (asyh->core.visible) {
414 if (memcmp(&armh->core, &asyh->core, sizeof(asyh->core)))
415 asyh->set.core = true;
418 asyh->clr.core = true;
421 if (asyh->curs.visible) {
422 if (memcmp(&armh->curs, &asyh->curs, sizeof(asyh->curs)))
423 asyh->set.curs = true;
426 asyh->clr.curs = true;
429 if (asyh->olut.visible) {
430 if (memcmp(&armh->olut, &asyh->olut, sizeof(asyh->olut)))
431 asyh->set.olut = true;
434 asyh->clr.olut = true;
437 asyh->clr.olut = armh->olut.visible;
438 asyh->clr.core = armh->core.visible;
439 asyh->clr.curs = armh->curs.visible;
440 asyh->set.olut = asyh->olut.visible;
441 asyh->set.core = asyh->core.visible;
442 asyh->set.curs = asyh->curs.visible;
445 ret = nv50_crc_atomic_check_head(head, asyh, armh);
449 if (asyh->clr.mask || asyh->set.mask)
450 nv50_atom(asyh->state.state)->lock_core = true;
464 struct nv50_head_atom *asyh = nv50_head_atom(state);
465 __drm_atomic_helper_crtc_destroy_state(&asyh->state);
466 kfree(asyh);
473 struct nv50_head_atom *asyh;
474 if (!(asyh = kmalloc(sizeof(*asyh), GFP_KERNEL)))
476 __drm_atomic_helper_crtc_duplicate_state(crtc, &asyh->state);
477 asyh->wndw = armh->wndw;
478 asyh->view = armh->view;
479 asyh->mode = armh->mode;
480 asyh->olut = armh->olut;
481 asyh->core = armh->core;
482 asyh->curs = armh->curs;
483 asyh->base = armh->base;
484 asyh->ovly = armh->ovly;
485 asyh->dither = armh->dither;
486 asyh->procamp = armh->procamp;
487 asyh->crc = armh->crc;
488 asyh->or = armh->or;
489 asyh->dp = armh->dp;
490 asyh->clr.mask = 0;
491 asyh->set.mask = 0;
492 return &asyh->state;
498 struct nv50_head_atom *asyh;
500 if (WARN_ON(!(asyh = kzalloc(sizeof(*asyh), GFP_KERNEL))))
506 __drm_atomic_helper_crtc_reset(crtc, &asyh->state);