Lines Matching refs:crtc

47 nv04_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y,
51 crtc_wr_cio_state(struct drm_crtc *crtc, struct nv04_crtc_reg *crtcstate, int index) in crtc_wr_cio_state() argument
53 NVWriteVgaCrtc(crtc->dev, nouveau_crtc(crtc)->index, index, in crtc_wr_cio_state()
57 static void nv_crtc_set_digital_vibrance(struct drm_crtc *crtc, int level) in nv_crtc_set_digital_vibrance() argument
59 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); in nv_crtc_set_digital_vibrance()
60 struct drm_device *dev = crtc->dev; in nv_crtc_set_digital_vibrance()
64 if (nv_crtc->saturation && nv_gf4_disp_arch(crtc->dev)) { in nv_crtc_set_digital_vibrance()
67 crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_5B); in nv_crtc_set_digital_vibrance()
69 crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_CSB); in nv_crtc_set_digital_vibrance()
72 static void nv_crtc_set_image_sharpening(struct drm_crtc *crtc, int level) in nv_crtc_set_image_sharpening() argument
74 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); in nv_crtc_set_image_sharpening()
75 struct drm_device *dev = crtc->dev; in nv_crtc_set_image_sharpening()
82 NVWriteRAMDAC(crtc->dev, nv_crtc->index, NV_PRAMDAC_634, regp->ramdac_634); in nv_crtc_set_image_sharpening()
111 static void nv_crtc_calc_state_ext(struct drm_crtc *crtc, struct drm_display_mode * mode, int dot_c… in nv_crtc_calc_state_ext() argument
113 struct drm_device *dev = crtc->dev; in nv_crtc_calc_state_ext()
117 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); in nv_crtc_calc_state_ext()
169 nv_crtc_dpms(struct drm_crtc *crtc, int mode) in nv_crtc_dpms() argument
171 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); in nv_crtc_dpms()
172 struct drm_device *dev = crtc->dev; in nv_crtc_dpms()
231 nv_crtc_mode_fixup(struct drm_crtc *crtc, const struct drm_display_mode *mode, in nv_crtc_mode_fixup() argument
238 nv_crtc_mode_set_vga(struct drm_crtc *crtc, struct drm_display_mode *mode) in nv_crtc_mode_set_vga() argument
240 struct drm_device *dev = crtc->dev; in nv_crtc_mode_set_vga()
241 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); in nv_crtc_mode_set_vga()
243 struct drm_framebuffer *fb = crtc->primary->fb; in nv_crtc_mode_set_vga()
265 if (encoder->crtc == crtc && in nv_crtc_mode_set_vga()
462 nv_crtc_mode_set_regs(struct drm_crtc *crtc, struct drm_display_mode * mode) in nv_crtc_mode_set_regs() argument
464 struct drm_device *dev = crtc->dev; in nv_crtc_mode_set_regs()
466 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); in nv_crtc_mode_set_regs()
477 if (encoder->crtc != crtc) in nv_crtc_mode_set_regs()
534 nv_crtc_set_digital_vibrance(crtc, nv_crtc->saturation); in nv_crtc_mode_set_regs()
578 regp->CRTC[NV_CIO_CRE_PIXEL_INDEX] = (crtc->primary->fb->depth + 1) / 8; in nv_crtc_mode_set_regs()
592 if (crtc->primary->fb->depth == 16) in nv_crtc_mode_set_regs()
600 nv_crtc_set_image_sharpening(crtc, nv_crtc->sharpness); in nv_crtc_mode_set_regs()
610 nv_crtc_swap_fbs(struct drm_crtc *crtc, struct drm_framebuffer *old_fb) in nv_crtc_swap_fbs() argument
612 struct nv04_display *disp = nv04_display(crtc->dev); in nv_crtc_swap_fbs()
613 struct nouveau_framebuffer *nvfb = nouveau_framebuffer(crtc->primary->fb); in nv_crtc_swap_fbs()
614 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); in nv_crtc_swap_fbs()
636 nv_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode, in nv_crtc_mode_set() argument
640 struct drm_device *dev = crtc->dev; in nv_crtc_mode_set()
641 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); in nv_crtc_mode_set()
648 ret = nv_crtc_swap_fbs(crtc, old_fb); in nv_crtc_mode_set()
655 nv_crtc_mode_set_vga(crtc, adjusted_mode); in nv_crtc_mode_set()
659 nv_crtc_mode_set_regs(crtc, adjusted_mode); in nv_crtc_mode_set()
660 nv_crtc_calc_state_ext(crtc, mode, adjusted_mode->clock); in nv_crtc_mode_set()
664 static void nv_crtc_save(struct drm_crtc *crtc) in nv_crtc_save() argument
666 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); in nv_crtc_save()
667 struct drm_device *dev = crtc->dev; in nv_crtc_save()
673 if (nv_two_heads(crtc->dev)) in nv_crtc_save()
674 NVSetOwner(crtc->dev, nv_crtc->index); in nv_crtc_save()
676 nouveau_hw_save_state(crtc->dev, nv_crtc->index, saved); in nv_crtc_save()
685 static void nv_crtc_restore(struct drm_crtc *crtc) in nv_crtc_restore() argument
687 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); in nv_crtc_restore()
688 struct drm_device *dev = crtc->dev; in nv_crtc_restore()
692 if (nv_two_heads(crtc->dev)) in nv_crtc_restore()
693 NVSetOwner(crtc->dev, head); in nv_crtc_restore()
695 nouveau_hw_load_state(crtc->dev, head, &nv04_display(dev)->saved_reg); in nv_crtc_restore()
696 nv_lock_vga_crtc_shadow(crtc->dev, head, saved_cr21); in nv_crtc_restore()
701 static void nv_crtc_prepare(struct drm_crtc *crtc) in nv_crtc_prepare() argument
703 struct drm_device *dev = crtc->dev; in nv_crtc_prepare()
705 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); in nv_crtc_prepare()
706 const struct drm_crtc_helper_funcs *funcs = crtc->helper_private; in nv_crtc_prepare()
712 funcs->dpms(crtc, DRM_MODE_DPMS_OFF); in nv_crtc_prepare()
724 static void nv_crtc_commit(struct drm_crtc *crtc) in nv_crtc_commit() argument
726 struct drm_device *dev = crtc->dev; in nv_crtc_commit()
727 const struct drm_crtc_helper_funcs *funcs = crtc->helper_private; in nv_crtc_commit()
728 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); in nv_crtc_commit()
731 nv04_crtc_mode_set_base(crtc, crtc->x, crtc->y, NULL); in nv_crtc_commit()
742 funcs->dpms(crtc, DRM_MODE_DPMS_ON); in nv_crtc_commit()
746 static void nv_crtc_destroy(struct drm_crtc *crtc) in nv_crtc_destroy() argument
748 struct nv04_display *disp = nv04_display(crtc->dev); in nv_crtc_destroy()
749 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); in nv_crtc_destroy()
754 drm_crtc_cleanup(crtc); in nv_crtc_destroy()
767 nv_crtc_gamma_load(struct drm_crtc *crtc) in nv_crtc_gamma_load() argument
769 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); in nv_crtc_gamma_load()
785 nv_crtc_disable(struct drm_crtc *crtc) in nv_crtc_disable() argument
787 struct nv04_display *disp = nv04_display(crtc->dev); in nv_crtc_disable()
788 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); in nv_crtc_disable()
795 nv_crtc_gamma_set(struct drm_crtc *crtc, u16 *r, u16 *g, u16 *b, uint32_t start, in nv_crtc_gamma_set() argument
799 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); in nv_crtc_gamma_set()
817 nv_crtc_gamma_load(crtc); in nv_crtc_gamma_set()
821 nv04_crtc_do_mode_set_base(struct drm_crtc *crtc, in nv04_crtc_do_mode_set_base() argument
825 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); in nv04_crtc_do_mode_set_base()
826 struct drm_device *dev = crtc->dev; in nv04_crtc_do_mode_set_base()
836 if (!atomic && !crtc->primary->fb) { in nv04_crtc_do_mode_set_base()
848 drm_fb = crtc->primary->fb; in nv04_crtc_do_mode_set_base()
849 fb = nouveau_framebuffer(crtc->primary->fb); in nv04_crtc_do_mode_set_base()
856 nv_crtc_gamma_load(crtc); in nv04_crtc_do_mode_set_base()
861 regp->CRTC[NV_CIO_CRE_PIXEL_INDEX] |= (crtc->primary->fb->depth + 1) / 8; in nv04_crtc_do_mode_set_base()
863 if (crtc->primary->fb->depth == 16) in nv04_crtc_do_mode_set_base()
865 crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_PIXEL_INDEX); in nv04_crtc_do_mode_set_base()
874 crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_RPC0_INDEX); in nv04_crtc_do_mode_set_base()
875 crtc_wr_cio_state(crtc, regp, NV_CIO_CR_OFFSET_INDEX); in nv04_crtc_do_mode_set_base()
876 crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_42); in nv04_crtc_do_mode_set_base()
884 nouveau_calc_arb(dev, crtc->mode.clock, drm_fb->bits_per_pixel, in nv04_crtc_do_mode_set_base()
889 crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_FF_INDEX); in nv04_crtc_do_mode_set_base()
890 crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_FFLWM__INDEX); in nv04_crtc_do_mode_set_base()
894 crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_47); in nv04_crtc_do_mode_set_base()
901 nv04_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y, in nv04_crtc_mode_set_base() argument
904 int ret = nv_crtc_swap_fbs(crtc, old_fb); in nv04_crtc_mode_set_base()
907 return nv04_crtc_do_mode_set_base(crtc, old_fb, x, y, false); in nv04_crtc_mode_set_base()
911 nv04_crtc_mode_set_base_atomic(struct drm_crtc *crtc, in nv04_crtc_mode_set_base_atomic() argument
915 struct nouveau_drm *drm = nouveau_drm(crtc->dev); in nv04_crtc_mode_set_base_atomic()
923 return nv04_crtc_do_mode_set_base(crtc, fb, x, y, true); in nv04_crtc_mode_set_base_atomic()
987 nv04_crtc_cursor_set(struct drm_crtc *crtc, struct drm_file *file_priv, in nv04_crtc_cursor_set() argument
990 struct nouveau_drm *drm = nouveau_drm(crtc->dev); in nv04_crtc_cursor_set()
992 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); in nv04_crtc_cursor_set()
1029 nv04_crtc_cursor_move(struct drm_crtc *crtc, int x, int y) in nv04_crtc_cursor_move() argument
1031 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); in nv04_crtc_cursor_move()
1043 struct drm_crtc *crtc; in nouveau_crtc_set_config() local
1045 if (!set || !set->crtc) in nouveau_crtc_set_config()
1048 dev = set->crtc->dev; in nouveau_crtc_set_config()
1060 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { in nouveau_crtc_set_config()
1061 if (crtc->enabled) in nouveau_crtc_set_config()