Commit 6a04002b authored by Simon Que's avatar Simon Que Committed by Chris Wilson

i915: Added function to initialize VBT settings

Added a function that sets the LVDS values to default settings.  This
will be called by intel_init_bios before checking for the VBT (video BIOS
table). The default values are thus loaded regardless of whether a VBT
is found.

The default settings in each parse function have been moved to the new
function. This consolidates all the default settings into one place.

The default dither bit value has been changed from 0 to 1.  We can
assume that display devices will want dithering enabled.
Signed-off-by: default avatarSimon Que <sque@chromium.org>
Acked-by: default avatarOlof Johansson <olof@lixom.net>
[ickle: fixup for -next]
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent f394940b
...@@ -129,10 +129,6 @@ parse_lfp_panel_data(struct drm_i915_private *dev_priv, ...@@ -129,10 +129,6 @@ parse_lfp_panel_data(struct drm_i915_private *dev_priv,
int i, temp_downclock; int i, temp_downclock;
struct drm_display_mode *temp_mode; struct drm_display_mode *temp_mode;
/* Defaults if we can't find VBT info */
dev_priv->lvds_dither = 0;
dev_priv->lvds_vbt = 0;
lvds_options = find_section(bdb, BDB_LVDS_OPTIONS); lvds_options = find_section(bdb, BDB_LVDS_OPTIONS);
if (!lvds_options) if (!lvds_options)
return; return;
...@@ -140,6 +136,7 @@ parse_lfp_panel_data(struct drm_i915_private *dev_priv, ...@@ -140,6 +136,7 @@ parse_lfp_panel_data(struct drm_i915_private *dev_priv,
dev_priv->lvds_dither = lvds_options->pixel_dither; dev_priv->lvds_dither = lvds_options->pixel_dither;
if (lvds_options->panel_type == 0xff) if (lvds_options->panel_type == 0xff)
return; return;
panel_type = lvds_options->panel_type; panel_type = lvds_options->panel_type;
lvds_lfp_data = find_section(bdb, BDB_LVDS_LFP_DATA); lvds_lfp_data = find_section(bdb, BDB_LVDS_LFP_DATA);
...@@ -232,8 +229,6 @@ parse_sdvo_panel_data(struct drm_i915_private *dev_priv, ...@@ -232,8 +229,6 @@ parse_sdvo_panel_data(struct drm_i915_private *dev_priv,
struct lvds_dvo_timing *dvo_timing; struct lvds_dvo_timing *dvo_timing;
struct drm_display_mode *panel_fixed_mode; struct drm_display_mode *panel_fixed_mode;
dev_priv->sdvo_lvds_vbt_mode = NULL;
sdvo_lvds_options = find_section(bdb, BDB_SDVO_LVDS_OPTIONS); sdvo_lvds_options = find_section(bdb, BDB_SDVO_LVDS_OPTIONS);
if (!sdvo_lvds_options) if (!sdvo_lvds_options)
return; return;
...@@ -262,10 +257,6 @@ parse_general_features(struct drm_i915_private *dev_priv, ...@@ -262,10 +257,6 @@ parse_general_features(struct drm_i915_private *dev_priv,
struct drm_device *dev = dev_priv->dev; struct drm_device *dev = dev_priv->dev;
struct bdb_general_features *general; struct bdb_general_features *general;
/* Set sensible defaults in case we can't find the general block */
dev_priv->int_tv_support = 1;
dev_priv->int_crt_support = 1;
general = find_section(bdb, BDB_GENERAL_FEATURES); general = find_section(bdb, BDB_GENERAL_FEATURES);
if (general) { if (general) {
dev_priv->int_tv_support = general->int_tv_support; dev_priv->int_tv_support = general->int_tv_support;
...@@ -423,8 +414,6 @@ parse_edp(struct drm_i915_private *dev_priv, struct bdb_header *bdb) ...@@ -423,8 +414,6 @@ parse_edp(struct drm_i915_private *dev_priv, struct bdb_header *bdb)
{ {
struct bdb_edp *edp; struct bdb_edp *edp;
dev_priv->edp.bpp = 18;
edp = find_section(bdb, BDB_EDP); edp = find_section(bdb, BDB_EDP);
if (!edp) { if (!edp) {
if (SUPPORTS_EDP(dev_priv->dev) && dev_priv->edp.support) { if (SUPPORTS_EDP(dev_priv->dev) && dev_priv->edp.support) {
...@@ -528,6 +517,27 @@ parse_device_mapping(struct drm_i915_private *dev_priv, ...@@ -528,6 +517,27 @@ parse_device_mapping(struct drm_i915_private *dev_priv,
return; return;
} }
static void
init_vbt_defaults(struct drm_i915_private *dev_priv)
{
dev_priv->crt_ddc_pin = GMBUS_PORT_VGADDC;
/* LFP panel data */
dev_priv->lvds_dither = 1;
dev_priv->lvds_vbt = 0;
/* SDVO panel data */
dev_priv->sdvo_lvds_vbt_mode = NULL;
/* general features */
dev_priv->int_tv_support = 1;
dev_priv->int_crt_support = 1;
dev_priv->lvds_use_ssc = 0;
/* eDP data */
dev_priv->edp.bpp = 18;
}
/** /**
* intel_init_bios - initialize VBIOS settings & find VBT * intel_init_bios - initialize VBIOS settings & find VBT
* @dev: DRM device * @dev: DRM device
...@@ -545,7 +555,7 @@ intel_init_bios(struct drm_device *dev) ...@@ -545,7 +555,7 @@ intel_init_bios(struct drm_device *dev)
struct bdb_header *bdb = NULL; struct bdb_header *bdb = NULL;
u8 __iomem *bios = NULL; u8 __iomem *bios = NULL;
dev_priv->crt_ddc_pin = GMBUS_PORT_VGADDC; init_vbt_defaults(dev_priv);
/* XXX Should this validation be moved to intel_opregion.c? */ /* XXX Should this validation be moved to intel_opregion.c? */
if (dev_priv->opregion.vbt) { if (dev_priv->opregion.vbt) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment