Lines Matching refs:encoder
41 int nv04_dac_output_offset(struct drm_encoder *encoder) in nv04_dac_output_offset() argument
43 struct dcb_output *dcb = nouveau_encoder(encoder)->dcb; in nv04_dac_output_offset()
127 static enum drm_connector_status nv04_dac_detect(struct drm_encoder *encoder, in nv04_dac_detect() argument
130 struct drm_device *dev = encoder->dev; in nv04_dac_detect()
230 uint32_t nv17_dac_sample_load(struct drm_encoder *encoder) in nv17_dac_sample_load() argument
232 struct drm_device *dev = encoder->dev; in nv17_dac_sample_load()
236 struct dcb_output *dcb = nouveau_encoder(encoder)->dcb; in nv17_dac_sample_load()
237 uint32_t sample, testval, regoffset = nv04_dac_output_offset(encoder); in nv17_dac_sample_load()
331 nv17_dac_detect(struct drm_encoder *encoder, struct drm_connector *connector) in nv17_dac_detect() argument
333 struct nouveau_drm *drm = nouveau_drm(encoder->dev); in nv17_dac_detect()
334 struct dcb_output *dcb = nouveau_encoder(encoder)->dcb; in nv17_dac_detect()
336 if (nv04_dac_in_use(encoder)) in nv17_dac_detect()
339 if (nv17_dac_sample_load(encoder) & in nv17_dac_detect()
349 static bool nv04_dac_mode_fixup(struct drm_encoder *encoder, in nv04_dac_mode_fixup() argument
353 if (nv04_dac_in_use(encoder)) in nv04_dac_mode_fixup()
359 static void nv04_dac_prepare(struct drm_encoder *encoder) in nv04_dac_prepare() argument
361 const struct drm_encoder_helper_funcs *helper = encoder->helper_private; in nv04_dac_prepare()
362 struct drm_device *dev = encoder->dev; in nv04_dac_prepare()
363 int head = nouveau_crtc(encoder->crtc)->index; in nv04_dac_prepare()
365 helper->dpms(encoder, DRM_MODE_DPMS_OFF); in nv04_dac_prepare()
370 static void nv04_dac_mode_set(struct drm_encoder *encoder, in nv04_dac_mode_set() argument
374 struct drm_device *dev = encoder->dev; in nv04_dac_mode_set()
376 int head = nouveau_crtc(encoder->crtc)->index; in nv04_dac_mode_set()
380 uint32_t dac_offset = nv04_dac_output_offset(encoder); in nv04_dac_mode_set()
389 if (rebind == encoder in nv04_dac_mode_set()
402 NVWriteRAMDAC(dev, 0, NV_PRAMDAC_TEST_CONTROL + nv04_dac_output_offset(encoder), 0xf0000000); in nv04_dac_mode_set()
404 NVWriteRAMDAC(dev, 0, NV_PRAMDAC_TEST_CONTROL + nv04_dac_output_offset(encoder), 0x00100000); in nv04_dac_mode_set()
407 static void nv04_dac_commit(struct drm_encoder *encoder) in nv04_dac_commit() argument
409 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); in nv04_dac_commit()
410 struct nouveau_drm *drm = nouveau_drm(encoder->dev); in nv04_dac_commit()
411 struct nouveau_crtc *nv_crtc = nouveau_crtc(encoder->crtc); in nv04_dac_commit()
412 const struct drm_encoder_helper_funcs *helper = encoder->helper_private; in nv04_dac_commit()
414 helper->dpms(encoder, DRM_MODE_DPMS_ON); in nv04_dac_commit()
421 void nv04_dac_update_dacclk(struct drm_encoder *encoder, bool enable) in nv04_dac_update_dacclk() argument
423 struct drm_device *dev = encoder->dev; in nv04_dac_update_dacclk()
424 struct dcb_output *dcb = nouveau_encoder(encoder)->dcb; in nv04_dac_update_dacclk()
428 int dacclk_off = NV_PRAMDAC_DACCLK + nv04_dac_output_offset(encoder); in nv04_dac_update_dacclk()
446 bool nv04_dac_in_use(struct drm_encoder *encoder) in nv04_dac_in_use() argument
448 struct drm_device *dev = encoder->dev; in nv04_dac_in_use()
449 struct dcb_output *dcb = nouveau_encoder(encoder)->dcb; in nv04_dac_in_use()
451 return nv_gf4_disp_arch(encoder->dev) && in nv04_dac_in_use()
455 static void nv04_dac_dpms(struct drm_encoder *encoder, int mode) in nv04_dac_dpms() argument
457 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); in nv04_dac_dpms()
458 struct nouveau_drm *drm = nouveau_drm(encoder->dev); in nv04_dac_dpms()
467 nv04_dac_update_dacclk(encoder, mode == DRM_MODE_DPMS_ON); in nv04_dac_dpms()
470 static void nv04_dac_save(struct drm_encoder *encoder) in nv04_dac_save() argument
472 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); in nv04_dac_save()
473 struct drm_device *dev = encoder->dev; in nv04_dac_save()
477 nv04_dac_output_offset(encoder)); in nv04_dac_save()
480 static void nv04_dac_restore(struct drm_encoder *encoder) in nv04_dac_restore() argument
482 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); in nv04_dac_restore()
483 struct drm_device *dev = encoder->dev; in nv04_dac_restore()
486 NVWriteRAMDAC(dev, 0, NV_PRAMDAC_DACCLK + nv04_dac_output_offset(encoder), in nv04_dac_restore()
492 static void nv04_dac_destroy(struct drm_encoder *encoder) in nv04_dac_destroy() argument
494 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); in nv04_dac_destroy()
496 drm_encoder_cleanup(encoder); in nv04_dac_destroy()
532 struct drm_encoder *encoder; in nv04_dac_create() local
538 encoder = to_drm_encoder(nv_encoder); in nv04_dac_create()
548 drm_encoder_init(dev, encoder, &nv04_dac_funcs, DRM_MODE_ENCODER_DAC); in nv04_dac_create()
549 drm_encoder_helper_add(encoder, helper); in nv04_dac_create()
551 encoder->possible_crtcs = entry->heads; in nv04_dac_create()
552 encoder->possible_clones = 0; in nv04_dac_create()
554 drm_mode_connector_attach_encoder(connector, encoder); in nv04_dac_create()