summaryrefslogtreecommitdiff
path: root/linux-core/intel_sdvo.c
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@hobbes.virtuousgeek.org>2007-04-17 10:14:18 -0700
committerJesse Barnes <jbarnes@hobbes.virtuousgeek.org>2007-04-17 10:14:18 -0700
commit1c7f895fa6531b16e7e9fd4568d4f6a50ca5711e (patch)
treeb46163c3b5f98e18d3ad1c70c095d77fc71721e6 /linux-core/intel_sdvo.c
parent4e4d9cbeb3f52b605e46aad8ae1a947ca236079f (diff)
parentb729b919baed250313caf3f0bbd4044e084de8bf (diff)
Merge branch 'modesetting-101' of git+ssh://git.freedesktop.org/git/mesa/drm into origin/modesetting-101
Conflicts: shared-core/i915_init.c - reconcile with airlied's new code
Diffstat (limited to 'linux-core/intel_sdvo.c')
-rw-r--r--linux-core/intel_sdvo.c20
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))