diff options
author | Imran Zaman <imran.zaman@intel.com> | 2015-01-08 18:29:13 +0200 |
---|---|---|
committer | Imran Zaman <imran.zaman@intel.com> | 2015-01-08 18:51:08 +0200 |
commit | 3b2b540a6c211b599d7cf9ace0026572d9fc3ec9 (patch) | |
tree | 6b517b623888f44ba7401584c635adddc9369460 | |
parent | a4afcb7560d0d46340d612f687d1ed5a45723055 (diff) | |
download | weston-3b2b540a6c211b599d7cf9ace0026572d9fc3ec9.tar.gz weston-3b2b540a6c211b599d7cf9ace0026572d9fc3ec9.tar.bz2 weston-3b2b540a6c211b599d7cf9ace0026572d9fc3ec9.zip |
Fixed weston transfromation problemtizen_3.0_ivi_releasesubmit/tizen_ivi/20150109.654321submit/tizen_common/20150109.141219accepted/tizen/ivi/20150112.124309accepted/tizen/common/20150109.143416tizen_3.0_ivitizen_3.0.2015.q1_commontizen_3.0.2014.q4_commonaccepted/tizen_3.0_ivi
Transformations are applied by system compositor on the
surface created by the child compositor
Change-Id: I3067d0f17085d5049f4684db0ef7483bbd4eb4d3
Fixed Bug TC-2320
Signed-off-by: Imran Zaman <imran.zaman@intel.com>
-rw-r--r-- | configure.ac | 9 | ||||
-rw-r--r-- | packaging/weston.spec | 2 | ||||
-rw-r--r-- | src/compositor-drm.c | 23 | ||||
-rw-r--r-- | src/compositor-wayland.c | 31 |
4 files changed, 53 insertions, 12 deletions
diff --git a/configure.ac b/configure.ac index 1cb1dcd9..cae500a3 100644 --- a/configure.ac +++ b/configure.ac @@ -103,6 +103,15 @@ if test "x$enable_default_vkb" = "xyes"; then AC_DEFINE(HAVE_DEFAULT_VKB, [1], [Enable default virtual keyboard]) fi +AC_ARG_ENABLE([transform], + [AC_HELP_STRING([--enable-transform], + [Enable transformation for nested westons])], + [], + [enable_transform=no]) +if test "x$enable_transform" = "xyes"; then + AC_DEFINE(HAVE_TRANSFORM, [1], [Enable transformation for nested westons]) +fi + AC_ARG_ENABLE(sys-uid, [ --enable-sys-uid],, enable_sys_uid=no) if test x$enable_sys_uid = xyes; then diff --git a/packaging/weston.spec b/packaging/weston.spec index abacbd2d..9f15d7e5 100644 --- a/packaging/weston.spec +++ b/packaging/weston.spec @@ -16,7 +16,7 @@ %endif %if "%{profile}" == "ivi" -%define extra_config_options4 --disable-default-vkb +%define extra_config_options4 --disable-default-vkb --enable-transform %endif Name: weston diff --git a/src/compositor-drm.c b/src/compositor-drm.c index 4c0e2d61..8b84aad6 100644 --- a/src/compositor-drm.c +++ b/src/compositor-drm.c @@ -1178,6 +1178,7 @@ static struct drm_mode * choose_mode (struct drm_output *output, struct weston_mode *target_mode) { struct drm_mode *tmp_mode = NULL, *mode; + int32_t w, h; if (output->base.current_mode->width == target_mode->width && output->base.current_mode->height == target_mode->height && @@ -1186,13 +1187,29 @@ choose_mode (struct drm_output *output, struct weston_mode *target_mode) return (struct drm_mode *)output->base.current_mode; wl_list_for_each(mode, &output->base.mode_list, base.link) { - if (mode->mode_info.hdisplay == target_mode->width && - mode->mode_info.vdisplay == target_mode->height) { + switch (output->base.transform) { + case WL_OUTPUT_TRANSFORM_90: + case WL_OUTPUT_TRANSFORM_270: + case WL_OUTPUT_TRANSFORM_FLIPPED_90: + case WL_OUTPUT_TRANSFORM_FLIPPED_270: +#if HAVE_TRANSFORM + w = mode->mode_info.vdisplay; + h = mode->mode_info.hdisplay; + break; +#endif + default: + w = mode->mode_info.hdisplay; + h = mode->mode_info.vdisplay; + break; + } + if (w == target_mode->width && + h == target_mode->height) { if (mode->mode_info.vrefresh == target_mode->refresh || target_mode->refresh == 0) { return mode; - } else if (!tmp_mode) + } else if (!tmp_mode) { tmp_mode = mode; + } } } diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c index bf1ecccb..6c72426a 100644 --- a/src/compositor-wayland.c +++ b/src/compositor-wayland.c @@ -1181,9 +1181,8 @@ wayland_output_create_for_parent_output(struct wayland_compositor *c, x = 0; } - output = wayland_output_create(c, x, 0, mode->width, mode->height, - NULL, 0, - WL_OUTPUT_TRANSFORM_NORMAL, 1); + output = wayland_output_create(c, x, 0, mode->width, mode->height, NULL, + 0, WL_OUTPUT_TRANSFORM_NORMAL, 1); if (!output) return NULL; @@ -1828,7 +1827,8 @@ wayland_parent_output_geometry(void *data, struct wl_output *output_proxy, } static struct weston_mode * -find_mode(struct wl_list *list, int32_t width, int32_t height, uint32_t refresh) +find_mode(struct wl_list *list, int32_t width, int32_t height, uint32_t refresh, + int32_t transform) { struct weston_mode *mode; @@ -1842,8 +1842,21 @@ find_mode(struct wl_list *list, int32_t width, int32_t height, uint32_t refresh) if (!mode) return NULL; - mode->width = width; - mode->height = height; + switch (transform) { + case WL_OUTPUT_TRANSFORM_90: + case WL_OUTPUT_TRANSFORM_270: + case WL_OUTPUT_TRANSFORM_FLIPPED_90: + case WL_OUTPUT_TRANSFORM_FLIPPED_270: +#if HAVE_TRANSFORM + mode->width = height; + mode->height = width; + break; +#endif + default: + mode->width = width; + mode->height = height; + break; + } mode->refresh = refresh; wl_list_insert(list, &mode->link); @@ -1860,13 +1873,15 @@ wayland_parent_output_mode(void *data, struct wl_output *wl_output_proxy, if (output->output) { mode = find_mode(&output->output->base.mode_list, - width, height, refresh); + width, height, refresh, output->transform); if (!mode) return; mode->flags = flags; + /* Do a mode-switch on current mode change? */ } else { - mode = find_mode(&output->mode_list, width, height, refresh); + mode = find_mode(&output->mode_list, width, height, refresh, + output->transform); if (!mode) return; mode->flags = flags; |