Lines Matching +full:lvds +full:- +full:encoder

3  * Copyright © 2006-2007 Intel Corporation
119 static struct intel_dvo *enc_to_dvo(struct intel_encoder *encoder) in enc_to_dvo() argument
121 return container_of(encoder, struct intel_dvo, base); in enc_to_dvo()
131 struct drm_i915_private *i915 = to_i915(connector->base.dev); in intel_dvo_connector_get_hw_state()
132 struct intel_encoder *encoder = intel_attached_encoder(connector); in intel_dvo_connector_get_hw_state() local
133 struct intel_dvo *intel_dvo = enc_to_dvo(encoder); in intel_dvo_connector_get_hw_state()
134 enum port port = encoder->port; in intel_dvo_connector_get_hw_state()
142 return intel_dvo->dev.dev_ops->get_hw_state(&intel_dvo->dev); in intel_dvo_connector_get_hw_state()
145 static bool intel_dvo_get_hw_state(struct intel_encoder *encoder, in intel_dvo_get_hw_state() argument
148 struct drm_i915_private *i915 = to_i915(encoder->base.dev); in intel_dvo_get_hw_state()
149 enum port port = encoder->port; in intel_dvo_get_hw_state()
159 static void intel_dvo_get_config(struct intel_encoder *encoder, in intel_dvo_get_config() argument
162 struct drm_i915_private *i915 = to_i915(encoder->base.dev); in intel_dvo_get_config()
163 enum port port = encoder->port; in intel_dvo_get_config()
166 pipe_config->output_types |= BIT(INTEL_OUTPUT_DVO); in intel_dvo_get_config()
178 pipe_config->hw.adjusted_mode.flags |= flags; in intel_dvo_get_config()
180 pipe_config->hw.adjusted_mode.crtc_clock = pipe_config->port_clock; in intel_dvo_get_config()
184 struct intel_encoder *encoder, in intel_disable_dvo() argument
188 struct drm_i915_private *i915 = to_i915(encoder->base.dev); in intel_disable_dvo()
189 struct intel_dvo *intel_dvo = enc_to_dvo(encoder); in intel_disable_dvo()
190 enum port port = encoder->port; in intel_disable_dvo()
192 intel_dvo->dev.dev_ops->dpms(&intel_dvo->dev, false); in intel_disable_dvo()
199 struct intel_encoder *encoder, in intel_enable_dvo() argument
203 struct drm_i915_private *i915 = to_i915(encoder->base.dev); in intel_enable_dvo()
204 struct intel_dvo *intel_dvo = enc_to_dvo(encoder); in intel_enable_dvo()
205 enum port port = encoder->port; in intel_enable_dvo()
207 intel_dvo->dev.dev_ops->mode_set(&intel_dvo->dev, in intel_enable_dvo()
208 &pipe_config->hw.mode, in intel_enable_dvo()
209 &pipe_config->hw.adjusted_mode); in intel_enable_dvo()
214 intel_dvo->dev.dev_ops->dpms(&intel_dvo->dev, true); in intel_enable_dvo()
222 struct drm_i915_private *i915 = to_i915(connector->base.dev); in intel_dvo_mode_valid()
226 int max_dotclk = to_i915(connector->base.dev)->display.cdclk.max_dotclk_freq; in intel_dvo_mode_valid()
227 int target_clock = mode->clock; in intel_dvo_mode_valid()
243 target_clock = fixed_mode->clock; in intel_dvo_mode_valid()
249 return intel_dvo->dev.dev_ops->mode_valid(&intel_dvo->dev, mode); in intel_dvo_mode_valid()
252 static int intel_dvo_compute_config(struct intel_encoder *encoder, in intel_dvo_compute_config() argument
256 struct intel_dvo *intel_dvo = enc_to_dvo(encoder); in intel_dvo_compute_config()
257 struct intel_connector *connector = to_intel_connector(conn_state->connector); in intel_dvo_compute_config()
258 struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; in intel_dvo_compute_config()
260 intel_panel_fixed_mode(intel_dvo->attached_connector, adjusted_mode); in intel_dvo_compute_config()
276 if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN) in intel_dvo_compute_config()
277 return -EINVAL; in intel_dvo_compute_config()
279 pipe_config->sink_format = INTEL_OUTPUT_FORMAT_RGB; in intel_dvo_compute_config()
280 pipe_config->output_format = INTEL_OUTPUT_FORMAT_RGB; in intel_dvo_compute_config()
286 struct intel_encoder *encoder, in intel_dvo_pre_enable() argument
290 struct drm_i915_private *i915 = to_i915(encoder->base.dev); in intel_dvo_pre_enable()
291 struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc); in intel_dvo_pre_enable()
292 const struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; in intel_dvo_pre_enable()
293 enum port port = encoder->port; in intel_dvo_pre_enable()
294 enum pipe pipe = crtc->pipe; in intel_dvo_pre_enable()
306 if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC) in intel_dvo_pre_enable()
308 if (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC) in intel_dvo_pre_enable()
312 DVO_SRCDIM_HORIZONTAL(adjusted_mode->crtc_hdisplay) | in intel_dvo_pre_enable()
313 DVO_SRCDIM_VERTICAL(adjusted_mode->crtc_vdisplay)); in intel_dvo_pre_enable()
321 struct drm_i915_private *i915 = to_i915(connector->base.dev); in intel_dvo_detect()
324 drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s]\n", in intel_dvo_detect()
325 connector->base.base.id, connector->base.name); in intel_dvo_detect()
331 return connector->base.status; in intel_dvo_detect()
333 return intel_dvo->dev.dev_ops->detect(&intel_dvo->dev); in intel_dvo_detect()
339 struct drm_i915_private *i915 = to_i915(connector->base.dev); in intel_dvo_get_modes()
343 return drm_edid_connector_add_modes(&connector->base); in intel_dvo_get_modes()
348 * (TV-out, for example), but for now with just TMDS and LVDS, in intel_dvo_get_modes()
351 num_modes = intel_ddc_get_modes(&connector->base, connector->base.ddc); in intel_dvo_get_modes()
373 static void intel_dvo_enc_destroy(struct drm_encoder *encoder) in intel_dvo_enc_destroy() argument
375 struct intel_dvo *intel_dvo = enc_to_dvo(to_intel_encoder(encoder)); in intel_dvo_enc_destroy()
377 if (intel_dvo->dev.dev_ops->destroy) in intel_dvo_enc_destroy()
378 intel_dvo->dev.dev_ops->destroy(&intel_dvo->dev); in intel_dvo_enc_destroy()
380 intel_encoder_destroy(encoder); in intel_dvo_enc_destroy()
389 switch (dvo->type) { in intel_dvo_encoder_type()
396 MISSING_CASE(dvo->type); in intel_dvo_encoder_type()
403 switch (dvo->type) { in intel_dvo_connector_type()
410 MISSING_CASE(dvo->type); in intel_dvo_connector_type()
430 if (intel_gmbus_is_valid_pin(dev_priv, dvo->gpio)) in intel_dvo_init_dev()
431 gpio = dvo->gpio; in intel_dvo_init_dev()
432 else if (dvo->type == INTEL_DVO_CHIP_LVDS) in intel_dvo_init_dev()
444 intel_dvo->dev = *dvo; in intel_dvo_init_dev()
462 ret = dvo->dev_ops->init(&intel_dvo->dev, i2c); in intel_dvo_init_dev()
492 struct intel_encoder *encoder; in intel_dvo_init() local
505 intel_dvo->attached_connector = connector; in intel_dvo_init()
507 encoder = &intel_dvo->base; in intel_dvo_init()
509 encoder->disable = intel_disable_dvo; in intel_dvo_init()
510 encoder->enable = intel_enable_dvo; in intel_dvo_init()
511 encoder->get_hw_state = intel_dvo_get_hw_state; in intel_dvo_init()
512 encoder->get_config = intel_dvo_get_config; in intel_dvo_init()
513 encoder->compute_config = intel_dvo_compute_config; in intel_dvo_init()
514 encoder->pre_enable = intel_dvo_pre_enable; in intel_dvo_init()
515 connector->get_hw_state = intel_dvo_connector_get_hw_state; in intel_dvo_init()
523 assert_port_valid(i915, intel_dvo->dev.port); in intel_dvo_init()
525 encoder->type = INTEL_OUTPUT_DVO; in intel_dvo_init()
526 encoder->power_domain = POWER_DOMAIN_PORT_OTHER; in intel_dvo_init()
527 encoder->port = intel_dvo->dev.port; in intel_dvo_init()
528 encoder->pipe_mask = ~0; in intel_dvo_init()
530 if (intel_dvo->dev.type != INTEL_DVO_CHIP_LVDS) in intel_dvo_init()
531 encoder->cloneable = BIT(INTEL_OUTPUT_ANALOG) | in intel_dvo_init()
534 drm_encoder_init(&i915->drm, &encoder->base, in intel_dvo_init()
536 intel_dvo_encoder_type(&intel_dvo->dev), in intel_dvo_init()
537 "DVO %c", port_name(encoder->port)); in intel_dvo_init()
539 drm_dbg_kms(&i915->drm, "[ENCODER:%d:%s] detected %s\n", in intel_dvo_init()
540 encoder->base.base.id, encoder->base.name, in intel_dvo_init()
541 intel_dvo->dev.name); in intel_dvo_init()
543 if (intel_dvo->dev.type == INTEL_DVO_CHIP_TMDS) in intel_dvo_init()
544 connector->polled = DRM_CONNECTOR_POLL_CONNECT | in intel_dvo_init()
546 connector->base.polled = connector->polled; in intel_dvo_init()
548 drm_connector_init_with_ddc(&i915->drm, &connector->base, in intel_dvo_init()
550 intel_dvo_connector_type(&intel_dvo->dev), in intel_dvo_init()
553 drm_connector_helper_add(&connector->base, in intel_dvo_init()
555 connector->base.display_info.subpixel_order = SubPixelHorizontalRGB; in intel_dvo_init()
557 intel_connector_attach_encoder(connector, encoder); in intel_dvo_init()
559 if (intel_dvo->dev.type == INTEL_DVO_CHIP_LVDS) { in intel_dvo_init()
561 * For our LVDS chipsets, we should hopefully be able in intel_dvo_init()
564 * data on chipsets with integrated LVDS (stored in AIM in intel_dvo_init()
568 intel_panel_add_encoder_fixed_mode(connector, encoder); in intel_dvo_init()