Lines Matching full:encoder

45 static uint32_t nv42_tv_sample_load(struct drm_encoder *encoder)  in nv42_tv_sample_load()  argument
47 struct drm_device *dev = encoder->dev; in nv42_tv_sample_load()
50 uint32_t testval, regoffset = nv04_dac_output_offset(encoder); in nv42_tv_sample_load()
144 nv17_tv_detect(struct drm_encoder *encoder, struct drm_connector *connector) in nv17_tv_detect() argument
146 struct drm_device *dev = encoder->dev; in nv17_tv_detect()
149 struct nv17_tv_encoder *tv_enc = to_tv_enc(encoder); in nv17_tv_detect()
153 if (nv04_dac_in_use(encoder)) in nv17_tv_detect()
160 nv42_tv_sample_load(encoder) >> 28 & 0xe; in nv17_tv_detect()
163 nv17_dac_sample_load(encoder) >> 28 & 0xe; in nv17_tv_detect()
200 static int nv17_tv_get_ld_modes(struct drm_encoder *encoder, in nv17_tv_get_ld_modes() argument
203 struct nv17_tv_norm_params *tv_norm = get_tv_norm(encoder); in nv17_tv_get_ld_modes()
210 mode = drm_mode_duplicate(encoder->dev, tv_mode); in nv17_tv_get_ld_modes()
230 static int nv17_tv_get_hd_modes(struct drm_encoder *encoder, in nv17_tv_get_hd_modes() argument
233 struct nv17_tv_norm_params *tv_norm = get_tv_norm(encoder); in nv17_tv_get_hd_modes()
259 mode = drm_mode_duplicate(encoder->dev, output_mode); in nv17_tv_get_hd_modes()
263 mode = drm_cvt_mode(encoder->dev, modes[i].hdisplay, in nv17_tv_get_hd_modes()
292 static int nv17_tv_get_modes(struct drm_encoder *encoder, in nv17_tv_get_modes() argument
295 struct nv17_tv_norm_params *tv_norm = get_tv_norm(encoder); in nv17_tv_get_modes()
298 return nv17_tv_get_hd_modes(encoder, connector); in nv17_tv_get_modes()
300 return nv17_tv_get_ld_modes(encoder, connector); in nv17_tv_get_modes()
303 static int nv17_tv_mode_valid(struct drm_encoder *encoder, in nv17_tv_mode_valid() argument
306 struct nv17_tv_norm_params *tv_norm = get_tv_norm(encoder); in nv17_tv_mode_valid()
336 /* The encoder takes care of the actual interlacing */ in nv17_tv_mode_valid()
344 static bool nv17_tv_mode_fixup(struct drm_encoder *encoder, in nv17_tv_mode_fixup() argument
348 struct nv17_tv_norm_params *tv_norm = get_tv_norm(encoder); in nv17_tv_mode_fixup()
350 if (nv04_dac_in_use(encoder)) in nv17_tv_mode_fixup()
361 static void nv17_tv_dpms(struct drm_encoder *encoder, int mode) in nv17_tv_dpms() argument
363 struct drm_device *dev = encoder->dev; in nv17_tv_dpms()
366 struct nv17_tv_state *regs = &to_tv_enc(encoder)->state; in nv17_tv_dpms()
367 struct nv17_tv_norm_params *tv_norm = get_tv_norm(encoder); in nv17_tv_dpms()
369 if (nouveau_encoder(encoder)->last_dpms == mode) in nv17_tv_dpms()
371 nouveau_encoder(encoder)->last_dpms = mode; in nv17_tv_dpms()
373 NV_INFO(drm, "Setting dpms mode %d on TV encoder (output %d)\n", in nv17_tv_dpms()
374 mode, nouveau_encoder(encoder)->dcb->index); in nv17_tv_dpms()
379 nv04_dfp_update_fp_control(encoder, mode); in nv17_tv_dpms()
382 nv04_dfp_update_fp_control(encoder, DRM_MODE_DPMS_OFF); in nv17_tv_dpms()
393 nv04_dac_update_dacclk(encoder, mode == DRM_MODE_DPMS_ON); in nv17_tv_dpms()
396 static void nv17_tv_prepare(struct drm_encoder *encoder) in nv17_tv_prepare() argument
398 struct drm_device *dev = encoder->dev; in nv17_tv_prepare()
400 const struct drm_encoder_helper_funcs *helper = encoder->helper_private; in nv17_tv_prepare()
401 struct nv17_tv_norm_params *tv_norm = get_tv_norm(encoder); in nv17_tv_prepare()
402 int head = nouveau_crtc(encoder->crtc)->index; in nv17_tv_prepare()
406 nv04_dac_output_offset(encoder); in nv17_tv_prepare()
409 helper->dpms(encoder, DRM_MODE_DPMS_OFF); in nv17_tv_prepare()
457 static void nv17_tv_mode_set(struct drm_encoder *encoder, in nv17_tv_mode_set() argument
461 struct drm_device *dev = encoder->dev; in nv17_tv_mode_set()
463 int head = nouveau_crtc(encoder->crtc)->index; in nv17_tv_mode_set()
465 struct nv17_tv_state *tv_regs = &to_tv_enc(encoder)->state; in nv17_tv_mode_set()
466 struct nv17_tv_norm_params *tv_norm = get_tv_norm(encoder); in nv17_tv_mode_set()
523 * parameters for the CTV encoder (It's only used for "HD" TV in nv17_tv_mode_set()
526 * output of the FP encoder, but it also needs the analog in nv17_tv_mode_set()
527 * encoder in its OR enabled and routed to the head it's in nv17_tv_mode_set()
572 static void nv17_tv_commit(struct drm_encoder *encoder) in nv17_tv_commit() argument
574 struct drm_device *dev = encoder->dev; in nv17_tv_commit()
576 struct nouveau_crtc *nv_crtc = nouveau_crtc(encoder->crtc); in nv17_tv_commit()
577 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); in nv17_tv_commit()
578 const struct drm_encoder_helper_funcs *helper = encoder->helper_private; in nv17_tv_commit()
580 if (get_tv_norm(encoder)->kind == TV_ENC_MODE) { in nv17_tv_commit()
581 nv17_tv_update_rescaler(encoder); in nv17_tv_commit()
582 nv17_tv_update_properties(encoder); in nv17_tv_commit()
584 nv17_ctv_update_rescaler(encoder); in nv17_tv_commit()
587 nv17_tv_state_load(dev, &to_tv_enc(encoder)->state); in nv17_tv_commit()
592 nv04_dac_output_offset(encoder), in nv17_tv_commit()
596 nv04_dac_output_offset(encoder), in nv17_tv_commit()
599 helper->dpms(encoder, DRM_MODE_DPMS_ON); in nv17_tv_commit()
606 static void nv17_tv_save(struct drm_encoder *encoder) in nv17_tv_save() argument
608 struct drm_device *dev = encoder->dev; in nv17_tv_save()
609 struct nv17_tv_encoder *tv_enc = to_tv_enc(encoder); in nv17_tv_save()
611 nouveau_encoder(encoder)->restore.output = in nv17_tv_save()
614 nv04_dac_output_offset(encoder)); in nv17_tv_save()
621 static void nv17_tv_restore(struct drm_encoder *encoder) in nv17_tv_restore() argument
623 struct drm_device *dev = encoder->dev; in nv17_tv_restore()
626 nv04_dac_output_offset(encoder), in nv17_tv_restore()
627 nouveau_encoder(encoder)->restore.output); in nv17_tv_restore()
629 nv17_tv_state_load(dev, &to_tv_enc(encoder)->saved_state); in nv17_tv_restore()
631 nouveau_encoder(encoder)->last_dpms = NV_DPMS_CLEARED; in nv17_tv_restore()
634 static int nv17_tv_create_resources(struct drm_encoder *encoder, in nv17_tv_create_resources() argument
637 struct drm_device *dev = encoder->dev; in nv17_tv_create_resources()
640 struct nv17_tv_encoder *tv_enc = to_tv_enc(encoder); in nv17_tv_create_resources()
641 struct dcb_output *dcb = nouveau_encoder(encoder)->dcb; in nv17_tv_create_resources()
683 static int nv17_tv_set_property(struct drm_encoder *encoder, in nv17_tv_set_property() argument
688 struct drm_mode_config *conf = &encoder->dev->mode_config; in nv17_tv_set_property()
689 struct drm_crtc *crtc = encoder->crtc; in nv17_tv_set_property()
690 struct nv17_tv_encoder *tv_enc = to_tv_enc(encoder); in nv17_tv_set_property()
691 struct nv17_tv_norm_params *tv_norm = get_tv_norm(encoder); in nv17_tv_set_property()
696 if (encoder->crtc) { in nv17_tv_set_property()
698 nv17_ctv_update_rescaler(encoder); in nv17_tv_set_property()
700 nv17_tv_update_rescaler(encoder); in nv17_tv_set_property()
708 nv17_tv_update_properties(encoder); in nv17_tv_set_property()
715 nv17_tv_update_properties(encoder); in nv17_tv_set_property()
722 if (encoder->crtc) in nv17_tv_set_property()
723 nv17_tv_update_rescaler(encoder); in nv17_tv_set_property()
738 nv17_tv_update_properties(encoder); in nv17_tv_set_property()
758 static void nv17_tv_destroy(struct drm_encoder *encoder) in nv17_tv_destroy() argument
760 struct nv17_tv_encoder *tv_enc = to_tv_enc(encoder); in nv17_tv_destroy()
762 drm_encoder_cleanup(encoder); in nv17_tv_destroy()
790 struct drm_encoder *encoder; in nv17_tv_create() local
806 encoder = to_drm_encoder(&tv_enc->base); in nv17_tv_create()
811 drm_encoder_init(dev, encoder, &nv17_tv_funcs, DRM_MODE_ENCODER_TVDAC, in nv17_tv_create()
813 drm_encoder_helper_add(encoder, &nv17_tv_helper_funcs); in nv17_tv_create()
814 to_encoder_slave(encoder)->slave_funcs = &nv17_tv_slave_funcs; in nv17_tv_create()
819 encoder->possible_crtcs = entry->heads; in nv17_tv_create()
820 encoder->possible_clones = 0; in nv17_tv_create()
822 nv17_tv_create_resources(encoder, connector); in nv17_tv_create()
823 drm_connector_attach_encoder(connector, encoder); in nv17_tv_create()