diff options
author | Alan Hourihane <alanh@fairlite.demon.co.uk> | 2007-04-17 16:11:00 +0100 |
---|---|---|
committer | Alan Hourihane <alanh@fairlite.demon.co.uk> | 2007-04-17 16:11:00 +0100 |
commit | b729b919baed250313caf3f0bbd4044e084de8bf (patch) | |
tree | 5383daa96cde879ae7a915e6afe0f45f25119908 /linux-core | |
parent | ecd9801c3cf08082b4aaa7e23f1f94a5e1d47a75 (diff) |
Fix a register read that was swapped SDVOB/SDVOC
Check for the PENDING message when reading the attached
displays. Ensures the command has completed before continuing.
(probably need to check PENDING in other SDVO calls too)
Diffstat (limited to 'linux-core')
-rw-r--r-- | linux-core/intel_sdvo.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/linux-core/intel_sdvo.c b/linux-core/intel_sdvo.c index 1b45afdb..6f592f8a 100644 --- a/linux-core/intel_sdvo.c +++ b/linux-core/intel_sdvo.c @@ -29,6 +29,7 @@ */ #include <linux/i2c.h> +#include <linux/delay.h> #include "drmP.h" #include "drm.h" #include "drm_crtc.h" @@ -69,9 +70,9 @@ static void intel_sdvo_write_sdvox(struct drm_output *output, u32 val) int i; if (sdvo_priv->output_device == SDVOB) - cval = I915_READ(SDVOC); - else bval = I915_READ(SDVOB); + else + cval = I915_READ(SDVOC); /* * Write the registers twice for luck. Sometimes, @@ -869,12 +870,21 @@ static enum drm_output_status intel_sdvo_detect(struct drm_output *output) { u8 response[2]; u8 status; + u8 retry = 50; intel_sdvo_write_cmd(output, SDVO_CMD_GET_ATTACHED_DISPLAYS, NULL, 0); - status = intel_sdvo_read_response(output, &response, 2); - if (status != SDVO_CMD_STATUS_SUCCESS) - return output_status_unknown; + while (retry--) { + status = intel_sdvo_read_response(output, &response, 2); + + if (status == SDVO_CMD_STATUS_SUCCESS) + break; + + if (status != SDVO_CMD_STATUS_PENDING) + return output_status_unknown; + + mdelay(50); + } DRM_DEBUG("SDVO response %d %d\n", response[0], response[1]); if ((response[0] != 0) || (response[1] != 0)) |