Lines Matching +full:lvds +full:- +full:encoder
3 * Copyright © 2006-2007 Intel Corporation
123 static struct intel_dvo *enc_to_dvo(struct intel_encoder *encoder) in enc_to_dvo() argument
125 return container_of(encoder, struct intel_dvo, base); in enc_to_dvo()
135 struct drm_device *dev = connector->base.dev; in intel_dvo_connector_get_hw_state()
140 tmp = intel_de_read(dev_priv, intel_dvo->dev.dvo_reg); in intel_dvo_connector_get_hw_state()
145 return intel_dvo->dev.dev_ops->get_hw_state(&intel_dvo->dev); in intel_dvo_connector_get_hw_state()
148 static bool intel_dvo_get_hw_state(struct intel_encoder *encoder, in intel_dvo_get_hw_state() argument
151 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in intel_dvo_get_hw_state()
152 struct intel_dvo *intel_dvo = enc_to_dvo(encoder); in intel_dvo_get_hw_state()
155 tmp = intel_de_read(dev_priv, intel_dvo->dev.dvo_reg); in intel_dvo_get_hw_state()
162 static void intel_dvo_get_config(struct intel_encoder *encoder, in intel_dvo_get_config() argument
165 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in intel_dvo_get_config()
166 struct intel_dvo *intel_dvo = enc_to_dvo(encoder); in intel_dvo_get_config()
169 pipe_config->output_types |= BIT(INTEL_OUTPUT_DVO); in intel_dvo_get_config()
171 tmp = intel_de_read(dev_priv, intel_dvo->dev.dvo_reg); in intel_dvo_get_config()
181 pipe_config->hw.adjusted_mode.flags |= flags; in intel_dvo_get_config()
183 pipe_config->hw.adjusted_mode.crtc_clock = pipe_config->port_clock; in intel_dvo_get_config()
187 struct intel_encoder *encoder, in intel_disable_dvo() argument
191 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in intel_disable_dvo()
192 struct intel_dvo *intel_dvo = enc_to_dvo(encoder); in intel_disable_dvo()
193 i915_reg_t dvo_reg = intel_dvo->dev.dvo_reg; in intel_disable_dvo()
196 intel_dvo->dev.dev_ops->dpms(&intel_dvo->dev, false); in intel_disable_dvo()
202 struct intel_encoder *encoder, in intel_enable_dvo() argument
206 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in intel_enable_dvo()
207 struct intel_dvo *intel_dvo = enc_to_dvo(encoder); in intel_enable_dvo()
208 i915_reg_t dvo_reg = intel_dvo->dev.dvo_reg; in intel_enable_dvo()
211 intel_dvo->dev.dev_ops->mode_set(&intel_dvo->dev, in intel_enable_dvo()
212 &pipe_config->hw.mode, in intel_enable_dvo()
213 &pipe_config->hw.adjusted_mode); in intel_enable_dvo()
218 intel_dvo->dev.dev_ops->dpms(&intel_dvo->dev, true); in intel_enable_dvo()
227 to_intel_connector(connector)->panel.fixed_mode; in intel_dvo_mode_valid()
228 int max_dotclk = to_i915(connector->dev)->max_dotclk_freq; in intel_dvo_mode_valid()
229 int target_clock = mode->clock; in intel_dvo_mode_valid()
231 if (mode->flags & DRM_MODE_FLAG_DBLSCAN) in intel_dvo_mode_valid()
237 if (mode->hdisplay > fixed_mode->hdisplay) in intel_dvo_mode_valid()
239 if (mode->vdisplay > fixed_mode->vdisplay) in intel_dvo_mode_valid()
242 target_clock = fixed_mode->clock; in intel_dvo_mode_valid()
248 return intel_dvo->dev.dev_ops->mode_valid(&intel_dvo->dev, mode); in intel_dvo_mode_valid()
251 static int intel_dvo_compute_config(struct intel_encoder *encoder, in intel_dvo_compute_config() argument
255 struct intel_dvo *intel_dvo = enc_to_dvo(encoder); in intel_dvo_compute_config()
257 intel_dvo->attached_connector->panel.fixed_mode; in intel_dvo_compute_config()
258 struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; in intel_dvo_compute_config()
269 if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN) in intel_dvo_compute_config()
270 return -EINVAL; in intel_dvo_compute_config()
272 pipe_config->output_format = INTEL_OUTPUT_FORMAT_RGB; in intel_dvo_compute_config()
278 struct intel_encoder *encoder, in intel_dvo_pre_enable() argument
282 struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); in intel_dvo_pre_enable()
283 struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc); in intel_dvo_pre_enable()
284 const struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; in intel_dvo_pre_enable()
285 struct intel_dvo *intel_dvo = enc_to_dvo(encoder); in intel_dvo_pre_enable()
286 enum pipe pipe = crtc->pipe; in intel_dvo_pre_enable()
288 i915_reg_t dvo_reg = intel_dvo->dev.dvo_reg; in intel_dvo_pre_enable()
289 i915_reg_t dvo_srcdim_reg = intel_dvo->dev.dvo_srcdim_reg; in intel_dvo_pre_enable()
299 if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC) in intel_dvo_pre_enable()
301 if (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC) in intel_dvo_pre_enable()
305 (adjusted_mode->crtc_hdisplay << DVO_SRCDIM_HORIZONTAL_SHIFT) | in intel_dvo_pre_enable()
306 (adjusted_mode->crtc_vdisplay << DVO_SRCDIM_VERTICAL_SHIFT));*/ in intel_dvo_pre_enable()
308 …(adjusted_mode->crtc_hdisplay << DVO_SRCDIM_HORIZONTAL_SHIFT) | (adjusted_mode->crtc_vdisplay << D… in intel_dvo_pre_enable()
316 struct drm_i915_private *i915 = to_i915(connector->dev); in intel_dvo_detect()
320 connector->base.id, connector->name); in intel_dvo_detect()
325 return intel_dvo->dev.dev_ops->detect(&intel_dvo->dev); in intel_dvo_detect()
330 struct drm_i915_private *dev_priv = to_i915(connector->dev); in intel_dvo_get_modes()
332 to_intel_connector(connector)->panel.fixed_mode; in intel_dvo_get_modes()
338 * (TV-out, for example), but for now with just TMDS and LVDS, in intel_dvo_get_modes()
349 mode = drm_mode_duplicate(connector->dev, fixed_mode); in intel_dvo_get_modes()
374 static void intel_dvo_enc_destroy(struct drm_encoder *encoder) in intel_dvo_enc_destroy() argument
376 struct intel_dvo *intel_dvo = enc_to_dvo(to_intel_encoder(encoder)); in intel_dvo_enc_destroy()
378 if (intel_dvo->dev.dev_ops->destroy) in intel_dvo_enc_destroy()
379 intel_dvo->dev.dev_ops->destroy(&intel_dvo->dev); in intel_dvo_enc_destroy()
381 intel_encoder_destroy(encoder); in intel_dvo_enc_destroy()
389 * Attempts to get a fixed panel timing for LVDS (currently only the i830).
391 * Other chips with DVO LVDS will need to extend this to deal with the LVDS
395 intel_dvo_get_current_mode(struct intel_encoder *encoder) in intel_dvo_get_current_mode() argument
399 mode = intel_encoder_current_mode(encoder); in intel_dvo_get_current_mode()
403 mode->type |= DRM_MODE_TYPE_PREFERRED; in intel_dvo_get_current_mode()
437 intel_dvo->attached_connector = intel_connector; in intel_dvo_init()
439 intel_encoder = &intel_dvo->base; in intel_dvo_init()
441 intel_encoder->disable = intel_disable_dvo; in intel_dvo_init()
442 intel_encoder->enable = intel_enable_dvo; in intel_dvo_init()
443 intel_encoder->get_hw_state = intel_dvo_get_hw_state; in intel_dvo_init()
444 intel_encoder->get_config = intel_dvo_get_config; in intel_dvo_init()
445 intel_encoder->compute_config = intel_dvo_compute_config; in intel_dvo_init()
446 intel_encoder->pre_enable = intel_dvo_pre_enable; in intel_dvo_init()
447 intel_connector->get_hw_state = intel_dvo_connector_get_hw_state; in intel_dvo_init()
451 struct drm_connector *connector = &intel_connector->base; in intel_dvo_init()
465 if (intel_gmbus_is_valid_pin(dev_priv, dvo->gpio)) in intel_dvo_init()
466 gpio = dvo->gpio; in intel_dvo_init()
467 else if (dvo->type == INTEL_DVO_CHIP_LVDS) in intel_dvo_init()
479 intel_dvo->dev = *dvo; in intel_dvo_init()
499 dvoinit = dvo->dev_ops->init(&intel_dvo->dev, i2c); in intel_dvo_init()
511 port = intel_dvo_port(dvo->dvo_reg); in intel_dvo_init()
512 drm_encoder_init(&dev_priv->drm, &intel_encoder->base, in intel_dvo_init()
516 intel_encoder->type = INTEL_OUTPUT_DVO; in intel_dvo_init()
517 intel_encoder->power_domain = POWER_DOMAIN_PORT_OTHER; in intel_dvo_init()
518 intel_encoder->port = port; in intel_dvo_init()
519 intel_encoder->pipe_mask = ~0; in intel_dvo_init()
521 if (dvo->type != INTEL_DVO_CHIP_LVDS) in intel_dvo_init()
522 intel_encoder->cloneable = (1 << INTEL_OUTPUT_ANALOG) | in intel_dvo_init()
525 switch (dvo->type) { in intel_dvo_init()
527 intel_connector->polled = DRM_CONNECTOR_POLL_CONNECT | in intel_dvo_init()
529 drm_connector_init(&dev_priv->drm, connector, in intel_dvo_init()
536 drm_connector_init(&dev_priv->drm, connector, in intel_dvo_init()
545 connector->display_info.subpixel_order = SubPixelHorizontalRGB; in intel_dvo_init()
546 connector->interlace_allowed = false; in intel_dvo_init()
547 connector->doublescan_allowed = false; in intel_dvo_init()
550 if (dvo->type == INTEL_DVO_CHIP_LVDS) { in intel_dvo_init()
552 * For our LVDS chipsets, we should hopefully be able in intel_dvo_init()
555 * data on chipsets with integrated LVDS (stored in AIM in intel_dvo_init()
559 intel_panel_init(&intel_connector->panel, in intel_dvo_init()
562 intel_dvo->panel_wants_dither = true; in intel_dvo_init()