Lines Matching refs:encoder

46 static uint32_t nv42_tv_sample_load(struct drm_encoder *encoder)  in nv42_tv_sample_load()  argument
48 struct drm_device *dev = encoder->dev; in nv42_tv_sample_load()
51 uint32_t testval, regoffset = nv04_dac_output_offset(encoder); in nv42_tv_sample_load()
145 nv17_tv_detect(struct drm_encoder *encoder, struct drm_connector *connector) in nv17_tv_detect() argument
147 struct drm_device *dev = encoder->dev; in nv17_tv_detect()
150 struct nv17_tv_encoder *tv_enc = to_tv_enc(encoder); in nv17_tv_detect()
154 if (nv04_dac_in_use(encoder)) in nv17_tv_detect()
161 nv42_tv_sample_load(encoder) >> 28 & 0xe; in nv17_tv_detect()
164 nv17_dac_sample_load(encoder) >> 28 & 0xe; in nv17_tv_detect()
201 static int nv17_tv_get_ld_modes(struct drm_encoder *encoder, in nv17_tv_get_ld_modes() argument
204 struct nv17_tv_norm_params *tv_norm = get_tv_norm(encoder); in nv17_tv_get_ld_modes()
211 mode = drm_mode_duplicate(encoder->dev, tv_mode); in nv17_tv_get_ld_modes()
231 static int nv17_tv_get_hd_modes(struct drm_encoder *encoder, in nv17_tv_get_hd_modes() argument
234 struct nv17_tv_norm_params *tv_norm = get_tv_norm(encoder); in nv17_tv_get_hd_modes()
260 mode = drm_mode_duplicate(encoder->dev, output_mode); in nv17_tv_get_hd_modes()
264 mode = drm_cvt_mode(encoder->dev, modes[i].hdisplay, in nv17_tv_get_hd_modes()
293 static int nv17_tv_get_modes(struct drm_encoder *encoder, in nv17_tv_get_modes() argument
296 struct nv17_tv_norm_params *tv_norm = get_tv_norm(encoder); in nv17_tv_get_modes()
299 return nv17_tv_get_hd_modes(encoder, connector); in nv17_tv_get_modes()
301 return nv17_tv_get_ld_modes(encoder, connector); in nv17_tv_get_modes()
304 static int nv17_tv_mode_valid(struct drm_encoder *encoder, in nv17_tv_mode_valid() argument
307 struct nv17_tv_norm_params *tv_norm = get_tv_norm(encoder); in nv17_tv_mode_valid()
345 static bool nv17_tv_mode_fixup(struct drm_encoder *encoder, in nv17_tv_mode_fixup() argument
349 struct nv17_tv_norm_params *tv_norm = get_tv_norm(encoder); in nv17_tv_mode_fixup()
351 if (nv04_dac_in_use(encoder)) in nv17_tv_mode_fixup()
362 static void nv17_tv_dpms(struct drm_encoder *encoder, int mode) in nv17_tv_dpms() argument
364 struct drm_device *dev = encoder->dev; in nv17_tv_dpms()
367 struct nv17_tv_state *regs = &to_tv_enc(encoder)->state; in nv17_tv_dpms()
368 struct nv17_tv_norm_params *tv_norm = get_tv_norm(encoder); in nv17_tv_dpms()
370 if (nouveau_encoder(encoder)->last_dpms == mode) in nv17_tv_dpms()
372 nouveau_encoder(encoder)->last_dpms = mode; in nv17_tv_dpms()
375 mode, nouveau_encoder(encoder)->dcb->index); in nv17_tv_dpms()
380 nv04_dfp_update_fp_control(encoder, mode); in nv17_tv_dpms()
383 nv04_dfp_update_fp_control(encoder, DRM_MODE_DPMS_OFF); in nv17_tv_dpms()
394 nv04_dac_update_dacclk(encoder, mode == DRM_MODE_DPMS_ON); in nv17_tv_dpms()
397 static void nv17_tv_prepare(struct drm_encoder *encoder) in nv17_tv_prepare() argument
399 struct drm_device *dev = encoder->dev; in nv17_tv_prepare()
401 const struct drm_encoder_helper_funcs *helper = encoder->helper_private; in nv17_tv_prepare()
402 struct nv17_tv_norm_params *tv_norm = get_tv_norm(encoder); in nv17_tv_prepare()
403 int head = nouveau_crtc(encoder->crtc)->index; in nv17_tv_prepare()
407 nv04_dac_output_offset(encoder); in nv17_tv_prepare()
410 helper->dpms(encoder, DRM_MODE_DPMS_OFF); in nv17_tv_prepare()
458 static void nv17_tv_mode_set(struct drm_encoder *encoder, in nv17_tv_mode_set() argument
462 struct drm_device *dev = encoder->dev; in nv17_tv_mode_set()
464 int head = nouveau_crtc(encoder->crtc)->index; in nv17_tv_mode_set()
466 struct nv17_tv_state *tv_regs = &to_tv_enc(encoder)->state; in nv17_tv_mode_set()
467 struct nv17_tv_norm_params *tv_norm = get_tv_norm(encoder); in nv17_tv_mode_set()
573 static void nv17_tv_commit(struct drm_encoder *encoder) in nv17_tv_commit() argument
575 struct drm_device *dev = encoder->dev; in nv17_tv_commit()
577 struct nouveau_crtc *nv_crtc = nouveau_crtc(encoder->crtc); in nv17_tv_commit()
578 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); in nv17_tv_commit()
579 const struct drm_encoder_helper_funcs *helper = encoder->helper_private; in nv17_tv_commit()
581 if (get_tv_norm(encoder)->kind == TV_ENC_MODE) { in nv17_tv_commit()
582 nv17_tv_update_rescaler(encoder); in nv17_tv_commit()
583 nv17_tv_update_properties(encoder); in nv17_tv_commit()
585 nv17_ctv_update_rescaler(encoder); in nv17_tv_commit()
588 nv17_tv_state_load(dev, &to_tv_enc(encoder)->state); in nv17_tv_commit()
593 nv04_dac_output_offset(encoder), in nv17_tv_commit()
597 nv04_dac_output_offset(encoder), in nv17_tv_commit()
600 helper->dpms(encoder, DRM_MODE_DPMS_ON); in nv17_tv_commit()
607 static void nv17_tv_save(struct drm_encoder *encoder) in nv17_tv_save() argument
609 struct drm_device *dev = encoder->dev; in nv17_tv_save()
610 struct nv17_tv_encoder *tv_enc = to_tv_enc(encoder); in nv17_tv_save()
612 nouveau_encoder(encoder)->restore.output = in nv17_tv_save()
615 nv04_dac_output_offset(encoder)); in nv17_tv_save()
622 static void nv17_tv_restore(struct drm_encoder *encoder) in nv17_tv_restore() argument
624 struct drm_device *dev = encoder->dev; in nv17_tv_restore()
627 nv04_dac_output_offset(encoder), in nv17_tv_restore()
628 nouveau_encoder(encoder)->restore.output); in nv17_tv_restore()
630 nv17_tv_state_load(dev, &to_tv_enc(encoder)->saved_state); in nv17_tv_restore()
632 nouveau_encoder(encoder)->last_dpms = NV_DPMS_CLEARED; in nv17_tv_restore()
635 static int nv17_tv_create_resources(struct drm_encoder *encoder, in nv17_tv_create_resources() argument
638 struct drm_device *dev = encoder->dev; in nv17_tv_create_resources()
641 struct nv17_tv_encoder *tv_enc = to_tv_enc(encoder); in nv17_tv_create_resources()
642 struct dcb_output *dcb = nouveau_encoder(encoder)->dcb; in nv17_tv_create_resources()
684 static int nv17_tv_set_property(struct drm_encoder *encoder, in nv17_tv_set_property() argument
689 struct drm_mode_config *conf = &encoder->dev->mode_config; in nv17_tv_set_property()
690 struct drm_crtc *crtc = encoder->crtc; in nv17_tv_set_property()
691 struct nv17_tv_encoder *tv_enc = to_tv_enc(encoder); in nv17_tv_set_property()
692 struct nv17_tv_norm_params *tv_norm = get_tv_norm(encoder); in nv17_tv_set_property()
697 if (encoder->crtc) { in nv17_tv_set_property()
699 nv17_ctv_update_rescaler(encoder); in nv17_tv_set_property()
701 nv17_tv_update_rescaler(encoder); in nv17_tv_set_property()
709 nv17_tv_update_properties(encoder); in nv17_tv_set_property()
716 nv17_tv_update_properties(encoder); in nv17_tv_set_property()
723 if (encoder->crtc) in nv17_tv_set_property()
724 nv17_tv_update_rescaler(encoder); in nv17_tv_set_property()
739 nv17_tv_update_properties(encoder); in nv17_tv_set_property()
759 static void nv17_tv_destroy(struct drm_encoder *encoder) in nv17_tv_destroy() argument
761 struct nv17_tv_encoder *tv_enc = to_tv_enc(encoder); in nv17_tv_destroy()
763 drm_encoder_cleanup(encoder); in nv17_tv_destroy()
791 struct drm_encoder *encoder; in nv17_tv_create() local
807 encoder = to_drm_encoder(&tv_enc->base); in nv17_tv_create()
812 drm_encoder_init(dev, encoder, &nv17_tv_funcs, DRM_MODE_ENCODER_TVDAC, in nv17_tv_create()
814 drm_encoder_helper_add(encoder, &nv17_tv_helper_funcs); in nv17_tv_create()
815 to_encoder_slave(encoder)->slave_funcs = &nv17_tv_slave_funcs; in nv17_tv_create()
820 encoder->possible_crtcs = entry->heads; in nv17_tv_create()
821 encoder->possible_clones = 0; in nv17_tv_create()
823 nv17_tv_create_resources(encoder, connector); in nv17_tv_create()
824 drm_connector_attach_encoder(connector, encoder); in nv17_tv_create()