Lines Matching refs:asyh
35 struct nv50_head_atom *asyh, bool flush) in nv50_head_flush_clr() argument
38 .mask = asyh->clr.mask & ~(flush ? 0 : asyh->set.mask), in nv50_head_flush_clr()
46 nv50_head_flush_set(struct nv50_head *head, struct nv50_head_atom *asyh) in nv50_head_flush_set() argument
48 if (asyh->set.view ) head->func->view (head, asyh); in nv50_head_flush_set()
49 if (asyh->set.mode ) head->func->mode (head, asyh); in nv50_head_flush_set()
50 if (asyh->set.core ) head->func->core_set(head, asyh); in nv50_head_flush_set()
51 if (asyh->set.olut ) { in nv50_head_flush_set()
52 asyh->olut.offset = nv50_lut_load(&head->olut, in nv50_head_flush_set()
53 asyh->olut.mode <= 1, in nv50_head_flush_set()
54 asyh->olut.buffer, in nv50_head_flush_set()
55 asyh->state.gamma_lut); in nv50_head_flush_set()
56 head->func->olut_set(head, asyh); in nv50_head_flush_set()
58 if (asyh->set.curs ) head->func->curs_set(head, asyh); in nv50_head_flush_set()
59 if (asyh->set.base ) head->func->base (head, asyh); in nv50_head_flush_set()
60 if (asyh->set.ovly ) head->func->ovly (head, asyh); in nv50_head_flush_set()
61 if (asyh->set.dither ) head->func->dither (head, asyh); in nv50_head_flush_set()
62 if (asyh->set.procamp) head->func->procamp (head, asyh); in nv50_head_flush_set()
63 if (asyh->set.or ) head->func->or (head, asyh); in nv50_head_flush_set()
68 struct nv50_head_atom *asyh, in nv50_head_atomic_check_procamp() argument
74 asyh->procamp.sat.cos = ((vib * 2047 + adj) / 100) & 0xfff; in nv50_head_atomic_check_procamp()
75 asyh->procamp.sat.sin = ((hue * 2047) / 100) & 0xfff; in nv50_head_atomic_check_procamp()
76 asyh->set.procamp = true; in nv50_head_atomic_check_procamp()
81 struct nv50_head_atom *asyh, in nv50_head_atomic_check_dither() argument
88 if (asyh->base.depth > connector->display_info.bpc * 3) in nv50_head_atomic_check_dither()
101 asyh->dither.enable = mode; in nv50_head_atomic_check_dither()
102 asyh->dither.bits = mode >> 1; in nv50_head_atomic_check_dither()
103 asyh->dither.mode = mode >> 3; in nv50_head_atomic_check_dither()
104 asyh->set.dither = true; in nv50_head_atomic_check_dither()
109 struct nv50_head_atom *asyh, in nv50_head_atomic_check_view() argument
113 struct drm_display_mode *omode = &asyh->state.adjusted_mode; in nv50_head_atomic_check_view()
114 struct drm_display_mode *umode = &asyh->state.mode; in nv50_head_atomic_check_view()
138 asyh->view.iW = umode->hdisplay; in nv50_head_atomic_check_view()
139 asyh->view.iH = umode_vdisplay; in nv50_head_atomic_check_view()
142 asyh->view.oW = omode_hdisplay; in nv50_head_atomic_check_view()
143 asyh->view.oH = omode_vdisplay; in nv50_head_atomic_check_view()
154 u32 r = (asyh->view.oH << 19) / asyh->view.oW; in nv50_head_atomic_check_view()
157 asyh->view.oW -= (bX * 2); in nv50_head_atomic_check_view()
158 if (bY) asyh->view.oH -= (bY * 2); in nv50_head_atomic_check_view()
159 else asyh->view.oH = ((asyh->view.oW * r) + (r / 2)) >> 19; in nv50_head_atomic_check_view()
161 asyh->view.oW -= (asyh->view.oW >> 4) + 32; in nv50_head_atomic_check_view()
162 if (bY) asyh->view.oH -= (bY * 2); in nv50_head_atomic_check_view()
163 else asyh->view.oH = ((asyh->view.oW * r) + (r / 2)) >> 19; in nv50_head_atomic_check_view()
172 asyh->view.oW = min((u16)umode->hdisplay, asyh->view.oW); in nv50_head_atomic_check_view()
173 asyh->view.oH = min((u16)umode_vdisplay, asyh->view.oH); in nv50_head_atomic_check_view()
176 if (asyh->view.oH < asyh->view.oW) { in nv50_head_atomic_check_view()
177 u32 r = (asyh->view.iW << 19) / asyh->view.iH; in nv50_head_atomic_check_view()
178 asyh->view.oW = ((asyh->view.oH * r) + (r / 2)) >> 19; in nv50_head_atomic_check_view()
180 u32 r = (asyh->view.iH << 19) / asyh->view.iW; in nv50_head_atomic_check_view()
181 asyh->view.oH = ((asyh->view.oW * r) + (r / 2)) >> 19; in nv50_head_atomic_check_view()
188 asyh->set.view = true; in nv50_head_atomic_check_view()
193 struct nv50_head_atom *asyh) in nv50_head_atomic_check_lut() argument
196 struct drm_property_blob *olut = asyh->state.gamma_lut; in nv50_head_atomic_check_lut()
203 if (asyh->wndw.olut) { in nv50_head_atomic_check_lut()
207 if (asyh->wndw.olut != asyh->wndw.mask) in nv50_head_atomic_check_lut()
214 asyh->olut.handle = 0; in nv50_head_atomic_check_lut()
218 asyh->olut.handle = disp->core->chan.vram.handle; in nv50_head_atomic_check_lut()
219 asyh->olut.buffer = !asyh->olut.buffer; in nv50_head_atomic_check_lut()
220 head->func->olut(head, asyh); in nv50_head_atomic_check_lut()
225 nv50_head_atomic_check_mode(struct nv50_head *head, struct nv50_head_atom *asyh) in nv50_head_atomic_check_mode() argument
227 struct drm_display_mode *mode = &asyh->state.adjusted_mode; in nv50_head_atomic_check_mode()
228 struct nv50_head_mode *m = &asyh->mode; in nv50_head_atomic_check_mode()
268 asyh->or.nhsync = !!(mode->flags & DRM_MODE_FLAG_NHSYNC); in nv50_head_atomic_check_mode()
269 asyh->or.nvsync = !!(mode->flags & DRM_MODE_FLAG_NVSYNC); in nv50_head_atomic_check_mode()
270 asyh->set.or = head->func->or != NULL; in nv50_head_atomic_check_mode()
271 asyh->set.mode = true; in nv50_head_atomic_check_mode()
280 struct nv50_head_atom *asyh = nv50_head_atom(state); in nv50_head_atomic_check() local
286 NV_ATOMIC(drm, "%s atomic_check %d\n", crtc->name, asyh->state.active); in nv50_head_atomic_check()
287 if (asyh->state.active) { in nv50_head_atomic_check()
288 for_each_new_connector_in_state(asyh->state.state, conn, conns, i) { in nv50_head_atomic_check()
297 if (asyh->state.mode_changed) in nv50_head_atomic_check()
299 if (armh->base.depth != asyh->base.depth) in nv50_head_atomic_check()
305 asyh->set.mask = ~0; in nv50_head_atomic_check()
306 asyh->set.or = head->func->or != NULL; in nv50_head_atomic_check()
309 if (asyh->state.mode_changed) in nv50_head_atomic_check()
310 nv50_head_atomic_check_mode(head, asyh); in nv50_head_atomic_check()
312 if (asyh->state.color_mgmt_changed || in nv50_head_atomic_check()
313 memcmp(&armh->wndw, &asyh->wndw, sizeof(asyh->wndw))) { in nv50_head_atomic_check()
314 int ret = nv50_head_atomic_check_lut(head, asyh); in nv50_head_atomic_check()
318 asyh->olut.visible = asyh->olut.handle != 0; in nv50_head_atomic_check()
323 nv50_head_atomic_check_view(armh, asyh, asyc); in nv50_head_atomic_check()
325 nv50_head_atomic_check_dither(armh, asyh, asyc); in nv50_head_atomic_check()
327 nv50_head_atomic_check_procamp(armh, asyh, asyc); in nv50_head_atomic_check()
331 head->func->core_calc(head, asyh); in nv50_head_atomic_check()
332 if (!asyh->core.visible) in nv50_head_atomic_check()
333 asyh->olut.visible = false; in nv50_head_atomic_check()
336 asyh->set.base = armh->base.cpp != asyh->base.cpp; in nv50_head_atomic_check()
337 asyh->set.ovly = armh->ovly.cpp != asyh->ovly.cpp; in nv50_head_atomic_check()
339 asyh->olut.visible = false; in nv50_head_atomic_check()
340 asyh->core.visible = false; in nv50_head_atomic_check()
341 asyh->curs.visible = false; in nv50_head_atomic_check()
342 asyh->base.cpp = 0; in nv50_head_atomic_check()
343 asyh->ovly.cpp = 0; in nv50_head_atomic_check()
346 if (!drm_atomic_crtc_needs_modeset(&asyh->state)) { in nv50_head_atomic_check()
347 if (asyh->core.visible) { in nv50_head_atomic_check()
348 if (memcmp(&armh->core, &asyh->core, sizeof(asyh->core))) in nv50_head_atomic_check()
349 asyh->set.core = true; in nv50_head_atomic_check()
352 asyh->clr.core = true; in nv50_head_atomic_check()
355 if (asyh->curs.visible) { in nv50_head_atomic_check()
356 if (memcmp(&armh->curs, &asyh->curs, sizeof(asyh->curs))) in nv50_head_atomic_check()
357 asyh->set.curs = true; in nv50_head_atomic_check()
360 asyh->clr.curs = true; in nv50_head_atomic_check()
363 if (asyh->olut.visible) { in nv50_head_atomic_check()
364 if (memcmp(&armh->olut, &asyh->olut, sizeof(asyh->olut))) in nv50_head_atomic_check()
365 asyh->set.olut = true; in nv50_head_atomic_check()
368 asyh->clr.olut = true; in nv50_head_atomic_check()
371 asyh->clr.olut = armh->olut.visible; in nv50_head_atomic_check()
372 asyh->clr.core = armh->core.visible; in nv50_head_atomic_check()
373 asyh->clr.curs = armh->curs.visible; in nv50_head_atomic_check()
374 asyh->set.olut = asyh->olut.visible; in nv50_head_atomic_check()
375 asyh->set.core = asyh->core.visible; in nv50_head_atomic_check()
376 asyh->set.curs = asyh->curs.visible; in nv50_head_atomic_check()
379 if (asyh->clr.mask || asyh->set.mask) in nv50_head_atomic_check()
380 nv50_atom(asyh->state.state)->lock_core = true; in nv50_head_atomic_check()
393 struct nv50_head_atom *asyh = nv50_head_atom(state); in nv50_head_atomic_destroy_state() local
394 __drm_atomic_helper_crtc_destroy_state(&asyh->state); in nv50_head_atomic_destroy_state()
395 kfree(asyh); in nv50_head_atomic_destroy_state()
402 struct nv50_head_atom *asyh; in nv50_head_atomic_duplicate_state() local
403 if (!(asyh = kmalloc(sizeof(*asyh), GFP_KERNEL))) in nv50_head_atomic_duplicate_state()
405 __drm_atomic_helper_crtc_duplicate_state(crtc, &asyh->state); in nv50_head_atomic_duplicate_state()
406 asyh->wndw = armh->wndw; in nv50_head_atomic_duplicate_state()
407 asyh->view = armh->view; in nv50_head_atomic_duplicate_state()
408 asyh->mode = armh->mode; in nv50_head_atomic_duplicate_state()
409 asyh->olut = armh->olut; in nv50_head_atomic_duplicate_state()
410 asyh->core = armh->core; in nv50_head_atomic_duplicate_state()
411 asyh->curs = armh->curs; in nv50_head_atomic_duplicate_state()
412 asyh->base = armh->base; in nv50_head_atomic_duplicate_state()
413 asyh->ovly = armh->ovly; in nv50_head_atomic_duplicate_state()
414 asyh->dither = armh->dither; in nv50_head_atomic_duplicate_state()
415 asyh->procamp = armh->procamp; in nv50_head_atomic_duplicate_state()
416 asyh->clr.mask = 0; in nv50_head_atomic_duplicate_state()
417 asyh->set.mask = 0; in nv50_head_atomic_duplicate_state()
418 return &asyh->state; in nv50_head_atomic_duplicate_state()
434 struct nv50_head_atom *asyh; in nv50_head_reset() local
436 if (WARN_ON(!(asyh = kzalloc(sizeof(*asyh), GFP_KERNEL)))) in nv50_head_reset()
439 __drm_atomic_helper_crtc_reset(crtc, &asyh->state); in nv50_head_reset()