diff options
author | Jesse Barnes <jbarnes@hobbes.virtuousgeek.org> | 2007-04-12 12:40:51 -0700 |
---|---|---|
committer | Jesse Barnes <jbarnes@hobbes.virtuousgeek.org> | 2007-04-12 12:40:51 -0700 |
commit | 9e5d61d5b8c052b4dc126b155dca1f0d2e4e5ad9 (patch) | |
tree | 1d05b7239c2714e3cec28a8be77ed6c69f5baaee | |
parent | fb3c82f1d8362a0b7d64cb3bce75be8c72328e1c (diff) |
Fix 945+ hotplug detection, remove some unused variables.
-rw-r--r-- | linux-core/intel_crt.c | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/linux-core/intel_crt.c b/linux-core/intel_crt.c index ebf6e469..86eaff54 100644 --- a/linux-core/intel_crt.c +++ b/linux-core/intel_crt.c @@ -140,30 +140,25 @@ static void intel_crt_mode_set(struct drm_output *output, static bool intel_crt_detect_hotplug(struct drm_output *output) { drm_device_t *dev = output->dev; -// struct intel_output *intel_output = output->driver_private; drm_i915_private_t *dev_priv = dev->dev_private; u32 temp; -// const int timeout_ms = 1000; -// int starttime, curtime; + unsigned long timeout = jiffies + msecs_to_jiffies(1000); temp = I915_READ(PORT_HOTPLUG_EN); - I915_WRITE(PORT_HOTPLUG_EN, temp | CRT_HOTPLUG_FORCE_DETECT | (1 << 5)); -#if 0 - for (curtime = starttime = GetTimeInMillis(); - (curtime - starttime) < timeout_ms; curtime = GetTimeInMillis()) - { - if ((I915_READ(PORT_HOTPLUG_EN) & CRT_HOTPLUG_FORCE_DETECT) == 0) + I915_WRITE(PORT_HOTPLUG_EN, + temp | CRT_HOTPLUG_FORCE_DETECT | (1 << 5)); + + do { + if (!(I915_READ(PORT_HOTPLUG_EN) & CRT_HOTPLUG_FORCE_DETECT)) break; - } -#endif + } while (time_after(timeout, jiffies)); + if ((I915_READ(PORT_HOTPLUG_STAT) & CRT_HOTPLUG_MONITOR_MASK) == CRT_HOTPLUG_MONITOR_COLOR) - { return true; - } else { - return false; - } + + return false; } static bool intel_crt_detect_ddc(struct drm_output *output) @@ -180,7 +175,6 @@ static bool intel_crt_detect_ddc(struct drm_output *output) static enum drm_output_status intel_crt_detect(struct drm_output *output) { drm_device_t *dev = output->dev; - struct intel_output *intel_output = output->driver_private; if (IS_I945G(dev)| IS_I945GM(dev) || IS_I965G(dev)) { if (intel_crt_detect_hotplug(output)) @@ -206,10 +200,6 @@ static void intel_crt_destroy(struct drm_output *output) static int intel_crt_get_modes(struct drm_output *output) { - struct drm_device *dev = output->dev; - struct intel_output *intel_output = output->driver_private; - int ret; - return intel_ddc_get_modes(output); } |