Lines Matching refs:asyh
41 struct nv50_head_atom *asyh, bool flush) in nv50_head_flush_clr() argument
44 .mask = asyh->clr.mask & ~(flush ? 0 : asyh->set.mask), in nv50_head_flush_clr()
53 nv50_head_flush_set_wndw(struct nv50_head *head, struct nv50_head_atom *asyh) in nv50_head_flush_set_wndw() argument
55 if (asyh->set.curs ) head->func->curs_set(head, asyh); in nv50_head_flush_set_wndw()
56 if (asyh->set.olut ) { in nv50_head_flush_set_wndw()
57 asyh->olut.offset = nv50_lut_load(&head->olut, in nv50_head_flush_set_wndw()
58 asyh->olut.buffer, in nv50_head_flush_set_wndw()
59 asyh->state.gamma_lut, in nv50_head_flush_set_wndw()
60 asyh->olut.load); in nv50_head_flush_set_wndw()
61 head->func->olut_set(head, asyh); in nv50_head_flush_set_wndw()
66 nv50_head_flush_set(struct nv50_head *head, struct nv50_head_atom *asyh) in nv50_head_flush_set() argument
68 if (asyh->set.view ) head->func->view (head, asyh); in nv50_head_flush_set()
69 if (asyh->set.mode ) head->func->mode (head, asyh); in nv50_head_flush_set()
70 if (asyh->set.core ) head->func->core_set(head, asyh); in nv50_head_flush_set()
71 if (asyh->set.base ) head->func->base (head, asyh); in nv50_head_flush_set()
72 if (asyh->set.ovly ) head->func->ovly (head, asyh); in nv50_head_flush_set()
73 if (asyh->set.dither ) head->func->dither (head, asyh); in nv50_head_flush_set()
74 if (asyh->set.procamp) head->func->procamp (head, asyh); in nv50_head_flush_set()
75 if (asyh->set.crc ) nv50_crc_atomic_set (head, asyh); in nv50_head_flush_set()
76 if (asyh->set.or ) head->func->or (head, asyh); in nv50_head_flush_set()
81 struct nv50_head_atom *asyh, in nv50_head_atomic_check_procamp() argument
87 asyh->procamp.sat.cos = ((vib * 2047 + adj) / 100) & 0xfff; in nv50_head_atomic_check_procamp()
88 asyh->procamp.sat.sin = ((hue * 2047) / 100) & 0xfff; in nv50_head_atomic_check_procamp()
89 asyh->set.procamp = true; in nv50_head_atomic_check_procamp()
94 struct nv50_head_atom *asyh, in nv50_head_atomic_check_dither() argument
101 if (asyh->base.depth > asyh->or.bpc * 3) in nv50_head_atomic_check_dither()
108 if (asyh->or.bpc >= 8) in nv50_head_atomic_check_dither()
115 asyh->dither.enable = NVVAL_GET(mode, NV507D, HEAD_SET_DITHER_CONTROL, ENABLE); in nv50_head_atomic_check_dither()
116 asyh->dither.bits = NVVAL_GET(mode, NV507D, HEAD_SET_DITHER_CONTROL, BITS); in nv50_head_atomic_check_dither()
117 asyh->dither.mode = NVVAL_GET(mode, NV507D, HEAD_SET_DITHER_CONTROL, MODE); in nv50_head_atomic_check_dither()
118 asyh->set.dither = true; in nv50_head_atomic_check_dither()
123 struct nv50_head_atom *asyh, in nv50_head_atomic_check_view() argument
127 struct drm_display_mode *omode = &asyh->state.adjusted_mode; in nv50_head_atomic_check_view()
128 struct drm_display_mode *umode = &asyh->state.mode; in nv50_head_atomic_check_view()
146 asyh->view.iW = umode->hdisplay; in nv50_head_atomic_check_view()
147 asyh->view.iH = umode_vdisplay; in nv50_head_atomic_check_view()
150 asyh->view.oW = omode_hdisplay; in nv50_head_atomic_check_view()
151 asyh->view.oH = omode_vdisplay; in nv50_head_atomic_check_view()
162 u32 r = (asyh->view.oH << 19) / asyh->view.oW; in nv50_head_atomic_check_view()
165 asyh->view.oW -= (bX * 2); in nv50_head_atomic_check_view()
166 if (bY) asyh->view.oH -= (bY * 2); in nv50_head_atomic_check_view()
167 else asyh->view.oH = ((asyh->view.oW * r) + (r / 2)) >> 19; in nv50_head_atomic_check_view()
169 asyh->view.oW -= (asyh->view.oW >> 4) + 32; in nv50_head_atomic_check_view()
170 if (bY) asyh->view.oH -= (bY * 2); in nv50_head_atomic_check_view()
171 else asyh->view.oH = ((asyh->view.oW * r) + (r / 2)) >> 19; in nv50_head_atomic_check_view()
183 asyh->view.oW = min(asyh->view.iW, asyh->view.oW); in nv50_head_atomic_check_view()
184 asyh->view.oH = min(asyh->view.iH, asyh->view.oH); in nv50_head_atomic_check_view()
202 if (asyh->view.oW * asyh->view.iH > asyh->view.iW * asyh->view.oH) { in nv50_head_atomic_check_view()
204 u32 r = (asyh->view.iW << 19) / asyh->view.iH; in nv50_head_atomic_check_view()
205 asyh->view.oW = ((asyh->view.oH * r) + (r / 2)) >> 19; in nv50_head_atomic_check_view()
208 u32 r = (asyh->view.iH << 19) / asyh->view.iW; in nv50_head_atomic_check_view()
209 asyh->view.oH = ((asyh->view.oW * r) + (r / 2)) >> 19; in nv50_head_atomic_check_view()
216 asyh->set.view = true; in nv50_head_atomic_check_view()
221 struct nv50_head_atom *asyh) in nv50_head_atomic_check_lut() argument
227 struct drm_property_blob *olut = asyh->state.gamma_lut, in nv50_head_atomic_check_lut()
228 *ilut = asyh->state.degamma_lut; in nv50_head_atomic_check_lut()
246 if (asyh->wndw.olut) { in nv50_head_atomic_check_lut()
250 if (asyh->wndw.olut != asyh->wndw.mask) in nv50_head_atomic_check_lut()
258 asyh->olut.handle = 0; in nv50_head_atomic_check_lut()
266 if (!head->func->olut(head, asyh, size)) { in nv50_head_atomic_check_lut()
271 asyh->olut.handle = disp->core->chan.vram.handle; in nv50_head_atomic_check_lut()
272 asyh->olut.buffer = !asyh->olut.buffer; in nv50_head_atomic_check_lut()
278 nv50_head_atomic_check_mode(struct nv50_head *head, struct nv50_head_atom *asyh) in nv50_head_atomic_check_mode() argument
280 struct drm_display_mode *mode = &asyh->state.adjusted_mode; in nv50_head_atomic_check_mode()
281 struct nv50_head_mode *m = &asyh->mode; in nv50_head_atomic_check_mode()
321 asyh->or.nhsync = !!(mode->flags & DRM_MODE_FLAG_NHSYNC); in nv50_head_atomic_check_mode()
322 asyh->or.nvsync = !!(mode->flags & DRM_MODE_FLAG_NVSYNC); in nv50_head_atomic_check_mode()
323 asyh->set.or = head->func->or != NULL; in nv50_head_atomic_check_mode()
324 asyh->set.mode = true; in nv50_head_atomic_check_mode()
337 struct nv50_head_atom *asyh = nv50_head_atom(crtc_state); in nv50_head_atomic_check() local
342 bool check_lut = asyh->state.color_mgmt_changed || in nv50_head_atomic_check()
343 memcmp(&armh->wndw, &asyh->wndw, sizeof(asyh->wndw)); in nv50_head_atomic_check()
345 NV_ATOMIC(drm, "%s atomic_check %d\n", crtc->name, asyh->state.active); in nv50_head_atomic_check()
348 ret = nv50_head_atomic_check_lut(head, asyh); in nv50_head_atomic_check()
353 if (asyh->state.active) { in nv50_head_atomic_check()
354 for_each_new_connector_in_state(asyh->state.state, conn, conns, i) { in nv50_head_atomic_check()
363 if (asyh->state.mode_changed) in nv50_head_atomic_check()
365 if (armh->base.depth != asyh->base.depth) in nv50_head_atomic_check()
371 asyh->set.mask = ~0; in nv50_head_atomic_check()
372 asyh->set.or = head->func->or != NULL; in nv50_head_atomic_check()
375 if (asyh->state.mode_changed || asyh->state.connectors_changed) in nv50_head_atomic_check()
376 nv50_head_atomic_check_mode(head, asyh); in nv50_head_atomic_check()
379 asyh->olut.visible = asyh->olut.handle != 0; in nv50_head_atomic_check()
383 nv50_head_atomic_check_view(armh, asyh, asyc); in nv50_head_atomic_check()
385 nv50_head_atomic_check_dither(armh, asyh, asyc); in nv50_head_atomic_check()
387 nv50_head_atomic_check_procamp(armh, asyh, asyc); in nv50_head_atomic_check()
391 head->func->core_calc(head, asyh); in nv50_head_atomic_check()
392 if (!asyh->core.visible) in nv50_head_atomic_check()
393 asyh->olut.visible = false; in nv50_head_atomic_check()
396 asyh->set.base = armh->base.cpp != asyh->base.cpp; in nv50_head_atomic_check()
397 asyh->set.ovly = armh->ovly.cpp != asyh->ovly.cpp; in nv50_head_atomic_check()
399 asyh->olut.visible = false; in nv50_head_atomic_check()
400 asyh->core.visible = false; in nv50_head_atomic_check()
401 asyh->curs.visible = false; in nv50_head_atomic_check()
402 asyh->base.cpp = 0; in nv50_head_atomic_check()
403 asyh->ovly.cpp = 0; in nv50_head_atomic_check()
406 if (!drm_atomic_crtc_needs_modeset(&asyh->state)) { in nv50_head_atomic_check()
407 if (asyh->core.visible) { in nv50_head_atomic_check()
408 if (memcmp(&armh->core, &asyh->core, sizeof(asyh->core))) in nv50_head_atomic_check()
409 asyh->set.core = true; in nv50_head_atomic_check()
412 asyh->clr.core = true; in nv50_head_atomic_check()
415 if (asyh->curs.visible) { in nv50_head_atomic_check()
416 if (memcmp(&armh->curs, &asyh->curs, sizeof(asyh->curs))) in nv50_head_atomic_check()
417 asyh->set.curs = true; in nv50_head_atomic_check()
420 asyh->clr.curs = true; in nv50_head_atomic_check()
423 if (asyh->olut.visible) { in nv50_head_atomic_check()
424 if (memcmp(&armh->olut, &asyh->olut, sizeof(asyh->olut))) in nv50_head_atomic_check()
425 asyh->set.olut = true; in nv50_head_atomic_check()
428 asyh->clr.olut = true; in nv50_head_atomic_check()
431 asyh->clr.olut = armh->olut.visible; in nv50_head_atomic_check()
432 asyh->clr.core = armh->core.visible; in nv50_head_atomic_check()
433 asyh->clr.curs = armh->curs.visible; in nv50_head_atomic_check()
434 asyh->set.olut = asyh->olut.visible; in nv50_head_atomic_check()
435 asyh->set.core = asyh->core.visible; in nv50_head_atomic_check()
436 asyh->set.curs = asyh->curs.visible; in nv50_head_atomic_check()
439 ret = nv50_crc_atomic_check_head(head, asyh, armh); in nv50_head_atomic_check()
443 if (asyh->clr.mask || asyh->set.mask) in nv50_head_atomic_check()
444 nv50_atom(asyh->state.state)->lock_core = true; in nv50_head_atomic_check()
458 struct nv50_head_atom *asyh = nv50_head_atom(state); in nv50_head_atomic_destroy_state() local
459 __drm_atomic_helper_crtc_destroy_state(&asyh->state); in nv50_head_atomic_destroy_state()
460 kfree(asyh); in nv50_head_atomic_destroy_state()
467 struct nv50_head_atom *asyh; in nv50_head_atomic_duplicate_state() local
468 if (!(asyh = kmalloc(sizeof(*asyh), GFP_KERNEL))) in nv50_head_atomic_duplicate_state()
470 __drm_atomic_helper_crtc_duplicate_state(crtc, &asyh->state); in nv50_head_atomic_duplicate_state()
471 asyh->wndw = armh->wndw; in nv50_head_atomic_duplicate_state()
472 asyh->view = armh->view; in nv50_head_atomic_duplicate_state()
473 asyh->mode = armh->mode; in nv50_head_atomic_duplicate_state()
474 asyh->olut = armh->olut; in nv50_head_atomic_duplicate_state()
475 asyh->core = armh->core; in nv50_head_atomic_duplicate_state()
476 asyh->curs = armh->curs; in nv50_head_atomic_duplicate_state()
477 asyh->base = armh->base; in nv50_head_atomic_duplicate_state()
478 asyh->ovly = armh->ovly; in nv50_head_atomic_duplicate_state()
479 asyh->dither = armh->dither; in nv50_head_atomic_duplicate_state()
480 asyh->procamp = armh->procamp; in nv50_head_atomic_duplicate_state()
481 asyh->crc = armh->crc; in nv50_head_atomic_duplicate_state()
482 asyh->or = armh->or; in nv50_head_atomic_duplicate_state()
483 asyh->dp = armh->dp; in nv50_head_atomic_duplicate_state()
484 asyh->clr.mask = 0; in nv50_head_atomic_duplicate_state()
485 asyh->set.mask = 0; in nv50_head_atomic_duplicate_state()
486 return &asyh->state; in nv50_head_atomic_duplicate_state()
492 struct nv50_head_atom *asyh; in nv50_head_reset() local
494 if (WARN_ON(!(asyh = kzalloc(sizeof(*asyh), GFP_KERNEL)))) in nv50_head_reset()
500 __drm_atomic_helper_crtc_reset(crtc, &asyh->state); in nv50_head_reset()