Add default mode for NexCom and Crossiville
authorWang Quanxian <quanxian.wang@intel.com>
Fri, 6 Jul 2012 09:04:27 +0000 (17:04 +0800)
committerOssama Othman <ossama.othman@intel.com>
Fri, 19 Apr 2013 22:59:49 +0000 (15:59 -0700)
The platform has no EDID information. The mode could not be gotten
from emgd driver interfaces.

Signed-Off-By Wang Quanxian <quanxian.wang@intel.com>

packaging/weston-mode-nextcom.patch [new file with mode: 0644]
packaging/weston.changes
packaging/weston.spec

diff --git a/packaging/weston-mode-nextcom.patch b/packaging/weston-mode-nextcom.patch
new file mode 100644 (file)
index 0000000..f57ad34
--- /dev/null
@@ -0,0 +1,67 @@
+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;
index bd27ee6..86cccad 100644 (file)
@@ -1,3 +1,8 @@
+* Fri Jul  6 2012 Quanxian Wang <quanxian.wang@intel.com> 0.94.90@6310503
+- Add default mode for NexCom and Crossiville
+  The platform has no EDID information. The mode could not be gotten
+  from drm interfaces.
+
 * Wed Jul 04 2012 Rob Bradford <rob@linux.intel.com> 0.94.90@6310503
 - Update to latest snapshot
 
index f11fba3..8130d3b 100644 (file)
@@ -33,6 +33,11 @@ BuildRequires: pam-devel
 BuildRequires: libjpeg-devel
 Requires: xkeyboard-config
 
+#
+# Special patch for Tizen
+#
+Patch1: weston-mode-nextcom.patch
+
 %description
 Weston compositor
 
@@ -47,6 +52,11 @@ Adds a simple cursor theme to the default cursor theme
 %prep
 %setup -q -n %{name}-%{version}
 
+#
+# Apply patches
+#
+%patch1 -p1
+
 %build
 
 %autogen --disable-setuid-install