All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Que <sque@chromium.org>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	Jesse Barnes <jbarnes@virtuousgeek.org>,
	Eric Anholt <eric@anholt.net>,
	intel-gfx@lists.freedesktop.org
Cc: Olof Johansson <olofj@chromium.org>,
	Mandeep Baines <msb@chromium.org>,
	Bryan Freed <bfreed@chromium.org>
Subject: [PATCH v3] CHROMIUM: i915: Added function to initialize VBT settings
Date: Tue, 28 Sep 2010 16:12:16 -0700	[thread overview]
Message-ID: <AANLkTinAzJx2uqD8hAXjiRLR0bjqh_pMb=yJ7f3Yf1A0@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3494 bytes --]

Hi all,

I have updated the patch containing the dither bit change and VBT
default settings.  This time, all default values have been moved to a
single function, init_vbt_defaults.  This function is called from
intel_init_bios before checking for VBT.  Hence, it is used in both
the VBT found and VBT not found cases.

The parse functions previously contained VBT default values for the
case where VBT was found -- those have been moved to the new function
init_vbt_defaults.  This new arrangement reduces code redundancy (no
need to set dither bit in two places) and consolidates all default
settings into one place.

Thanks,
Simon

==============================================
CHROMIUM: 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: Simon Que <sque@chromium.org>

BUG=none
TEST=Splash screen looks dithered upon boot.

Change-Id: If19c763824ee938ad107f655d8d94c65e39cfa56
---
 drivers/gpu/drm/i915/intel_bios.c |   29 +++++++++++++++++++----------
 1 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_bios.c
b/drivers/gpu/drm/i915/intel_bios.c
index 70c9d4b..ad030ff 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -119,10 +119,6 @@ parse_lfp_panel_data(struct drm_i915_private *dev_priv,
 	int i, temp_downclock;
 	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);
 	if (!lvds_options)
 		return;
@@ -220,8 +216,6 @@ parse_sdvo_panel_data(struct drm_i915_private *dev_priv,
 	struct lvds_dvo_timing *dvo_timing;
 	struct drm_display_mode *panel_fixed_mode;

-	dev_priv->sdvo_lvds_vbt_mode = NULL;
-
 	sdvo_lvds_options = find_section(bdb, BDB_SDVO_LVDS_OPTIONS);
 	if (!sdvo_lvds_options)
 		return;
@@ -250,10 +244,6 @@ parse_general_features(struct drm_i915_private *dev_priv,
 	struct drm_device *dev = dev_priv->dev;
 	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);
 	if (general) {
 		dev_priv->int_tv_support = general->int_tv_support;
@@ -501,6 +491,22 @@ parse_device_mapping(struct drm_i915_private *dev_priv,
 	}
 	return;
 }
+
+static void
+init_vbt_defaults(struct drm_i915_private *dev_priv)
+{
+	/* 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;
+}
+
 /**
  * intel_init_bios - initialize VBIOS settings & find VBT
  * @dev: DRM device
@@ -538,6 +544,9 @@ intel_init_bios(struct drm_device *dev)
 		}
 	}

+	/* Initialize to default VBT values */
+	init_vbt_defaults(dev_priv);
+
 	if (!vbt) {
 		DRM_ERROR("VBT signature missing\n");
 		pci_unmap_rom(pdev, bios);
-- 
1.7.1

[-- Attachment #2: 0001-CHROMIUM-i915-Added-function-to-initialize-VBT-setti.patch --]
[-- Type: text/x-patch, Size: 2978 bytes --]

From 8b1d178163e418aacb3677593e4e301c18603251 Mon Sep 17 00:00:00 2001
From: Simon Que <sque@google.com>
Date: Wed, 22 Sep 2010 14:24:10 -0700
Subject: [PATCH] CHROMIUM: 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: Simon Que <sque@chromium.org>

BUG=none
TEST=Splash screen looks dithered upon boot.

Change-Id: If19c763824ee938ad107f655d8d94c65e39cfa56
---
 drivers/gpu/drm/i915/intel_bios.c |   29 +++++++++++++++++++----------
 1 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index 70c9d4b..ad030ff 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -119,10 +119,6 @@ parse_lfp_panel_data(struct drm_i915_private *dev_priv,
 	int i, temp_downclock;
 	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);
 	if (!lvds_options)
 		return;
@@ -220,8 +216,6 @@ parse_sdvo_panel_data(struct drm_i915_private *dev_priv,
 	struct lvds_dvo_timing *dvo_timing;
 	struct drm_display_mode *panel_fixed_mode;
 
-	dev_priv->sdvo_lvds_vbt_mode = NULL;
-
 	sdvo_lvds_options = find_section(bdb, BDB_SDVO_LVDS_OPTIONS);
 	if (!sdvo_lvds_options)
 		return;
@@ -250,10 +244,6 @@ parse_general_features(struct drm_i915_private *dev_priv,
 	struct drm_device *dev = dev_priv->dev;
 	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);
 	if (general) {
 		dev_priv->int_tv_support = general->int_tv_support;
@@ -501,6 +491,22 @@ parse_device_mapping(struct drm_i915_private *dev_priv,
 	}
 	return;
 }
+
+static void
+init_vbt_defaults(struct drm_i915_private *dev_priv)
+{
+	/* 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;
+}
+
 /**
  * intel_init_bios - initialize VBIOS settings & find VBT
  * @dev: DRM device
@@ -538,6 +544,9 @@ intel_init_bios(struct drm_device *dev)
 		}
 	}
 
+	/* Initialize to default VBT values */
+	init_vbt_defaults(dev_priv);
+
 	if (!vbt) {
 		DRM_ERROR("VBT signature missing\n");
 		pci_unmap_rom(pdev, bios);
-- 
1.7.1


[-- Attachment #3: Type: text/plain, Size: 159 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

             reply	other threads:[~2010-09-28 23:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-28 23:12 Simon Que [this message]
2010-09-29  9:34 ` [PATCH v3] CHROMIUM: i915: Added function to initialize VBT settings Chris Wilson
2010-09-29 13:15   ` Paul Menzel
  -- strict thread matches above, loose matches on Subject: below --
2010-09-28 23:12 Simon Que

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTinAzJx2uqD8hAXjiRLR0bjqh_pMb=yJ7f3Yf1A0@mail.gmail.com' \
    --to=sque@chromium.org \
    --cc=bfreed@chromium.org \
    --cc=chris@chris-wilson.co.uk \
    --cc=eric@anholt.net \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jbarnes@virtuousgeek.org \
    --cc=msb@chromium.org \
    --cc=olofj@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.