summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorJakob Bornecrantz <jakob@tungstengraphics.com>2007-12-18 02:09:48 +0100
committerJakob Bornecrantz <jakob@aurora.(none)>2007-12-18 02:21:08 +0100
commitbdbc34e297bd7e4cb036df6244dfb0d816eed36d (patch)
treee3dd70fe6c720e48cbb4f52a3cfb170f1d42031d /linux-core
parente239882b1e90cba0297118ec7dc432bea06b0bd0 (diff)
Fix and cleanup of Hotplug
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/drm_crtc.c2
-rw-r--r--linux-core/intel_sdvo.c17
2 files changed, 16 insertions, 3 deletions
diff --git a/linux-core/drm_crtc.c b/linux-core/drm_crtc.c
index ac2f1d42..4397b867 100644
--- a/linux-core/drm_crtc.c
+++ b/linux-core/drm_crtc.c
@@ -1142,7 +1142,7 @@ int drm_hotplug_stage_two(struct drm_device *dev, struct drm_output *output)
int has_config = 0;
if (output->crtc && output->crtc->desired_mode) {
- DRM_DEBUG("drm thinks that output already has a config\n");
+ DRM_DEBUG("drm thinks that the output already has a config\n");
has_config = 1;
}
diff --git a/linux-core/intel_sdvo.c b/linux-core/intel_sdvo.c
index d2d00e2a..1d7d0b7d 100644
--- a/linux-core/intel_sdvo.c
+++ b/linux-core/intel_sdvo.c
@@ -53,6 +53,7 @@ struct intel_sdvo_priv {
struct intel_sdvo_dtd save_input_dtd_1, save_input_dtd_2;
struct intel_sdvo_dtd save_output_dtd[16];
u32 save_SDVOX;
+ int hotplug_enabled;
};
/**
@@ -71,9 +72,14 @@ void intel_sdvo_write_sdvox(struct drm_output *output, u32 val)
if (sdvo_priv->output_device == SDVOB) {
cval = I915_READ(SDVOC);
- bval = bval | (1 << 26);
+
+ if (sdvo_priv->hotplug_enabled)
+ bval = bval | (1 << 26);
} else {
- bval = I915_READ(SDVOB) | (1 << 26);
+ bval = I915_READ(SDVOB);
+
+ if (sdvo_priv->hotplug_enabled)
+ cval = cval | (1 << 26);
}
/*
* Write the registers twice for luck. Sometimes,
@@ -927,6 +933,8 @@ int intel_sdvo_supports_hotplug(struct drm_output *output)
void intel_sdvo_set_hotplug(struct drm_output *output, int on)
{
+ struct intel_output *intel_output = output->driver_private;
+ struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv;
u8 response[2];
u8 status;
@@ -934,11 +942,15 @@ void intel_sdvo_set_hotplug(struct drm_output *output, int on)
intel_sdvo_read_response(output, &response, 2);
if (on) {
+ sdvo_priv->hotplug_enabled = 1;
+
intel_sdvo_write_cmd(output, SDVO_CMD_GET_HOT_PLUG_SUPPORT, NULL, 0);
status = intel_sdvo_read_response(output, &response, 2);
intel_sdvo_write_cmd(output, SDVO_CMD_SET_ACTIVE_HOT_PLUG, &response, 2);
} else {
+ sdvo_priv->hotplug_enabled = 0;
+
response[0] = 0;
response[1] = 0;
intel_sdvo_write_cmd(output, SDVO_CMD_SET_ACTIVE_HOT_PLUG, &response, 2);
@@ -1064,6 +1076,7 @@ void intel_sdvo_init(struct drm_device *dev, int output_device)
}
sdvo_priv->output_device = output_device;
+ sdvo_priv->hotplug_enabled = 0;
intel_output->i2c_bus = i2cbus;
intel_output->dev_priv = sdvo_priv;