Rev 4560 | Rev 5354 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4560 | Rev 5060 | ||
---|---|---|---|
Line 110... | Line 110... | ||
110 | return enc_to_dvo(intel_attached_encoder(connector)); |
110 | return enc_to_dvo(intel_attached_encoder(connector)); |
111 | } |
111 | } |
Line 112... | Line 112... | ||
112 | 112 | ||
113 | static bool intel_dvo_connector_get_hw_state(struct intel_connector *connector) |
113 | static bool intel_dvo_connector_get_hw_state(struct intel_connector *connector) |
- | 114 | { |
|
- | 115 | struct drm_device *dev = connector->base.dev; |
|
114 | { |
116 | struct drm_i915_private *dev_priv = dev->dev_private; |
- | 117 | struct intel_dvo *intel_dvo = intel_attached_dvo(&connector->base); |
|
- | 118 | u32 tmp; |
|
- | 119 | ||
- | 120 | tmp = I915_READ(intel_dvo->dev.dvo_reg); |
|
- | 121 | ||
- | 122 | if (!(tmp & DVO_ENABLE)) |
|
Line 115... | Line 123... | ||
115 | struct intel_dvo *intel_dvo = intel_attached_dvo(&connector->base); |
123 | return false; |
116 | 124 | ||
Line 117... | Line 125... | ||
117 | return intel_dvo->dev.dev_ops->get_hw_state(&intel_dvo->dev); |
125 | return intel_dvo->dev.dev_ops->get_hw_state(&intel_dvo->dev); |
Line 283... | Line 291... | ||
283 | } |
291 | } |
Line 284... | Line 292... | ||
284 | 292 | ||
285 | return true; |
293 | return true; |
Line 286... | Line 294... | ||
286 | } |
294 | } |
287 | 295 | ||
288 | static void intel_dvo_mode_set(struct intel_encoder *encoder) |
296 | static void intel_dvo_pre_enable(struct intel_encoder *encoder) |
289 | { |
297 | { |
290 | struct drm_device *dev = encoder->base.dev; |
298 | struct drm_device *dev = encoder->base.dev; |
291 | struct drm_i915_private *dev_priv = dev->dev_private; |
299 | struct drm_i915_private *dev_priv = dev->dev_private; |
Line 341... | Line 349... | ||
341 | static enum drm_connector_status |
349 | static enum drm_connector_status |
342 | intel_dvo_detect(struct drm_connector *connector, bool force) |
350 | intel_dvo_detect(struct drm_connector *connector, bool force) |
343 | { |
351 | { |
344 | struct intel_dvo *intel_dvo = intel_attached_dvo(connector); |
352 | struct intel_dvo *intel_dvo = intel_attached_dvo(connector); |
345 | DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", |
353 | DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", |
346 | connector->base.id, drm_get_connector_name(connector)); |
354 | connector->base.id, connector->name); |
347 | return intel_dvo->dev.dev_ops->detect(&intel_dvo->dev); |
355 | return intel_dvo->dev.dev_ops->detect(&intel_dvo->dev); |
348 | } |
356 | } |
Line 349... | Line 357... | ||
349 | 357 | ||
350 | static int intel_dvo_get_modes(struct drm_connector *connector) |
358 | static int intel_dvo_get_modes(struct drm_connector *connector) |
Line 473... | Line 481... | ||
473 | intel_encoder->disable = intel_disable_dvo; |
481 | intel_encoder->disable = intel_disable_dvo; |
474 | intel_encoder->enable = intel_enable_dvo; |
482 | intel_encoder->enable = intel_enable_dvo; |
475 | intel_encoder->get_hw_state = intel_dvo_get_hw_state; |
483 | intel_encoder->get_hw_state = intel_dvo_get_hw_state; |
476 | intel_encoder->get_config = intel_dvo_get_config; |
484 | intel_encoder->get_config = intel_dvo_get_config; |
477 | intel_encoder->compute_config = intel_dvo_compute_config; |
485 | intel_encoder->compute_config = intel_dvo_compute_config; |
478 | intel_encoder->mode_set = intel_dvo_mode_set; |
486 | intel_encoder->pre_enable = intel_dvo_pre_enable; |
479 | intel_connector->get_hw_state = intel_dvo_connector_get_hw_state; |
487 | intel_connector->get_hw_state = intel_dvo_connector_get_hw_state; |
- | 488 | intel_connector->unregister = intel_connector_unregister; |
|
Line 480... | Line 489... | ||
480 | 489 | ||
481 | /* Now, try to find a controller */ |
490 | /* Now, try to find a controller */ |
482 | for (i = 0; i < ARRAY_SIZE(intel_dvo_devices); i++) { |
491 | for (i = 0; i < ARRAY_SIZE(intel_dvo_devices); i++) { |
483 | struct drm_connector *connector = &intel_connector->base; |
492 | struct drm_connector *connector = &intel_connector->base; |
Line 519... | Line 528... | ||
519 | 528 | ||
520 | intel_encoder->type = INTEL_OUTPUT_DVO; |
529 | intel_encoder->type = INTEL_OUTPUT_DVO; |
521 | intel_encoder->crtc_mask = (1 << 0) | (1 << 1); |
530 | intel_encoder->crtc_mask = (1 << 0) | (1 << 1); |
522 | switch (dvo->type) { |
531 | switch (dvo->type) { |
523 | case INTEL_DVO_CHIP_TMDS: |
532 | case INTEL_DVO_CHIP_TMDS: |
- | 533 | intel_encoder->cloneable = (1 << INTEL_OUTPUT_ANALOG) | |
|
524 | intel_encoder->cloneable = true; |
534 | (1 << INTEL_OUTPUT_DVO); |
525 | drm_connector_init(dev, connector, |
535 | drm_connector_init(dev, connector, |
526 | &intel_dvo_connector_funcs, |
536 | &intel_dvo_connector_funcs, |
527 | DRM_MODE_CONNECTOR_DVII); |
537 | DRM_MODE_CONNECTOR_DVII); |
528 | encoder_type = DRM_MODE_ENCODER_TMDS; |
538 | encoder_type = DRM_MODE_ENCODER_TMDS; |
529 | break; |
539 | break; |
530 | case INTEL_DVO_CHIP_LVDS: |
540 | case INTEL_DVO_CHIP_LVDS: |
531 | intel_encoder->cloneable = false; |
541 | intel_encoder->cloneable = 0; |
532 | drm_connector_init(dev, connector, |
542 | drm_connector_init(dev, connector, |
533 | &intel_dvo_connector_funcs, |
543 | &intel_dvo_connector_funcs, |
534 | DRM_MODE_CONNECTOR_LVDS); |
544 | DRM_MODE_CONNECTOR_LVDS); |
535 | encoder_type = DRM_MODE_ENCODER_LVDS; |
545 | encoder_type = DRM_MODE_ENCODER_LVDS; |
Line 554... | Line 564... | ||
554 | intel_dvo->panel_fixed_mode = |
564 | intel_dvo->panel_fixed_mode = |
555 | intel_dvo_get_current_mode(connector); |
565 | intel_dvo_get_current_mode(connector); |
556 | intel_dvo->panel_wants_dither = true; |
566 | intel_dvo->panel_wants_dither = true; |
557 | } |
567 | } |
Line 558... | Line 568... | ||
558 | 568 | ||
559 | drm_sysfs_connector_add(connector); |
569 | drm_connector_register(connector); |
560 | return; |
570 | return; |
Line 561... | Line 571... | ||
561 | } |
571 | } |
562 | 572 |