--- /dev/null
+commit 36d106aa5ad0254039557a6f69fbc5ba045a7971
+Author: Wang Quanxian <quanxian.wang@intel.com>
+Date: Fri Jul 6 15:53:08 2012 +0800
+
+ Add default mode for NexCom and Crossiville
+ The platform has no EDID information. The mode could not be gotten
+ from drm interfaces.
+
+ Signed-Off-By Wang Quanxian <quanxian.wang@intel.com>
+
+diff --git a/src/compositor-drm.c b/src/compositor-drm.c
+index 4dffa1d..b0a81be 100644
+--- a/src/compositor-drm.c
++++ b/src/compositor-drm.c
+@@ -143,6 +143,16 @@ struct drm_sprite {
+ uint32_t formats[];
+ };
+
++static drmModeModeInfo builtin_800x480 = {
++ 33750, /* clock */
++ 800, 864, 976, 1088, 0,
++ 480, 486, 494, 517, 0,
++ 59920,
++ DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC,
++ 0,
++ "800x480"
++};
++
+ static int
+ surface_is_primary(struct weston_compositor *ec, struct weston_surface *es)
+ {
+@@ -1294,7 +1304,7 @@ create_output_for_connector(struct drm_compositor *ec,
+ struct drm_mode *drm_mode, *next;
+ struct weston_mode *m, *preferred, *current;
+ drmModeEncoder *encoder;
+- drmModeModeInfo crtc_mode;
++ drmModeModeInfo crtc_mode = builtin_800x480;
+ drmModeCrtc *crtc;
+ int i, ret;
+
+@@ -1344,13 +1354,23 @@ create_output_for_connector(struct drm_compositor *ec,
+ drmModeFreeEncoder(encoder);
+ if (crtc == NULL)
+ goto err_free;
+- crtc_mode = crtc->mode;
++
++ /* if don't get mode from drm driver, use default 800x480 */
++ if (crtc->mode.clock != 0)
++ crtc_mode = crtc->mode;
++
+ drmModeFreeCrtc(crtc);
+
+- for (i = 0; i < connector->count_modes; i++) {
+- ret = drm_output_add_mode(output, &connector->modes[i]);
++ if (connector->count_modes == 0) {
++ ret = drm_output_add_mode(output, &builtin_800x480);
+ if (ret)
+ goto err_free;
++ }else{
++ for (i = 0; i < connector->count_modes; i++) {
++ ret = drm_output_add_mode(output, &connector->modes[i]);
++ if (ret)
++ goto err_free;
++ }
+ }
+
+ preferred = NULL;