[Intel-gfx] [PATCH] drm/i915: Use LVDS config in Driver feature BDB for integrated LVDS check

Zhenyu Wang zhenyu.z.wang at intel.com
Wed Feb 25 02:58:11 CET 2009


The LVDS config bits in VBT driver feature block is used by vendor
to identify the board implement of integrated LVDS/eDP or SDVO LVDS.
And video bios also uses these bits for LVDS enabling or not. So this
should be reliable for LVDS detect, and may eliminate quirks.

Signed-off-by: Zhenyu Wang <zhenyu.z.wang at intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h   |    1 +
 drivers/gpu/drm/i915/intel_bios.c |   16 ++++++++++++++++
 drivers/gpu/drm/i915/intel_bios.h |   35 +++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_lvds.c |    5 +++++
 4 files changed, 57 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 3951a12..cb468fc 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -180,6 +180,7 @@ typedef struct drm_i915_private {
 	struct drm_display_mode *vbt_mode; /* if any */
 
 	/* Feature bits from the VBIOS */
+	unsigned int int_lvds_support:1;
 	unsigned int int_tv_support:1;
 	unsigned int lvds_dither:1;
 	unsigned int lvds_vbt:1;
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index 65be30d..7008495 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -146,6 +146,21 @@ parse_general_features(struct drm_i915_private *dev_priv,
 	}
 }
 
+static void
+parse_driver_features(struct drm_i915_private *dev_priv,
+		       struct bdb_header *bdb)
+{
+	struct bdb_driver_features *driver;
+
+	/* set default for mobile chips */
+	if (IS_MOBILE(dev_priv->dev) && !IS_I830(dev_priv->dev))
+		dev_priv->int_lvds_support = 1;
+
+	driver = find_section(bdb, BDB_DRIVER_FEATURES);
+	if (driver && driver->lvds_config != BDB_DRIVER_FEATURE_INT_LVDS)
+		dev_priv->int_lvds_support = 0;
+}
+
 /**
  * intel_init_bios - initialize VBIOS settings & find VBT
  * @dev: DRM device
@@ -194,6 +209,7 @@ intel_init_bios(struct drm_device *dev)
 	/* Grab useful general definitions */
 	parse_general_features(dev_priv, bdb);
 	parse_panel_data(dev_priv, bdb);
+	parse_driver_features(dev_priv, bdb);
 
 	pci_unmap_rom(pdev, bios);
 
diff --git a/drivers/gpu/drm/i915/intel_bios.h b/drivers/gpu/drm/i915/intel_bios.h
index 5ea715a..4fdf095 100644
--- a/drivers/gpu/drm/i915/intel_bios.h
+++ b/drivers/gpu/drm/i915/intel_bios.h
@@ -279,6 +279,41 @@ struct vch_bdb_22 {
 	struct vch_panel_data panels[16];
 } __attribute__((packed));
 
+#define BDB_DRIVER_FEATURE_NO_LVDS		0
+#define BDB_DRIVER_FEATURE_INT_LVDS		1
+#define BDB_DRIVER_FEATURE_SDVO_LVDS		2
+#define BDB_DRIVER_FEATURE_EDP			3
+
+struct bdb_driver_features {
+	u8 boot_dev_algorithm:1;
+	u8 block_display_switch:1;
+	u8 allow_display_switch:1;
+	u8 hotplug_dvo:1;
+	u8 dual_view_zoom:1;
+	u8 int15h_hook:1;
+	u8 sprite_in_clone:1;
+	u8 primary_lfp_id:1;
+
+	u16 boot_mode_x;
+	u16 boot_mode_y;
+	u8 boot_mode_bpp;
+	u8 boot_mode_refresh;
+
+	u16 enable_lfp_primary:1;
+	u16 selective_mode_pruning:1;
+	u16 dual_frequency:1;
+	u16 render_clock_freq:1; /* 0: high freq; 1: low freq */
+	u16 nt_clone_support:1;
+	u16 power_scheme_ui:1; /* 0: CUI; 1: 3rd party */
+	u16 sprite_display_assign:1; /* 0: secondary; 1: primary */
+	u16 cui_aspect_scaling:1;
+	u16 preserve_aspect_ratio:1;
+	u16 sdvo_device_power_down:1;
+	u16 crt_hotplug:1;
+	u16 lvds_config:2;
+	u16 reserved:3;
+} __attribute__((packed));
+
 bool intel_init_bios(struct drm_device *dev);
 
 /*
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index 0d211af..8a1600c 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -404,6 +404,11 @@ void intel_lvds_init(struct drm_device *dev)
 	u32 lvds;
 	int pipe;
 
+	if (!dev_priv->int_lvds_support) {
+		DRM_DEBUG("Skipping LVDS from Driver feature BDB config\n");
+		return;
+	}
+
 	/* Blacklist machines that we know falsely report LVDS. */
 	/* FIXME: add a check for the Aopen Mini PC */
 
-- 
1.6.1.3




More information about the Intel-gfx mailing list