Lines Matching +full:m +full:- +full:mode
44 .mask = asyh->clr.mask & ~(flush ? 0 : asyh->set.mask), in nv50_head_flush_clr()
47 if (clr.olut) head->func->olut_clr(head); in nv50_head_flush_clr()
48 if (clr.core) head->func->core_clr(head); in nv50_head_flush_clr()
49 if (clr.curs) head->func->curs_clr(head); in nv50_head_flush_clr()
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()
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()
84 const int vib = asyc->procamp.color_vibrance - 100; in nv50_head_atomic_check_procamp()
85 const int hue = asyc->procamp.vibrant_hue - 90; in nv50_head_atomic_check_procamp()
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()
97 u32 mode = 0x00; in nv50_head_atomic_check_dither() local
99 if (asyc->dither.mode) { in nv50_head_atomic_check_dither()
100 if (asyc->dither.mode == DITHERING_MODE_AUTO) { in nv50_head_atomic_check_dither()
101 if (asyh->base.depth > asyh->or.bpc * 3) in nv50_head_atomic_check_dither()
102 mode = DITHERING_MODE_DYNAMIC2X2; in nv50_head_atomic_check_dither()
104 mode = asyc->dither.mode; in nv50_head_atomic_check_dither()
107 if (asyc->dither.depth == DITHERING_DEPTH_AUTO) { in nv50_head_atomic_check_dither()
108 if (asyh->or.bpc >= 8) in nv50_head_atomic_check_dither()
109 mode |= DITHERING_DEPTH_8BPC; in nv50_head_atomic_check_dither()
111 mode |= asyc->dither.depth; 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()
126 struct drm_connector *connector = asyc->state.connector; in nv50_head_atomic_check_view()
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()
129 int mode = asyc->scaler.mode; in nv50_head_atomic_check_view() local
133 if (connector->edid_blob_ptr) in nv50_head_atomic_check_view()
134 edid = (struct edid *)connector->edid_blob_ptr->data; in nv50_head_atomic_check_view()
138 if (!asyc->scaler.full) { in nv50_head_atomic_check_view()
139 if (mode == DRM_MODE_SCALE_NONE) in nv50_head_atomic_check_view()
142 /* Non-EDID LVDS/eDP mode. */ in nv50_head_atomic_check_view()
143 mode = DRM_MODE_SCALE_FULLSCREEN; in nv50_head_atomic_check_view()
146 /* For the user-specified mode, we must ignore doublescan and in nv50_head_atomic_check_view()
149 umode_vdisplay = umode->vdisplay; in nv50_head_atomic_check_view()
150 if ((umode->flags & DRM_MODE_FLAG_3D_MASK) == DRM_MODE_FLAG_3D_FRAME_PACKING) in nv50_head_atomic_check_view()
151 umode_vdisplay += umode->vtotal; in nv50_head_atomic_check_view()
152 asyh->view.iW = umode->hdisplay; in nv50_head_atomic_check_view()
153 asyh->view.iH = umode_vdisplay; in nv50_head_atomic_check_view()
154 /* For the output mode, we can just use the stock helper. */ in nv50_head_atomic_check_view()
156 asyh->view.oW = omode_hdisplay; in nv50_head_atomic_check_view()
157 asyh->view.oH = omode_vdisplay; in nv50_head_atomic_check_view()
160 * ratio the same as the backend mode unless overridden by the in nv50_head_atomic_check_view()
163 if ((asyc->scaler.underscan.mode == UNDERSCAN_ON || in nv50_head_atomic_check_view()
164 (asyc->scaler.underscan.mode == UNDERSCAN_AUTO && in nv50_head_atomic_check_view()
166 u32 bX = asyc->scaler.underscan.hborder; in nv50_head_atomic_check_view()
167 u32 bY = asyc->scaler.underscan.vborder; in nv50_head_atomic_check_view()
168 u32 r = (asyh->view.oH << 19) / asyh->view.oW; in nv50_head_atomic_check_view()
171 asyh->view.oW -= (bX * 2); in nv50_head_atomic_check_view()
172 if (bY) asyh->view.oH -= (bY * 2); in nv50_head_atomic_check_view()
173 else asyh->view.oH = ((asyh->view.oW * r) + (r / 2)) >> 19; in nv50_head_atomic_check_view()
175 asyh->view.oW -= (asyh->view.oW >> 4) + 32; in nv50_head_atomic_check_view()
176 if (bY) asyh->view.oH -= (bY * 2); in nv50_head_atomic_check_view()
177 else asyh->view.oH = ((asyh->view.oW * r) + (r / 2)) >> 19; in nv50_head_atomic_check_view()
184 switch (mode) { in nv50_head_atomic_check_view()
189 asyh->view.oW = min(asyh->view.iW, asyh->view.oW); in nv50_head_atomic_check_view()
190 asyh->view.oH = min(asyh->view.iH, asyh->view.oH); in nv50_head_atomic_check_view()
208 if (asyh->view.oW * asyh->view.iH > asyh->view.iW * asyh->view.oH) { in nv50_head_atomic_check_view()
210 u32 r = (asyh->view.iW << 19) / asyh->view.iH; in nv50_head_atomic_check_view()
211 asyh->view.oW = ((asyh->view.oH * r) + (r / 2)) >> 19; in nv50_head_atomic_check_view()
214 u32 r = (asyh->view.iH << 19) / asyh->view.iW; in nv50_head_atomic_check_view()
215 asyh->view.oH = ((asyh->view.oW * r) + (r / 2)) >> 19; in nv50_head_atomic_check_view()
222 asyh->set.view = true; in nv50_head_atomic_check_view()
229 struct drm_device *dev = head->base.base.dev; in nv50_head_atomic_check_lut()
230 struct drm_crtc *crtc = &head->base.base; in nv50_head_atomic_check_lut()
233 struct drm_property_blob *olut = asyh->state.gamma_lut, in nv50_head_atomic_check_lut()
234 *ilut = asyh->state.degamma_lut; in nv50_head_atomic_check_lut()
240 if (!head->func->ilut_check(size)) { in nv50_head_atomic_check_lut()
242 size, crtc->base.id, crtc->name); in nv50_head_atomic_check_lut()
243 return -EINVAL; in nv50_head_atomic_check_lut()
252 if (asyh->wndw.olut) { in nv50_head_atomic_check_lut()
256 if (asyh->wndw.olut != asyh->wndw.mask) in nv50_head_atomic_check_lut()
257 return -EINVAL; in nv50_head_atomic_check_lut()
263 if (!head->func->olut_identity) { in nv50_head_atomic_check_lut()
264 asyh->olut.handle = 0; in nv50_head_atomic_check_lut()
272 if (!head->func->olut(head, asyh, size)) { in nv50_head_atomic_check_lut()
274 size, crtc->base.id, crtc->name); in nv50_head_atomic_check_lut()
275 return -EINVAL; in nv50_head_atomic_check_lut()
277 asyh->olut.handle = disp->core->chan.vram.handle; in nv50_head_atomic_check_lut()
278 asyh->olut.buffer = !asyh->olut.buffer; in nv50_head_atomic_check_lut()
286 struct drm_display_mode *mode = &asyh->state.adjusted_mode; in nv50_head_atomic_check_mode() local
287 struct nv50_head_mode *m = &asyh->mode; in nv50_head_atomic_check_mode() local
290 drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V | CRTC_STEREO_DOUBLE); in nv50_head_atomic_check_mode()
299 m->h.active = mode->crtc_htotal; in nv50_head_atomic_check_mode()
300 m->h.synce = mode->crtc_hsync_end - mode->crtc_hsync_start - 1; in nv50_head_atomic_check_mode()
301 m->h.blanke = mode->crtc_hblank_end - mode->crtc_hsync_start - 1; in nv50_head_atomic_check_mode()
302 m->h.blanks = m->h.blanke + mode->crtc_hdisplay; in nv50_head_atomic_check_mode()
304 m->v.active = mode->crtc_vtotal; in nv50_head_atomic_check_mode()
305 m->v.synce = mode->crtc_vsync_end - mode->crtc_vsync_start - 1; in nv50_head_atomic_check_mode()
306 m->v.blanke = mode->crtc_vblank_end - mode->crtc_vsync_start - 1; in nv50_head_atomic_check_mode()
307 m->v.blanks = m->v.blanke + mode->crtc_vdisplay; in nv50_head_atomic_check_mode()
310 blankus = (m->v.active - mode->crtc_vdisplay - 2) * m->h.active; in nv50_head_atomic_check_mode()
312 blankus /= mode->crtc_clock; in nv50_head_atomic_check_mode()
313 m->v.blankus = blankus; in nv50_head_atomic_check_mode()
315 if (mode->flags & DRM_MODE_FLAG_INTERLACE) { in nv50_head_atomic_check_mode()
316 m->v.blank2e = m->v.active + m->v.blanke; in nv50_head_atomic_check_mode()
317 m->v.blank2s = m->v.blank2e + mode->crtc_vdisplay; in nv50_head_atomic_check_mode()
318 m->v.active = (m->v.active * 2) + 1; in nv50_head_atomic_check_mode()
319 m->interlace = true; in nv50_head_atomic_check_mode()
321 m->v.blank2e = 0; in nv50_head_atomic_check_mode()
322 m->v.blank2s = 1; in nv50_head_atomic_check_mode()
323 m->interlace = false; in nv50_head_atomic_check_mode()
325 m->clock = mode->crtc_clock; in nv50_head_atomic_check_mode()
327 asyh->or.nhsync = !!(mode->flags & DRM_MODE_FLAG_NHSYNC); in nv50_head_atomic_check_mode()
328 asyh->or.nvsync = !!(mode->flags & DRM_MODE_FLAG_NVSYNC); in nv50_head_atomic_check_mode()
329 asyh->set.or = head->func->or != NULL; in nv50_head_atomic_check_mode()
330 asyh->set.mode = true; in nv50_head_atomic_check_mode()
340 struct nouveau_drm *drm = nouveau_drm(crtc->dev); in nv50_head_atomic_check()
348 bool check_lut = asyh->state.color_mgmt_changed || in nv50_head_atomic_check()
349 memcmp(&armh->wndw, &asyh->wndw, sizeof(asyh->wndw)); in nv50_head_atomic_check()
351 NV_ATOMIC(drm, "%s atomic_check %d\n", crtc->name, asyh->state.active); in nv50_head_atomic_check()
359 if (asyh->state.active) { in nv50_head_atomic_check()
360 for_each_new_connector_in_state(asyh->state.state, conn, conns, i) { in nv50_head_atomic_check()
361 if (conns->crtc == crtc) { in nv50_head_atomic_check()
367 if (armh->state.active) { in nv50_head_atomic_check()
369 if (asyh->state.mode_changed) in nv50_head_atomic_check()
370 asyc->set.scaler = true; in nv50_head_atomic_check()
371 if (armh->base.depth != asyh->base.depth) in nv50_head_atomic_check()
372 asyc->set.dither = true; in nv50_head_atomic_check()
376 asyc->set.mask = ~0; in nv50_head_atomic_check()
377 asyh->set.mask = ~0; in nv50_head_atomic_check()
378 asyh->set.or = head->func->or != NULL; in nv50_head_atomic_check()
381 if (asyh->state.mode_changed || asyh->state.connectors_changed) in nv50_head_atomic_check()
385 asyh->olut.visible = asyh->olut.handle != 0; in nv50_head_atomic_check()
388 if (asyc->set.scaler) in nv50_head_atomic_check()
390 if (asyc->set.dither) in nv50_head_atomic_check()
392 if (asyc->set.procamp) in nv50_head_atomic_check()
396 if (head->func->core_calc) { in nv50_head_atomic_check()
397 head->func->core_calc(head, asyh); in nv50_head_atomic_check()
398 if (!asyh->core.visible) in nv50_head_atomic_check()
399 asyh->olut.visible = false; in nv50_head_atomic_check()
402 asyh->set.base = armh->base.cpp != asyh->base.cpp; in nv50_head_atomic_check()
403 asyh->set.ovly = armh->ovly.cpp != asyh->ovly.cpp; in nv50_head_atomic_check()
405 asyh->olut.visible = false; in nv50_head_atomic_check()
406 asyh->core.visible = false; in nv50_head_atomic_check()
407 asyh->curs.visible = false; in nv50_head_atomic_check()
408 asyh->base.cpp = 0; in nv50_head_atomic_check()
409 asyh->ovly.cpp = 0; in nv50_head_atomic_check()
412 if (!drm_atomic_crtc_needs_modeset(&asyh->state)) { in nv50_head_atomic_check()
413 if (asyh->core.visible) { in nv50_head_atomic_check()
414 if (memcmp(&armh->core, &asyh->core, sizeof(asyh->core))) in nv50_head_atomic_check()
415 asyh->set.core = true; in nv50_head_atomic_check()
417 if (armh->core.visible) { in nv50_head_atomic_check()
418 asyh->clr.core = true; in nv50_head_atomic_check()
421 if (asyh->curs.visible) { in nv50_head_atomic_check()
422 if (memcmp(&armh->curs, &asyh->curs, sizeof(asyh->curs))) in nv50_head_atomic_check()
423 asyh->set.curs = true; in nv50_head_atomic_check()
425 if (armh->curs.visible) { in nv50_head_atomic_check()
426 asyh->clr.curs = true; in nv50_head_atomic_check()
429 if (asyh->olut.visible) { in nv50_head_atomic_check()
430 if (memcmp(&armh->olut, &asyh->olut, sizeof(asyh->olut))) in nv50_head_atomic_check()
431 asyh->set.olut = true; in nv50_head_atomic_check()
433 if (armh->olut.visible) { in nv50_head_atomic_check()
434 asyh->clr.olut = true; in nv50_head_atomic_check()
437 asyh->clr.olut = armh->olut.visible; in nv50_head_atomic_check()
438 asyh->clr.core = armh->core.visible; in nv50_head_atomic_check()
439 asyh->clr.curs = armh->curs.visible; in nv50_head_atomic_check()
440 asyh->set.olut = asyh->olut.visible; in nv50_head_atomic_check()
441 asyh->set.core = asyh->core.visible; in nv50_head_atomic_check()
442 asyh->set.curs = asyh->curs.visible; in nv50_head_atomic_check()
449 if (asyh->clr.mask || asyh->set.mask) in nv50_head_atomic_check()
450 nv50_atom(asyh->state.state)->lock_core = true; in nv50_head_atomic_check()
465 __drm_atomic_helper_crtc_destroy_state(&asyh->state); in nv50_head_atomic_destroy_state()
472 struct nv50_head_atom *armh = nv50_head_atom(crtc->state); in nv50_head_atomic_duplicate_state()
476 __drm_atomic_helper_crtc_duplicate_state(crtc, &asyh->state); in nv50_head_atomic_duplicate_state()
477 asyh->wndw = armh->wndw; in nv50_head_atomic_duplicate_state()
478 asyh->view = armh->view; in nv50_head_atomic_duplicate_state()
479 asyh->mode = armh->mode; in nv50_head_atomic_duplicate_state()
480 asyh->olut = armh->olut; in nv50_head_atomic_duplicate_state()
481 asyh->core = armh->core; in nv50_head_atomic_duplicate_state()
482 asyh->curs = armh->curs; in nv50_head_atomic_duplicate_state()
483 asyh->base = armh->base; in nv50_head_atomic_duplicate_state()
484 asyh->ovly = armh->ovly; in nv50_head_atomic_duplicate_state()
485 asyh->dither = armh->dither; in nv50_head_atomic_duplicate_state()
486 asyh->procamp = armh->procamp; in nv50_head_atomic_duplicate_state()
487 asyh->crc = armh->crc; in nv50_head_atomic_duplicate_state()
488 asyh->or = armh->or; in nv50_head_atomic_duplicate_state()
489 asyh->dp = armh->dp; in nv50_head_atomic_duplicate_state()
490 asyh->clr.mask = 0; in nv50_head_atomic_duplicate_state()
491 asyh->set.mask = 0; in nv50_head_atomic_duplicate_state()
492 return &asyh->state; in nv50_head_atomic_duplicate_state()
503 if (crtc->state) in nv50_head_reset()
504 nv50_head_atomic_destroy_state(crtc, crtc->state); in nv50_head_reset()
506 __drm_atomic_helper_crtc_reset(crtc, &asyh->state); in nv50_head_reset()
520 nvif_notify_dtor(&head->base.vblank); in nv50_head_destroy()
521 nv50_lut_fini(&head->olut); in nv50_head_destroy()
562 if (drm_crtc_handle_vblank(&nv_crtc->base)) in nv50_head_vblank_handler()
563 nv50_crc_handle_vblank(nv50_head(&nv_crtc->base)); in nv50_head_vblank_handler()
582 return ERR_PTR(-ENOMEM); in nv50_head_create()
584 head->func = disp->core->func->head; in nv50_head_create()
585 head->base.index = index; in nv50_head_create()
587 if (disp->disp->object.oclass < GF110_DISP) in nv50_head_create()
592 if (disp->disp->object.oclass < GV100_DISP) { in nv50_head_create()
593 ret = nv50_base_new(drm, head->base.index, &base); in nv50_head_create()
594 ret = nv50_ovly_new(drm, head->base.index, &ovly); in nv50_head_create()
597 head->base.index * 2 + 0, &base); in nv50_head_create()
599 head->base.index * 2 + 1, &ovly); in nv50_head_create()
602 ret = nv50_curs_new(drm, head->base.index, &curs); in nv50_head_create()
608 nv_crtc = &head->base; in nv50_head_create()
609 crtc = &nv_crtc->base; in nv50_head_create()
610 drm_crtc_init_with_planes(dev, crtc, &base->plane, &curs->plane, in nv50_head_create()
611 funcs, "head-%d", head->base.index); in nv50_head_create()
615 drm_crtc_enable_color_mgmt(crtc, base->func->ilut_size, in nv50_head_create()
616 disp->disp->object.oclass >= GF110_DISP, in nv50_head_create()
617 head->func->olut_size); in nv50_head_create()
619 if (head->func->olut_set) { in nv50_head_create()
620 ret = nv50_lut_init(disp, &drm->client.mmu, &head->olut); in nv50_head_create()
627 ret = nvif_notify_ctor(&disp->disp->object, "kmsVbl", nv50_head_vblank_handler, in nv50_head_create()
630 .head = nv_crtc->index, in nv50_head_create()
634 &nv_crtc->vblank); in nv50_head_create()