[PATCH 3/8] compositor: Update output state after mode switch
Ander Conselvan de Oliveira
conselvan2 at gmail.com
Fri Dec 14 07:37:25 PST 2012
From: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira at intel.com>
After a mode switch, the output region and transformation matrix need
to be updated. The call to weston_output_move() would do the former but
not the latter, but calling that when the output remains in the same
coordinate doesn't make much sense. Instead, update this state and the
transformation matrix in weston_output_mode_switch().
---
src/compositor-drm.c | 2 --
src/compositor.c | 20 +++++++++++++++++++-
2 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index ab1e4a9..3f2cd0c 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -1041,8 +1041,6 @@ drm_output_switch_mode(struct weston_output *output_base, struct weston_mode *mo
/*update output*/
output->base.current = &drm_mode->base;
- output->base.dirty = 1;
- weston_output_move(&output->base, output->base.x, output->base.y);
return 0;
err_gl:
diff --git a/src/compositor.c b/src/compositor.c
index f6c94b6..567105e 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -84,13 +84,31 @@ sigchld_handler(int signal_number, void *data)
return 1;
}
+static void
+weston_output_transform_init(struct weston_output *output, uint32_t transform);
+
WL_EXPORT int
weston_output_switch_mode(struct weston_output *output, struct weston_mode *mode)
{
+ int ret;
+
if (!output->switch_mode)
return -1;
- return output->switch_mode(output, mode);
+ ret = output->switch_mode(output, mode);
+ if (ret < 0)
+ return ret;
+
+ /* Update output region and transformation matrix */
+ weston_output_transform_init(output, output->transform);
+
+ pixman_region32_init(&output->previous_damage);
+ pixman_region32_init_rect(&output->region, output->x, output->y,
+ output->width, output->height);
+
+ weston_output_update_matrix(output);
+
+ return ret;
}
WL_EXPORT void
--
1.7.9.5
More information about the wayland-devel
mailing list