summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorImran Zaman <imran.zaman@intel.com>2015-01-08 18:29:13 +0200
committerStephane Desneux <stephane.desneux@open.eurogiciel.org>2015-03-26 11:28:10 +0100
commit2c5d46ccf2c6c4a29d3d0fda2167713e6d48d4ce (patch)
treee56a4d8be94b2c4e07cd199933572846819466af
parent1e91d6fc93d59de544e39a21f0a7ebce1d592eb0 (diff)
downloadweston-2c5d46ccf2c6c4a29d3d0fda2167713e6d48d4ce.tar.gz
weston-2c5d46ccf2c6c4a29d3d0fda2167713e6d48d4ce.tar.bz2
weston-2c5d46ccf2c6c4a29d3d0fda2167713e6d48d4ce.zip
Fixed weston transfromation problemsubmit/tizen_common/20150326.000002
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.ac9
-rw-r--r--packaging/weston.spec2
-rw-r--r--src/compositor-drm.c23
-rw-r--r--src/compositor-wayland.c31
4 files changed, 53 insertions, 12 deletions
diff --git a/configure.ac b/configure.ac
index 0e0db2a5..9fdff9be 100644
--- a/configure.ac
+++ b/configure.ac
@@ -92,6 +92,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 6631c934..91b4ea56 100644
--- a/packaging/weston.spec
+++ b/packaging/weston.spec
@@ -24,7 +24,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 4a5d8c56..e9f9105d 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -1209,6 +1209,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 &&
@@ -1217,13 +1218,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 04a2331e..647479ba 100644
--- a/src/compositor-wayland.c
+++ b/src/compositor-wayland.c
@@ -1155,9 +1155,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;
@@ -1666,7 +1665,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;
@@ -1680,8 +1680,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);
@@ -1698,13 +1711,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;