Commit 29874f44 authored by Shaohua Li's avatar Shaohua Li Committed by Eric Anholt

drm/i915: fix gpio register detection logic for BIOS without VBT

if no VBT is present, crt_ddc_bus will be left at 0, and cause us
to use that for the GPIO register offset. That's never a valid register
offset, so let the "undefined" value be 0 instead of -1.
Signed-off-by: default avatarShaohua Li <shaohua.li@intel.com>
Signed-off-by: default avatarZhao Yakui <yakui.zhao@intel.com>
Signed-off-by: default avatarEric Anholt <eric@anholt.net>
[anholt: clarified the commit message a bit]
parent d271817b
...@@ -266,7 +266,7 @@ typedef struct drm_i915_private { ...@@ -266,7 +266,7 @@ typedef struct drm_i915_private {
struct notifier_block lid_notifier; struct notifier_block lid_notifier;
int crt_ddc_bus; /* -1 = unknown, else GPIO to use for CRT DDC */ int crt_ddc_bus; /* 0 = unknown, else GPIO to use for CRT DDC */
struct drm_i915_fence_reg fence_regs[16]; /* assume 965 */ struct drm_i915_fence_reg fence_regs[16]; /* assume 965 */
int fence_reg_start; /* 4 if userland hasn't ioctl'd us yet */ int fence_reg_start; /* 4 if userland hasn't ioctl'd us yet */
int num_fence_regs; /* 8 on pre-965, 16 otherwise */ int num_fence_regs; /* 8 on pre-965, 16 otherwise */
......
...@@ -283,10 +283,6 @@ parse_general_definitions(struct drm_i915_private *dev_priv, ...@@ -283,10 +283,6 @@ parse_general_definitions(struct drm_i915_private *dev_priv,
GPIOF, GPIOF,
}; };
/* Set sensible defaults in case we can't find the general block
or it is the wrong chipset */
dev_priv->crt_ddc_bus = -1;
general = find_section(bdb, BDB_GENERAL_DEFINITIONS); general = find_section(bdb, BDB_GENERAL_DEFINITIONS);
if (general) { if (general) {
u16 block_size = get_blocksize(general); u16 block_size = get_blocksize(general);
......
...@@ -526,7 +526,7 @@ void intel_crt_init(struct drm_device *dev) ...@@ -526,7 +526,7 @@ void intel_crt_init(struct drm_device *dev)
else { else {
i2c_reg = GPIOA; i2c_reg = GPIOA;
/* Use VBT information for CRT DDC if available */ /* Use VBT information for CRT DDC if available */
if (dev_priv->crt_ddc_bus != -1) if (dev_priv->crt_ddc_bus != 0)
i2c_reg = dev_priv->crt_ddc_bus; i2c_reg = dev_priv->crt_ddc_bus;
} }
intel_output->ddc_bus = intel_i2c_create(dev, i2c_reg, "CRTDDC_A"); intel_output->ddc_bus = intel_i2c_create(dev, i2c_reg, "CRTDDC_A");
......
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