[Intel-gfx] [PATCH 32/43] drm/i915: read current LVDS config at boot
Chris Wilson
chris at chris-wilson.co.uk
Fri May 25 14:33:11 CEST 2012
From: Jesse Barnes <jbarnes at virtuousgeek.org>
To better optimize mode sets that occur at boot time.
Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>
---
drivers/gpu/drm/i915/intel_lvds.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index 9dee823..0248391 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -886,6 +886,21 @@ static bool intel_lvds_supported(struct drm_device *dev)
return IS_MOBILE(dev) && !IS_I830(dev);
}
+static int intel_lvds_get_pipe(struct intel_lvds *intel_lvds)
+{
+ struct intel_encoder *intel_encoder = &intel_lvds->base;
+ struct drm_device *dev = intel_encoder->base.dev;
+ struct drm_i915_private *dev_priv = dev->dev_private;
+ int reg;
+
+ if (HAS_PCH_SPLIT(dev))
+ reg = PCH_LVDS;
+ else
+ reg = LVDS;
+
+ return (I915_READ(reg) & LVDS_PIPEB_SELECT) >> 30;
+}
+
/**
* intel_lvds_init - setup LVDS connectors on this device
* @dev: drm device
@@ -967,6 +982,8 @@ bool intel_lvds_init(struct drm_device *dev)
connector->display_info.subpixel_order = SubPixelHorizontalRGB;
connector->interlace_allowed = false;
connector->doublescan_allowed = false;
+ connector->encoder = &intel_encoder->base;
+ intel_encoder->base.crtc = dev_priv->pipe_to_crtc_mapping[intel_lvds_get_pipe(intel_lvds)];
/* create the scaling mode property */
drm_mode_create_scaling_mode_property(dev);
@@ -1109,6 +1126,8 @@ out:
intel_panel_setup_backlight(dev);
+ connector->status = intel_lvds_detect(connector, 0);
+
return true;
failed:
--
1.7.10
More information about the Intel-gfx
mailing list