Lines Matching full: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()
132 static enum drm_connector_status nv04_dac_detect(struct drm_encoder *encoder, in nv04_dac_detect() argument
135 struct drm_device *dev = encoder->dev; in nv04_dac_detect()
235 uint32_t nv17_dac_sample_load(struct drm_encoder *encoder) in nv17_dac_sample_load() argument
237 struct drm_device *dev = encoder->dev; in nv17_dac_sample_load()
241 struct dcb_output *dcb = nouveau_encoder(encoder)->dcb; in nv17_dac_sample_load()
242 uint32_t sample, testval, regoffset = nv04_dac_output_offset(encoder); in nv17_dac_sample_load()
336 nv17_dac_detect(struct drm_encoder *encoder, struct drm_connector *connector) in nv17_dac_detect() argument
338 struct nouveau_drm *drm = nouveau_drm(encoder->dev); in nv17_dac_detect()
339 struct dcb_output *dcb = nouveau_encoder(encoder)->dcb; in nv17_dac_detect()
341 if (nv04_dac_in_use(encoder)) in nv17_dac_detect()
344 if (nv17_dac_sample_load(encoder) & in nv17_dac_detect()
354 static bool nv04_dac_mode_fixup(struct drm_encoder *encoder, in nv04_dac_mode_fixup() argument
358 if (nv04_dac_in_use(encoder)) in nv04_dac_mode_fixup()
364 static void nv04_dac_prepare(struct drm_encoder *encoder) in nv04_dac_prepare() argument
366 const struct drm_encoder_helper_funcs *helper = encoder->helper_private; in nv04_dac_prepare()
367 struct drm_device *dev = encoder->dev; in nv04_dac_prepare()
368 int head = nouveau_crtc(encoder->crtc)->index; in nv04_dac_prepare()
370 helper->dpms(encoder, DRM_MODE_DPMS_OFF); in nv04_dac_prepare()
375 static void nv04_dac_mode_set(struct drm_encoder *encoder, in nv04_dac_mode_set() argument
379 struct drm_device *dev = encoder->dev; in nv04_dac_mode_set()
381 int head = nouveau_crtc(encoder->crtc)->index; in nv04_dac_mode_set()
385 uint32_t dac_offset = nv04_dac_output_offset(encoder); in nv04_dac_mode_set()
394 if (rebind == encoder in nv04_dac_mode_set()
407 NVWriteRAMDAC(dev, 0, NV_PRAMDAC_TEST_CONTROL + nv04_dac_output_offset(encoder), 0xf0000000); in nv04_dac_mode_set()
409 NVWriteRAMDAC(dev, 0, NV_PRAMDAC_TEST_CONTROL + nv04_dac_output_offset(encoder), 0x00100000); in nv04_dac_mode_set()
412 static void nv04_dac_commit(struct drm_encoder *encoder) in nv04_dac_commit() argument
414 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); in nv04_dac_commit()
415 struct nouveau_drm *drm = nouveau_drm(encoder->dev); in nv04_dac_commit()
416 struct nouveau_crtc *nv_crtc = nouveau_crtc(encoder->crtc); in nv04_dac_commit()
417 const struct drm_encoder_helper_funcs *helper = encoder->helper_private; in nv04_dac_commit()
419 helper->dpms(encoder, DRM_MODE_DPMS_ON); in nv04_dac_commit()
426 void nv04_dac_update_dacclk(struct drm_encoder *encoder, bool enable) in nv04_dac_update_dacclk() argument
428 struct drm_device *dev = encoder->dev; in nv04_dac_update_dacclk()
429 struct dcb_output *dcb = nouveau_encoder(encoder)->dcb; in nv04_dac_update_dacclk()
433 int dacclk_off = NV_PRAMDAC_DACCLK + nv04_dac_output_offset(encoder); in nv04_dac_update_dacclk()
449 /* Check if the DAC corresponding to 'encoder' is being used by
451 bool nv04_dac_in_use(struct drm_encoder *encoder) in nv04_dac_in_use() argument
453 struct drm_device *dev = encoder->dev; in nv04_dac_in_use()
454 struct dcb_output *dcb = nouveau_encoder(encoder)->dcb; in nv04_dac_in_use()
456 return nv_gf4_disp_arch(encoder->dev) && in nv04_dac_in_use()
460 static void nv04_dac_dpms(struct drm_encoder *encoder, int mode) in nv04_dac_dpms() argument
462 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); in nv04_dac_dpms()
463 struct nouveau_drm *drm = nouveau_drm(encoder->dev); in nv04_dac_dpms()
469 NV_DEBUG(drm, "Setting dpms mode %d on vga encoder (output %d)\n", in nv04_dac_dpms()
472 nv04_dac_update_dacclk(encoder, mode == DRM_MODE_DPMS_ON); in nv04_dac_dpms()
475 static void nv04_dac_save(struct drm_encoder *encoder) in nv04_dac_save() argument
477 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); in nv04_dac_save()
478 struct drm_device *dev = encoder->dev; in nv04_dac_save()
482 nv04_dac_output_offset(encoder)); in nv04_dac_save()
485 static void nv04_dac_restore(struct drm_encoder *encoder) in nv04_dac_restore() argument
487 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); in nv04_dac_restore()
488 struct drm_device *dev = encoder->dev; in nv04_dac_restore()
491 NVWriteRAMDAC(dev, 0, NV_PRAMDAC_DACCLK + nv04_dac_output_offset(encoder), in nv04_dac_restore()
497 static void nv04_dac_destroy(struct drm_encoder *encoder) in nv04_dac_destroy() argument
499 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); in nv04_dac_destroy()
501 drm_encoder_cleanup(encoder); in nv04_dac_destroy()
533 struct drm_encoder *encoder; in nv04_dac_create() local
539 encoder = to_drm_encoder(nv_encoder); in nv04_dac_create()
552 drm_encoder_init(dev, encoder, &nv04_dac_funcs, DRM_MODE_ENCODER_DAC, in nv04_dac_create()
554 drm_encoder_helper_add(encoder, helper); in nv04_dac_create()
556 encoder->possible_crtcs = entry->heads; in nv04_dac_create()
557 encoder->possible_clones = 0; in nv04_dac_create()
559 drm_connector_attach_encoder(connector, encoder); in nv04_dac_create()