Lines Matching +full:sense +full:- +full:mode

5  * Copyright 2007-2009 Stuart Bennett
43 struct dcb_output *dcb = nouveau_encoder(encoder)->dcb; in nv04_dac_output_offset()
46 if (dcb->or & (8 | DCB_OUTPUT_C)) in nv04_dac_output_offset()
48 if (dcb->or & (8 | DCB_OUTPUT_B)) in nv04_dac_output_offset()
55 * arbitrary limit to number of sense oscillations tolerated in one sample
66 static int sample_load_twice(struct drm_device *dev, bool sense[2]) in sample_load_twice()
69 struct nvif_object *device = &drm->client.device.object; in sample_load_twice()
77 * wait for bit 0 clear -- out of hblank -- (say reg value 0x4), in sample_load_twice()
78 * then wait for transition 0x4->0x5->0x4: enter hblank, leave in sample_load_twice()
83 if (nvif_msec(&drm->client.device, 10, in sample_load_twice()
87 return -EBUSY; in sample_load_twice()
89 if (nvif_msec(&drm->client.device, 10, in sample_load_twice()
93 return -EBUSY; in sample_load_twice()
95 if (nvif_msec(&drm->client.device, 10, in sample_load_twice()
99 return -EBUSY; in sample_load_twice()
102 /* when level triggers, sense is _LO_ */ in sample_load_twice()
116 /* force mis-match so we loop */ in sample_load_twice()
123 /* with so much oscillation, default to sense:LO */ in sample_load_twice()
124 sense[i] = false; in sample_load_twice()
126 sense[i] = sense_a; in sample_load_twice()
135 struct drm_device *dev = encoder->dev; in nv04_dac_detect()
136 struct nvif_object *device = &nouveau_drm(dev)->client.device.object; in nv04_dac_detect()
143 bool sense = true; in nv04_dac_detect() local
146 * for this detection to work, there needs to be a mode set up on the in nv04_dac_detect()
205 sense = false; in nv04_dac_detect()
207 sense = sense_pair[0]; in nv04_dac_detect()
210 * if sense goes LO before blue ramps to 0x18, monitor is not connected. in nv04_dac_detect()
213 } while (++blue < 0x18 && sense); in nv04_dac_detect()
237 struct drm_device *dev = encoder->dev; in nv17_dac_sample_load()
239 struct nvif_object *device = &nouveau_drm(dev)->client.device.object; in nv17_dac_sample_load()
240 struct nvkm_gpio *gpio = nvxx_gpio(&drm->client.device); in nv17_dac_sample_load()
241 struct dcb_output *dcb = nouveau_encoder(encoder)->dcb; in nv17_dac_sample_load()
248 if (dcb->type == DCB_OUTPUT_TV) { in nv17_dac_sample_load()
251 if (drm->vbios.tvdactestval) in nv17_dac_sample_load()
252 testval = drm->vbios.tvdactestval; in nv17_dac_sample_load()
256 if (drm->vbios.dactestval) in nv17_dac_sample_load()
257 testval = drm->vbios.dactestval; in nv17_dac_sample_load()
275 nvkm_gpio_set(gpio, 0, DCB_GPIO_TVDAC1, 0xff, dcb->type == DCB_OUTPUT_TV); in nv17_dac_sample_load()
276 nvkm_gpio_set(gpio, 0, DCB_GPIO_TVDAC0, 0xff, dcb->type == DCB_OUTPUT_TV); in nv17_dac_sample_load()
291 if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_CURIE) { in nv17_dac_sample_load()
292 if (dcb->type == DCB_OUTPUT_TV) in nv17_dac_sample_load()
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()
347 '@' + ffs(dcb->or)); in nv17_dac_detect()
355 const struct drm_display_mode *mode, in nv04_dac_mode_fixup() 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()
376 struct drm_display_mode *mode, 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()
388 /* bit 16-19 are bits that are set on some G70 cards, in nv04_dac_mode_set()
393 list_for_each_entry(rebind, &dev->mode_config.encoder_list, head) { in nv04_dac_mode_set()
395 || nouveau_encoder(rebind)->dcb->type != DCB_OUTPUT_ANALOG) in nv04_dac_mode_set()
406 if (drm->client.device.info.chipset < 0x44) in nv04_dac_mode_set()
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()
422 nv04_encoder_get_connector(nv_encoder)->base.name, in nv04_dac_commit()
423 nv_crtc->index, '@' + ffs(nv_encoder->dcb->or)); in nv04_dac_commit()
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()
432 uint32_t *dac_users = &nv04_display(dev)->dac_users[ffs(dcb->or) - 1]; in nv04_dac_update_dacclk()
437 *dac_users |= 1 << dcb->index; in nv04_dac_update_dacclk()
441 *dac_users &= ~(1 << dcb->index); in nv04_dac_update_dacclk()
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()
457 (nv04_display(dev)->dac_users[ffs(dcb->or) - 1] & ~(1 << dcb->index)); in nv04_dac_in_use()
460 static void nv04_dac_dpms(struct drm_encoder *encoder, int mode) in nv04_dac_dpms() argument
463 struct nouveau_drm *drm = nouveau_drm(encoder->dev); in nv04_dac_dpms()
465 if (nv_encoder->last_dpms == mode) in nv04_dac_dpms()
467 nv_encoder->last_dpms = mode; in nv04_dac_dpms()
469 NV_DEBUG(drm, "Setting dpms mode %d on vga encoder (output %d)\n", in nv04_dac_dpms()
470 mode, nv_encoder->dcb->index); in nv04_dac_dpms()
472 nv04_dac_update_dacclk(encoder, mode == DRM_MODE_DPMS_ON); in nv04_dac_dpms()
478 struct drm_device *dev = encoder->dev; in nv04_dac_save()
481 nv_encoder->restore.output = NVReadRAMDAC(dev, 0, NV_PRAMDAC_DACCLK + in nv04_dac_save()
488 struct drm_device *dev = encoder->dev; in nv04_dac_restore()
492 nv_encoder->restore.output); in nv04_dac_restore()
494 nv_encoder->last_dpms = NV_DPMS_CLEARED; in nv04_dac_restore()
532 struct drm_device *dev = connector->dev; in nv04_dac_create()
537 return -ENOMEM; in nv04_dac_create()
541 nv_encoder->dcb = entry; in nv04_dac_create()
542 nv_encoder->or = ffs(entry->or) - 1; in nv04_dac_create()
544 nv_encoder->enc_save = nv04_dac_save; in nv04_dac_create()
545 nv_encoder->enc_restore = nv04_dac_restore; in nv04_dac_create()
556 encoder->possible_crtcs = entry->heads; in nv04_dac_create()
557 encoder->possible_clones = 0; in nv04_dac_create()