summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Hourihane <alanh@fairlite.demon.co.uk>2007-04-18 12:07:55 +0100
committerAlan Hourihane <alanh@fairlite.demon.co.uk>2007-04-18 12:07:55 +0100
commit191594ebd5fbe3ac3615247c4e2cd50e1b099635 (patch)
treed3dd01a25c97ccaee931bac7993e96535adfbd80
parentef2bce3a16428feb89f447e528bdea00c1066b8b (diff)
When no valid EDID modes are available, we bail.
This snippet adds a standard 640x480 @ 60Hz mode when that occurs, so we can continue with a basic mode. Should we do this here though ???
-rw-r--r--linux-core/drm_crtc.c33
1 files changed, 27 insertions, 6 deletions
diff --git a/linux-core/drm_crtc.c b/linux-core/drm_crtc.c
index e8f42feb..f6c675c5 100644
--- a/linux-core/drm_crtc.c
+++ b/linux-core/drm_crtc.c
@@ -134,6 +134,15 @@ bool drm_crtc_in_use(struct drm_crtc *crtc)
}
EXPORT_SYMBOL(drm_crtc_in_use);
+/*
+ * Detailed mode info for a standard 640x480@60Hz monitor
+ */
+static struct drm_display_mode std_mode[] = {
+ { DRM_MODE("640x480", DRM_MODE_TYPE_DRIVER, 25200, 640, 656,
+ 752, 800, 0, 480, 490, 492, 525, 0,
+ V_NHSYNC | V_NVSYNC) }, /* 640x480@60Hz */
+};
+
void drm_crtc_probe_output_modes(struct drm_device *dev, int maxX, int maxY)
{
struct drm_output *output;
@@ -175,8 +184,22 @@ void drm_crtc_probe_output_modes(struct drm_device *dev, int maxX, int maxY)
drm_mode_prune_invalid(dev, &output->modes, TRUE);
if (list_empty(&output->modes)) {
+ struct drm_display_mode *newmode;
+
DRM_DEBUG("No valid modes found on %s\n", output->name);
- continue;
+
+ /* Should we do this here ???
+ * When no valid EDID modes are available we end up
+ * here and bailed in the past, now we add a standard
+ * 640x480@60Hz mode and carry on.
+ */
+ newmode = drm_mode_duplicate(dev, &std_mode[0]);
+ drm_mode_probed_add(output, newmode);
+ drm_mode_list_concat(&output->probed_modes,
+ &output->modes);
+
+ DRM_DEBUG("Adding standard 640x480 @ 60Hz to %s\n",
+ output->name);
}
drm_mode_sort(&output->modes);
@@ -310,13 +333,11 @@ bool drm_set_desired_modes(struct drm_device *dev)
}
}
/* Skip disabled crtcs */
- if (!output)
+ if (!output) {
+ DRM_DEBUG("skipping disabled crtc\n");
continue;
-
- memset(&crtc->mode, 0, sizeof(crtc->mode));
- if (!crtc->desired_mode->crtc_hdisplay) {
-
}
+
if (!drm_crtc_set_mode(crtc, crtc->desired_mode,
crtc->desired_x, crtc->desired_y))
return false;