Lines Matching refs:encoder
113 void nv04_dfp_update_fp_control(struct drm_encoder *encoder, int mode) in nv04_dfp_update_fp_control() argument
115 struct drm_device *dev = encoder->dev; in nv04_dfp_update_fp_control()
121 nv_crtc = nouveau_crtc(encoder->crtc); in nv04_dfp_update_fp_control()
132 nv_crtc->fp_users |= 1 << nouveau_encoder(encoder)->dcb->index; in nv04_dfp_update_fp_control()
139 nv_crtc->fp_users &= ~(1 << nouveau_encoder(encoder)->dcb->index); in nv04_dfp_update_fp_control()
152 static struct drm_encoder *get_tmds_slave(struct drm_encoder *encoder) in get_tmds_slave() argument
154 struct drm_device *dev = encoder->dev; in get_tmds_slave()
155 struct dcb_output *dcb = nouveau_encoder(encoder)->dcb; in get_tmds_slave()
182 static bool nv04_dfp_mode_fixup(struct drm_encoder *encoder, in nv04_dfp_mode_fixup() argument
186 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); in nv04_dfp_mode_fixup()
245 static void nv04_dfp_prepare(struct drm_encoder *encoder) in nv04_dfp_prepare() argument
247 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); in nv04_dfp_prepare()
248 const struct drm_encoder_helper_funcs *helper = encoder->helper_private; in nv04_dfp_prepare()
249 struct drm_device *dev = encoder->dev; in nv04_dfp_prepare()
250 int head = nouveau_crtc(encoder->crtc)->index; in nv04_dfp_prepare()
255 helper->dpms(encoder, DRM_MODE_DPMS_OFF); in nv04_dfp_prepare()
280 static void nv04_dfp_mode_set(struct drm_encoder *encoder, in nv04_dfp_mode_set() argument
284 struct drm_device *dev = encoder->dev; in nv04_dfp_mode_set()
287 struct nouveau_crtc *nv_crtc = nouveau_crtc(encoder->crtc); in nv04_dfp_mode_set()
291 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); in nv04_dfp_mode_set()
294 const struct drm_framebuffer *fb = encoder->crtc->primary->fb; in nv04_dfp_mode_set()
446 static void nv04_dfp_commit(struct drm_encoder *encoder) in nv04_dfp_commit() argument
448 struct drm_device *dev = encoder->dev; in nv04_dfp_commit()
450 const struct drm_encoder_helper_funcs *helper = encoder->helper_private; in nv04_dfp_commit()
451 struct nouveau_crtc *nv_crtc = nouveau_crtc(encoder->crtc); in nv04_dfp_commit()
452 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); in nv04_dfp_commit()
454 int head = nouveau_crtc(encoder->crtc)->index; in nv04_dfp_commit()
469 NVWriteRAMDAC(dev, 0, NV_PRAMDAC_TEST_CONTROL + nv04_dac_output_offset(encoder), 0xf0000000); in nv04_dfp_commit()
471 NVWriteRAMDAC(dev, 0, NV_PRAMDAC_TEST_CONTROL + nv04_dac_output_offset(encoder), 0x00100000); in nv04_dfp_commit()
474 slave_encoder = get_tmds_slave(encoder); in nv04_dfp_commit()
479 helper->dpms(encoder, DRM_MODE_DPMS_ON); in nv04_dfp_commit()
486 static void nv04_dfp_update_backlight(struct drm_encoder *encoder, int mode) in nv04_dfp_update_backlight() argument
489 struct drm_device *dev = encoder->dev; in nv04_dfp_update_backlight()
514 static void nv04_lvds_dpms(struct drm_encoder *encoder, int mode) in nv04_lvds_dpms() argument
516 struct drm_device *dev = encoder->dev; in nv04_lvds_dpms()
517 struct drm_crtc *crtc = encoder->crtc; in nv04_lvds_dpms()
519 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); in nv04_lvds_dpms()
550 nv04_dfp_update_backlight(encoder, mode); in nv04_lvds_dpms()
551 nv04_dfp_update_fp_control(encoder, mode); in nv04_lvds_dpms()
562 static void nv04_tmds_dpms(struct drm_encoder *encoder, int mode) in nv04_tmds_dpms() argument
564 struct nouveau_drm *drm = nouveau_drm(encoder->dev); in nv04_tmds_dpms()
565 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); in nv04_tmds_dpms()
574 nv04_dfp_update_backlight(encoder, mode); in nv04_tmds_dpms()
575 nv04_dfp_update_fp_control(encoder, mode); in nv04_tmds_dpms()
578 static void nv04_dfp_save(struct drm_encoder *encoder) in nv04_dfp_save() argument
580 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); in nv04_dfp_save()
581 struct drm_device *dev = encoder->dev; in nv04_dfp_save()
588 static void nv04_dfp_restore(struct drm_encoder *encoder) in nv04_dfp_restore() argument
590 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); in nv04_dfp_restore()
591 struct drm_device *dev = encoder->dev; in nv04_dfp_restore()
613 static void nv04_dfp_destroy(struct drm_encoder *encoder) in nv04_dfp_destroy() argument
615 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); in nv04_dfp_destroy()
617 if (get_slave_funcs(encoder)) in nv04_dfp_destroy()
618 get_slave_funcs(encoder)->destroy(encoder); in nv04_dfp_destroy()
620 drm_encoder_cleanup(encoder); in nv04_dfp_destroy()
624 static void nv04_tmds_slave_init(struct drm_encoder *encoder) in nv04_tmds_slave_init() argument
626 struct drm_device *dev = encoder->dev; in nv04_tmds_slave_init()
627 struct dcb_output *dcb = nouveau_encoder(encoder)->dcb; in nv04_tmds_slave_init()
645 if (!nv_gf4_disp_arch(dev) || !bus || get_tmds_slave(encoder)) in nv04_tmds_slave_init()
652 drm_i2c_encoder_init(dev, to_encoder_slave(encoder), in nv04_tmds_slave_init()
683 struct drm_encoder *encoder; in nv04_dfp_create() local
706 encoder = to_drm_encoder(nv_encoder); in nv04_dfp_create()
711 drm_encoder_init(connector->dev, encoder, &nv04_dfp_funcs, type, NULL); in nv04_dfp_create()
712 drm_encoder_helper_add(encoder, helper); in nv04_dfp_create()
714 encoder->possible_crtcs = entry->heads; in nv04_dfp_create()
715 encoder->possible_clones = 0; in nv04_dfp_create()
719 nv04_tmds_slave_init(encoder); in nv04_dfp_create()
721 drm_connector_attach_encoder(connector, encoder); in nv04_dfp_create()