Re: Developing a core shell protocol

2013-02-13 Thread Pekka Paalanen
On Tue, 12 Feb 2013 17:45:12 -0800
Nick Kisialiou kisial...@gmail.com wrote:

 Actually, there is a value in clients that need 2 shells at the same time.
 Think about an SDK or a development environment for a phone OS. The
 development environment would work in a desktop shell because it is more
 convenient for developers to write code in an IDE on a desktop/laptop. At
 the same time, it would dispatch the phone app to the phone shell for
 execution or debugging. There are other examples as well, e.g. running
 regression tests of the phone OS on a desktop/server, debugging phone
 hardware or networking bugs, etc. There is probably not much value for the
 end users, but for developers and for quality of the apps/OS there is a lot
 of benefit.

Hi Nick,

I don't think that is a good idea. I bet the SDK would not want to be
at the mercy of whatever compositor the user is running for his desktop
session. The SDK emulator probably wants to provide the phone
compositor, so it can guarantee its features and behaviour. I also
believe the emulated compositor coming with the SDK would include
debugging features which would not be present in a desktop session
compositor, tailored for the specific target OS.

Also, note that we were talking about a single client using two shells
at the same time. You will probably run your IDE and the phone app in
separate processes, so they cannot be the same client, no?

As for regression tests, hardware and networking debugging etc. you
mention, I really do not understand how they are relevant here. Don't
you run those on the phone or a VM?

The purpose of having a phone shell interface available on desktop
compositor would be just for being able to run phone apps. I don't see
it as useful for developing phone apps for a phone, only for phone apps
for the desktop. The phone shell interface on a desktop compositor
would not pop up a phone emulator but try to integrate the phone app
with the desktop environment the best it can, i.e. turn the phone app
into a desktop app, in my opinion.


Thanks,
pq
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston 2/2] compositor-drm: Fix inconsistency in finish frame timestamps

2013-02-13 Thread Ander Conselvan de Oliveira
The page flip event timestamps comes from the monotonic clock, while
idle_repaint() gets the time with gettimeofday(). That leads to
inconsistent timestamps on the frame callbacks.

Fix this by making the drm backend page flip to the current buffer and
call weston_output_finish_frame() with the page flip event timestamp,
instead of using gettimeofday().
---
 src/compositor-drm.c |   34 ++
 src/compositor.c |6 +-
 src/compositor.h |1 +
 3 files changed, 36 insertions(+), 5 deletions(-)

diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index f1f7343..e3ac572 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -629,6 +629,26 @@ drm_output_repaint(struct weston_output *output_base,
 }
 
 static void
+drm_output_start_repaint_loop(struct weston_output *output_base)
+{
+   struct drm_output *output = (struct drm_output *) output_base;
+   struct drm_compositor *compositor = (struct drm_compositor *)
+   output_base-compositor;
+   uint32_t fb_id;
+
+   if (output-current)
+   fb_id = output-current-fb_id;
+   else
+   fb_id = output-original_crtc-buffer_id;
+
+   if (drmModePageFlip(compositor-drm.fd, output-crtc_id, fb_id,
+   DRM_MODE_PAGE_FLIP_EVENT, output)  0) {
+   weston_log(queueing pageflip failed: %m\n);
+   return;
+   }
+}
+
+static void
 vblank_handler(int fd, unsigned int frame, unsigned int sec, unsigned int usec,
   void *data)
 {
@@ -655,11 +675,16 @@ page_flip_handler(int fd, unsigned int frame,
struct drm_output *output = (struct drm_output *) data;
uint32_t msecs;
 
-   output-page_flip_pending = 0;
+   /* We don't set page_flip_pending on start_repaint_loop, in that case
+* we just want to page flip to the current buffer to get an accurate
+* timestamp */
+   if (output-page_flip_pending) {
+   drm_output_release_fb(output, output-current);
+   output-current = output-next;
+   output-next = NULL;
+   }
 
-   drm_output_release_fb(output, output-current);
-   output-current = output-next;
-   output-next = NULL;
+   output-page_flip_pending = 0;
 
if (!output-vblank_pending) {
msecs = sec * 1000 + usec / 1000;
@@ -1636,6 +1661,7 @@ create_output_for_connector(struct drm_compositor *ec,
wl_list_insert(ec-base.output_list.prev, output-base.link);
 
output-base.origin = output-base.current;
+   output-base.start_repaint_loop = drm_output_start_repaint_loop;
output-base.repaint = drm_output_repaint;
output-base.destroy = drm_output_destroy;
output-base.assign_planes = drm_assign_planes;
diff --git a/src/compositor.c b/src/compositor.c
index 764d622..a0faba1 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -1164,7 +1164,11 @@ idle_repaint(void *data)
 {
struct weston_output *output = data;
 
-   weston_output_finish_frame(output, weston_compositor_get_time());
+   if (output-start_repaint_loop)
+   output-start_repaint_loop(output);
+   else
+   weston_output_finish_frame(output,
+  weston_compositor_get_time());
 }
 
 WL_EXPORT void
diff --git a/src/compositor.h b/src/compositor.h
index 004f931..34f81b5 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -181,6 +181,7 @@ struct weston_output {
struct weston_mode *origin;
struct wl_list mode_list;
 
+   void (*start_repaint_loop)(struct weston_output *output);
void (*repaint)(struct weston_output *output,
pixman_region32_t *damage);
void (*destroy)(struct weston_output *output);
-- 
1.7.10.4

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston 1/2] compositor: Init fade surface color properly

2013-02-13 Thread Ander Conselvan de Oliveira
When fading in, if a repaint was triggered after a call to
weston_compositor_fade() but before the first call to fade_frame(),
the fade surface wouldn't be drawn because its alpha channel wasn't
initialized properly.
---
 src/compositor.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compositor.c b/src/compositor.c
index 994f814..764d622 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -1226,7 +1226,7 @@ weston_compositor_fade(struct weston_compositor 
*compositor, float tint)
return;
 
weston_surface_configure(surface, 0, 0, 8192, 8192);
-   weston_surface_set_color(surface, 0.0, 0.0, 0.0, 0.0);
+   weston_surface_set_color(surface, 0.0, 0.0, 0.0, 1.0 - tint);
wl_list_insert(compositor-fade_layer.surface_list,
   surface-layer_link);
weston_surface_update_transform(surface);
-- 
1.7.10.4

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston 00/12] Toytoolkit preparation for sub-surfaces

2013-02-13 Thread Pekka Paalanen
Hi Kristian,

this series prepares toytoolkit for sub-surfaces by moving
fields from struct window to a new per-wl_surface struct.
It also contains other cleanups. The purpose is just to make
implementing sub-surface support easier.

This series does not add any sub-surface featurea, does not
require any new protocol, and does not change the individual
toytoolkit clients.

As long as sub-surfaces will be a sub-class of wl_surface,
these changes should be appropriate.

To get a better understanding on how this will be used, I
have pushed v1.5 branches of my sub-surface work, which
includes this patch series, and the main use case of it:
subsurfaces demo.

http://cgit.collabora.com/git/user/pq/wayland.git/log/?h=subsurface-v1.5
http://cgit.collabora.com/git/user/pq/weston.git/log/?h=subsurface-v1.5

The v1.5 branches have no protocol changes compared to v1.
They have been rebased, compositor has some minor changes, and
the subsurfaces demo has been rewritten. I also do not consider
the additional commits in the branches fit for review.

If you build the v1.5 branch and your Cairo is built with full GL
(you have cairo-gl, and no cairo-glesv2), use --with-cairo-glesv2
in weston's ./configure arguments to disable cairo-egl completely.
Otherwise subsurfaces would link and use both libGL and libGLESv2,
and crash, so it will not even be built.

Thanks,
pq


Pekka Paalanen (12):
  window: destroy the 2nd shm buffer, if both released
  window: create new struct surface with wl_surface
  window: move toysurface and allocation to struct surface
  window: move buffer type and transform into struct surface
  window: assimilate window_get_resize_dx_dy() into the call site
  window: move 'widget' member into struct surface
  window: move input and opaque regions into struct surface
  window: add surface pointer to widget
  window: move cairo_surface into struct surface
  window: remove the transparent flag as unused
  window: let menu and tooltip redraw use widget size
  window: create Cairo surfaces on demand for redraw

 clients/window.c | 477 ---
 clients/window.h |   6 +
 2 files changed, 284 insertions(+), 199 deletions(-)

-- 
1.7.12.4

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston 01/12] window: destroy the 2nd shm buffer, if both released

2013-02-13 Thread Pekka Paalanen
Handle the case when we the compositor somehow migrates from requiring
double buffering into working on single buffering, so we release the
extra shm buffer.

Currently, I do not think this can happen in practice, but in the future
it may happen with sub-surfaces.

Signed-off-by: Pekka Paalanen ppaala...@gmail.com
---
 clients/window.c | 22 --
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/clients/window.c b/clients/window.c
index 9c21f06..08486be 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -807,6 +807,8 @@ shm_surface_leaf_release(struct shm_surface_leaf *leaf)
 
if (leaf-resize_pool)
shm_pool_destroy(leaf-resize_pool);
+
+   memset(leaf, 0, sizeof *leaf);
 }
 
 struct shm_surface {
@@ -829,17 +831,17 @@ to_shm_surface(struct toysurface *base)
 static void
 shm_surface_buffer_release(void *data, struct wl_buffer *buffer)
 {
-   struct shm_surface_leaf *leaf = data;
+   struct shm_surface *surface = data;
 
-   leaf-busy = 0;
+   if (surface-leaf[0].data-buffer == buffer)
+   surface-leaf[0].busy = 0;
+   else if (surface-leaf[1].data-buffer == buffer)
+   surface-leaf[1].busy = 0;
+   else
+   assert(0  shm_surface_buffer_release: unknown buffer);
 
-   /* If both leaves are now free, we should call
-* shm_surface_leaf_release(shm_surface::leaf[1]).
-* However, none of Weston's backends switch dynamically
-* between early buffer release and requiring double-buffering,
-* so if both leaves are free, we never used the second
-* leaf to begin with.
-*/
+   if (!surface-leaf[0].busy  !surface-leaf[1].busy)
+   shm_surface_leaf_release(surface-leaf[1]);
 }
 
 static const struct wl_buffer_listener shm_surface_buffer_listener = {
@@ -908,7 +910,7 @@ shm_surface_prepare(struct toysurface *base, int dx, int dy,
   leaf-resize_pool,
   leaf-data);
wl_buffer_add_listener(leaf-data-buffer,
-  shm_surface_buffer_listener, leaf);
+  shm_surface_buffer_listener, surface);
 
 out:
surface-current = leaf;
-- 
1.7.12.4

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston 02/12] window: create new struct surface with wl_surface

2013-02-13 Thread Pekka Paalanen
Struct window has many fields that are directly related to the
wl_surface, more than to the window as a whole. When we start composing
a window from several wl_surfaces, these fields need to be per
wl_surface, not per window.

Start separating such fields from struct window into struct surface by
moving the wl_surface.

Signed-off-by: Pekka Paalanen ppaala...@gmail.com
---
 clients/window.c | 96 ++--
 1 file changed, 66 insertions(+), 30 deletions(-)

diff --git a/clients/window.c b/clients/window.c
index 08486be..862b1e6 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -1,6 +1,6 @@
 /*
  * Copyright © 2008 Kristian Høgsberg
- * Copyright © 2012 Collabora, Ltd.
+ * Copyright © 2012-2013 Collabora, Ltd.
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -189,12 +189,16 @@ struct toysurface {
void (*destroy)(struct toysurface *base);
 };
 
+struct surface {
+   struct window *window;
+
+   struct wl_surface *surface;
+};
+
 struct window {
struct display *display;
struct window *parent;
struct wl_list window_output_list;
-   struct wl_surface *surface;
-   struct wl_shell_surface *shell_surface;
struct wl_region *input_region;
struct wl_region *opaque_region;
char *title;
@@ -227,6 +231,8 @@ struct window {
window_fullscreen_handler_t fullscreen_handler;
window_output_handler_t output_handler;
 
+   struct surface *main_surface;
+   struct wl_shell_surface *shell_surface;
struct wl_callback *frame_cb;
 
struct frame *frame;
@@ -1163,14 +1169,14 @@ window_attach_surface(struct window *window)
}
 
if (window-opaque_region) {
-   wl_surface_set_opaque_region(window-surface,
+   wl_surface_set_opaque_region(window-main_surface-surface,
 window-opaque_region);
wl_region_destroy(window-opaque_region);
window-opaque_region = NULL;
}
 
if (window-input_region) {
-   wl_surface_set_input_region(window-surface,
+   wl_surface_set_input_region(window-main_surface-surface,
window-input_region);
wl_region_destroy(window-input_region);
window-input_region = NULL;
@@ -1230,14 +1236,15 @@ window_create_surface(struct window *window)
window-display-dpy) {
window-toysurface =
egl_window_surface_create(window-display,
- window-surface, flags,
+ window-main_surface-surface,
+ flags,
  allocation);
}
 
if (!window-toysurface)
window-toysurface = shm_surface_create(window-display,
-   window-surface, flags,
-   allocation);
+   window-main_surface-surface,
+   flags, allocation);
 
if (window-resizing)
flags = SURFACE_HINT_RESIZE;
@@ -1263,11 +1270,19 @@ window_set_buffer_transform(struct window *window,
enum wl_output_transform transform)
 {
window-buffer_transform = transform;
-   wl_surface_set_buffer_transform(window-surface, transform);
+   wl_surface_set_buffer_transform(window-main_surface-surface,
+   transform);
 }
 
 static void frame_destroy(struct frame *frame);
 
+static void
+surface_destroy(struct surface *surface)
+{
+   wl_surface_destroy(surface-surface);
+   free(surface);
+}
+
 void
 window_destroy(struct window *window)
 {
@@ -1304,7 +1319,9 @@ window_destroy(struct window *window)
 
if (window-shell_surface)
wl_shell_surface_destroy(window-shell_surface);
-   wl_surface_destroy(window-surface);
+
+   surface_destroy(window-main_surface);
+
wl_list_remove(window-link);
 
if (window-toysurface)
@@ -1498,7 +1515,7 @@ window_get_surface(struct window *window)
 struct wl_surface *
 window_get_wl_surface(struct window *window)
 {
-   return window-surface;
+   return window-main_surface-surface;
 }
 
 struct wl_shell_surface *
@@ -2076,16 +2093,18 @@ frame_menu_func(struct window *window, int index, void 
*data)
case 1: /* move to workspace above */
display = window-display;
if (display-workspace  0)
-   
workspace_manager_move_surface(display-workspace_manager,
-  

[PATCH weston 03/12] window: move toysurface and allocation to struct surface

2013-02-13 Thread Pekka Paalanen
Fields 'allocation' and 'server_allocation' are surface specific. Fields
'saved_allocation', 'min_allocation', and 'pending_allocation' are
window specific, and will not be moved.

Field 'toysurface' is naturally surface specific, since it provides the
backing storage for the wl_surface.

Signed-off-by: Pekka Paalanen ppaala...@gmail.com
---
 clients/window.c | 108 ---
 1 file changed, 64 insertions(+), 44 deletions(-)

diff --git a/clients/window.c b/clients/window.c
index 862b1e6..a9d2fae 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -193,6 +193,10 @@ struct surface {
struct window *window;
 
struct wl_surface *surface;
+   struct toysurface *toysurface;
+
+   struct rectangle allocation;
+   struct rectangle server_allocation;
 };
 
 struct window {
@@ -202,7 +206,7 @@ struct window {
struct wl_region *input_region;
struct wl_region *opaque_region;
char *title;
-   struct rectangle allocation, saved_allocation, server_allocation;
+   struct rectangle saved_allocation;
struct rectangle min_allocation;
struct rectangle pending_allocation;
int x, y;
@@ -217,7 +221,6 @@ struct window {
 
enum window_buffer_type buffer_type;
enum wl_output_transform buffer_transform;
-   struct toysurface *toysurface;
cairo_surface_t *cairo_surface;
 
int resizing;
@@ -1143,14 +1146,17 @@ display_get_pointer_image(struct display *display, int 
pointer)
 static void
 window_get_resize_dx_dy(struct window *window, int *x, int *y)
 {
+   struct surface *surface = window-main_surface;
+
if (window-resize_edges  WINDOW_RESIZING_LEFT)
-   *x = window-server_allocation.width - window-allocation.width;
+   *x = surface-server_allocation.width -
+   surface-allocation.width;
else
*x = 0;
 
if (window-resize_edges  WINDOW_RESIZING_TOP)
-   *y = window-server_allocation.height -
-   window-allocation.height;
+   *y = surface-server_allocation.height -
+   surface-allocation.height;
else
*y = 0;
 
@@ -1158,6 +1164,13 @@ window_get_resize_dx_dy(struct window *window, int *x, 
int *y)
 }
 
 static void
+surface_attach_surface(struct surface *surface)
+{
+   surface-toysurface-swap(surface-toysurface,
+ surface-server_allocation);
+}
+
+static void
 window_attach_surface(struct window *window)
 {
struct display *display = window-display;
@@ -1182,8 +1195,7 @@ window_attach_surface(struct window *window)
window-input_region = NULL;
}
 
-   window-toysurface-swap(window-toysurface,
-window-server_allocation);
+   surface_attach_surface(window-main_surface);
 }
 
 int
@@ -1212,7 +1224,8 @@ window_get_display(struct window *window)
 static void
 window_create_surface(struct window *window)
 {
-   struct rectangle allocation = window-allocation;
+   struct surface *surface = window-main_surface;
+   struct rectangle allocation = surface-allocation;
uint32_t flags = 0;
int dx, dy;
 
@@ -1224,27 +1237,27 @@ window_create_surface(struct window *window)
case WL_OUTPUT_TRANSFORM_270:
case WL_OUTPUT_TRANSFORM_FLIPPED_90:
case WL_OUTPUT_TRANSFORM_FLIPPED_270:
-   allocation.width = window-allocation.height;
-   allocation.height = window-allocation.width;
+   allocation.width = surface-allocation.height;
+   allocation.height = surface-allocation.width;
break;
default:
break;
}
 
-   if (!window-toysurface 
+   if (!surface-toysurface 
window-buffer_type == WINDOW_BUFFER_TYPE_EGL_WINDOW 
window-display-dpy) {
-   window-toysurface =
+   surface-toysurface =
egl_window_surface_create(window-display,
- window-main_surface-surface,
+ surface-surface,
  flags,
  allocation);
}
 
-   if (!window-toysurface)
-   window-toysurface = shm_surface_create(window-display,
-   window-main_surface-surface,
-   flags, allocation);
+   if (!surface-toysurface)
+   surface-toysurface = shm_surface_create(window-display,
+surface-surface,
+flags, allocation);
 
if (window-resizing)
flags = SURFACE_HINT_RESIZE;
@@ -1253,10 +1266,10 @@ 

[PATCH weston 04/12] window: move buffer type and transform into struct surface

2013-02-13 Thread Pekka Paalanen
These are surface specifics, since buffers are surface specific.

SURFACE_HINT_RESIZE is moved together to the other SURFACE_* flags, so
that surface_create_surface() would not need two flags arguments.
struct toysurface::prepare vfunc checks for SURFACE_HINT_RESIZE, and
egl_window_surface_create() and shm_surface_create() check for the
non-HINT flags.

Signed-off-by: Pekka Paalanen ppaala...@gmail.com
---
 clients/window.c | 81 ++--
 clients/window.h |  2 ++
 2 files changed, 45 insertions(+), 38 deletions(-)

diff --git a/clients/window.c b/clients/window.c
index a9d2fae..0185dd2 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -145,10 +145,6 @@ struct window_output {
struct wl_list link;
 };
 
-enum toysurface_prepare_flags {
-   SURFACE_HINT_RESIZE = 0x01,
-};
-
 struct toysurface {
/*
 * Prepare the surface for drawing. Makes sure there is a surface
@@ -197,6 +193,9 @@ struct surface {
 
struct rectangle allocation;
struct rectangle server_allocation;
+
+   enum window_buffer_type buffer_type;
+   enum wl_output_transform buffer_transform;
 };
 
 struct window {
@@ -219,8 +218,6 @@ struct window {
int transparent;
int focus_count;
 
-   enum window_buffer_type buffer_type;
-   enum wl_output_transform buffer_transform;
cairo_surface_t *cairo_surface;
 
int resizing;
@@ -1221,18 +1218,13 @@ window_get_display(struct window *window)
return window-display;
 }
 
-static void
-window_create_surface(struct window *window)
+static cairo_surface_t *
+surface_create_surface(struct surface *surface, int dx, int dy, uint32_t flags)
 {
-   struct surface *surface = window-main_surface;
+   struct display *display = surface-window-display;
struct rectangle allocation = surface-allocation;
-   uint32_t flags = 0;
-   int dx, dy;
-
-   if (!window-transparent)
-   flags = SURFACE_OPAQUE;
 
-   switch (window-buffer_transform) {
+   switch (surface-buffer_transform) {
case WL_OUTPUT_TRANSFORM_90:
case WL_OUTPUT_TRANSFORM_270:
case WL_OUTPUT_TRANSFORM_FLIPPED_90:
@@ -1244,45 +1236,54 @@ window_create_surface(struct window *window)
break;
}
 
-   if (!surface-toysurface 
-   window-buffer_type == WINDOW_BUFFER_TYPE_EGL_WINDOW 
-   window-display-dpy) {
+   if (!surface-toysurface  display-dpy 
+   surface-buffer_type == WINDOW_BUFFER_TYPE_EGL_WINDOW) {
surface-toysurface =
-   egl_window_surface_create(window-display,
+   egl_window_surface_create(display,
  surface-surface,
  flags,
  allocation);
}
 
if (!surface-toysurface)
-   surface-toysurface = shm_surface_create(window-display,
+   surface-toysurface = shm_surface_create(display,
 surface-surface,
 flags, allocation);
 
+   return surface-toysurface-prepare(surface-toysurface, dx, dy,
+   allocation.width,
+   allocation.height,
+   flags);
+}
+
+static void
+window_create_surface(struct window *window)
+{
+   uint32_t flags = 0;
+   int dx, dy;
+
+   if (!window-transparent)
+   flags |= SURFACE_OPAQUE;
+
if (window-resizing)
-   flags = SURFACE_HINT_RESIZE;
-   else
-   flags = 0;
+   flags |= SURFACE_HINT_RESIZE;
 
window_get_resize_dx_dy(window, dx, dy);
window-cairo_surface =
-   surface-toysurface-prepare(surface-toysurface, dx, dy,
-allocation.width,
-allocation.height,
-flags);
+   surface_create_surface(window-main_surface, dx, dy, flags);
 }
 
 int
 window_get_buffer_transform(struct window *window)
 {
-   return window-buffer_transform;
+   return window-main_surface-buffer_transform;
 }
 
 void
 window_set_buffer_transform(struct window *window,
enum wl_output_transform transform)
 {
-   window-buffer_transform = transform;
+   window-main_surface-buffer_transform = transform;
wl_surface_set_buffer_transform(window-main_surface-surface,
transform);
 }
@@ -3598,6 +3599,7 @@ window_create_internal(struct display *display,
   struct window *parent, int type)
 {
struct window *window;
+   struct surface *surface;
 
window = 

[PATCH weston 05/12] window: assimilate window_get_resize_dx_dy() into the call site

2013-02-13 Thread Pekka Paalanen
Not used elsewhere, just cleanup.

Signed-off-by: Pekka Paalanen ppaala...@gmail.com
---
 clients/window.c | 39 +++
 1 file changed, 15 insertions(+), 24 deletions(-)

diff --git a/clients/window.c b/clients/window.c
index 0185dd2..854408c 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -1141,26 +1141,6 @@ display_get_pointer_image(struct display *display, int 
pointer)
 }
 
 static void
-window_get_resize_dx_dy(struct window *window, int *x, int *y)
-{
-   struct surface *surface = window-main_surface;
-
-   if (window-resize_edges  WINDOW_RESIZING_LEFT)
-   *x = surface-server_allocation.width -
-   surface-allocation.width;
-   else
-   *x = 0;
-
-   if (window-resize_edges  WINDOW_RESIZING_TOP)
-   *y = surface-server_allocation.height -
-   surface-allocation.height;
-   else
-   *y = 0;
-
-   window-resize_edges = 0;
-}
-
-static void
 surface_attach_surface(struct surface *surface)
 {
surface-toysurface-swap(surface-toysurface,
@@ -1259,8 +1239,10 @@ surface_create_surface(struct surface *surface, int dx, 
int dy, uint32_t flags)
 static void
 window_create_surface(struct window *window)
 {
+   struct surface *surface = window-main_surface;
uint32_t flags = 0;
-   int dx, dy;
+   int dx = 0;
+   int dy = 0;
 
if (!window-transparent)
flags |= SURFACE_OPAQUE;
@@ -1268,9 +1250,18 @@ window_create_surface(struct window *window)
if (window-resizing)
flags |= SURFACE_HINT_RESIZE;
 
-   window_get_resize_dx_dy(window, dx, dy);
-   window-cairo_surface =
-   surface_create_surface(window-main_surface, dx, dy, flags);
+   if (window-resize_edges  WINDOW_RESIZING_LEFT)
+   dx = surface-server_allocation.width -
+   surface-allocation.width;
+
+   if (window-resize_edges  WINDOW_RESIZING_TOP)
+   dy = surface-server_allocation.height -
+   surface-allocation.height;
+
+   window-resize_edges = 0;
+
+   window-cairo_surface = surface_create_surface(window-main_surface,
+  dx, dy, flags);
 }
 
 int
-- 
1.7.12.4

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston 07/12] window: move input and opaque regions into struct surface

2013-02-13 Thread Pekka Paalanen
They are per wl_surface state.

The frame widget is always on the main surface, since it can be created
only for the window. That is why frame_resize_handler() can simply
assume that the surface is the main_surface.

Signed-off-by: Pekka Paalanen ppaala...@gmail.com
---
 clients/window.c | 114 +++
 1 file changed, 57 insertions(+), 57 deletions(-)

diff --git a/clients/window.c b/clients/window.c
index e54a46d..ecc38b0 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -195,6 +195,9 @@ struct surface {
struct rectangle allocation;
struct rectangle server_allocation;
 
+   struct wl_region *input_region;
+   struct wl_region *opaque_region;
+
enum window_buffer_type buffer_type;
enum wl_output_transform buffer_transform;
 };
@@ -203,8 +206,6 @@ struct window {
struct display *display;
struct window *parent;
struct wl_list window_output_list;
-   struct wl_region *input_region;
-   struct wl_region *opaque_region;
char *title;
struct rectangle saved_allocation;
struct rectangle min_allocation;
@@ -1143,6 +1144,20 @@ display_get_pointer_image(struct display *display, int 
pointer)
 static void
 surface_attach_surface(struct surface *surface)
 {
+   if (surface-opaque_region) {
+   wl_surface_set_opaque_region(surface-surface,
+surface-opaque_region);
+   wl_region_destroy(surface-opaque_region);
+   surface-opaque_region = NULL;
+   }
+
+   if (surface-input_region) {
+   wl_surface_set_input_region(surface-surface,
+   surface-input_region);
+   wl_region_destroy(surface-input_region);
+   surface-input_region = NULL;
+   }
+
surface-toysurface-swap(surface-toysurface,
  surface-server_allocation);
 }
@@ -1158,20 +1173,6 @@ window_attach_surface(struct window *window)
wl_shell_surface_set_toplevel(window-shell_surface);
}
 
-   if (window-opaque_region) {
-   wl_surface_set_opaque_region(window-main_surface-surface,
-window-opaque_region);
-   wl_region_destroy(window-opaque_region);
-   window-opaque_region = NULL;
-   }
-
-   if (window-input_region) {
-   wl_surface_set_input_region(window-main_surface-surface,
-   window-input_region);
-   wl_region_destroy(window-input_region);
-   window-input_region = NULL;
-   }
-
surface_attach_surface(window-main_surface);
 }
 
@@ -1284,6 +1285,12 @@ static void frame_destroy(struct frame *frame);
 static void
 surface_destroy(struct surface *surface)
 {
+   if (surface-input_region)
+   wl_region_destroy(surface-input_region);
+
+   if (surface-opaque_region)
+   wl_region_destroy(surface-opaque_region);
+
wl_surface_destroy(surface-surface);
 
if (surface-toysurface)
@@ -1318,11 +1325,6 @@ window_destroy(struct window *window)
free (window_output);
}
 
-   if (window-input_region)
-   wl_region_destroy(window-input_region);
-   if (window-opaque_region)
-   wl_region_destroy(window-opaque_region);
-
if (window-frame)
frame_destroy(window-frame);
 
@@ -1732,6 +1734,7 @@ frame_resize_handler(struct widget *widget,
struct widget *child = frame-child;
struct rectangle allocation;
struct display *display = widget-window-display;
+   struct surface *surface = widget-window-main_surface;
struct frame_button * button;
struct theme *t = display-theme;
int x_l, x_r, y, w, h;
@@ -1797,22 +1800,21 @@ frame_resize_handler(struct widget *widget,
 
shadow_margin = widget-window-type == TYPE_MAXIMIZED ? 0 : t-margin;
 
-   widget-window-input_region =
+   surface-input_region =
wl_compositor_create_region(display-compositor);
if (widget-window-type != TYPE_FULLSCREEN) {
-   wl_region_add(widget-window-input_region,
+   wl_region_add(surface-input_region,
  shadow_margin, shadow_margin,
  width - 2 * shadow_margin,
  height - 2 * shadow_margin);
} else {
-   wl_region_add(widget-window-input_region,
- 0, 0, width, height);
+   wl_region_add(surface-input_region, 0, 0, width, height);
}
 
widget_set_allocation(widget, 0, 0, width, height);
 
if (child-opaque)
-   wl_region_add(widget-window-opaque_region,
+   wl_region_add(surface-opaque_region,
  

[PATCH weston 08/12] window: add surface pointer to widget

2013-02-13 Thread Pekka Paalanen
So that given a widget, we can access the surface specific data, like
buffers, and input and opaque regions.

Signed-off-by: Pekka Paalanen ppaala...@gmail.com
---
 clients/window.c | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/clients/window.c b/clients/window.c
index ecc38b0..9ebd1ac 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -245,6 +245,7 @@ struct window {
 
 struct widget {
struct window *window;
+   struct surface *surface;
struct tooltip *tooltip;
struct wl_list child_list;
struct wl_list link;
@@ -1369,15 +1370,16 @@ window_find_widget(struct window *window, int32_t x, 
int32_t y)
 }
 
 static struct widget *
-widget_create(struct window *window, void *data)
+widget_create(struct window *window, struct surface *surface, void *data)
 {
struct widget *widget;
 
widget = malloc(sizeof *widget);
memset(widget, 0, sizeof *widget);
widget-window = window;
+   widget-surface = surface;
widget-user_data = data;
-   widget-allocation = window-main_surface-allocation;
+   widget-allocation = surface-allocation;
wl_list_init(widget-child_list);
widget-opaque = 0;
widget-tooltip = NULL;
@@ -1392,7 +1394,7 @@ window_add_widget(struct window *window, void *data)
 {
struct widget *widget;
 
-   widget = widget_create(window, data);
+   widget = widget_create(window, window-main_surface, data);
wl_list_init(widget-link);
window-main_surface-widget = widget;
 
@@ -1404,7 +1406,7 @@ widget_add_widget(struct widget *parent, void *data)
 {
struct widget *widget;
 
-   widget = widget_create(parent-window, data);
+   widget = widget_create(parent-window, parent-surface, data);
wl_list_insert(parent-child_list.prev, widget-link);
 
return widget;
@@ -1734,7 +1736,7 @@ frame_resize_handler(struct widget *widget,
struct widget *child = frame-child;
struct rectangle allocation;
struct display *display = widget-window-display;
-   struct surface *surface = widget-window-main_surface;
+   struct surface *surface = widget-surface;
struct frame_button * button;
struct theme *t = display-theme;
int x_l, x_r, y, w, h;
-- 
1.7.12.4

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston 09/12] window: move cairo_surface into struct surface

2013-02-13 Thread Pekka Paalanen
Widgets should be rendering to a cairo_surface for a particular
wl_surface, just like buffers are per surface.

window_flush() has a change in behaviour: it will now send
wl_shell_surface.set_toplevel also without a cairo_surface to be
attached. This shouldn't change anything in practice.

Signed-off-by: Pekka Paalanen ppaala...@gmail.com
---
 clients/window.c | 70 
 1 file changed, 30 insertions(+), 40 deletions(-)

diff --git a/clients/window.c b/clients/window.c
index 9ebd1ac..17f13b9 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -200,6 +200,8 @@ struct surface {
 
enum window_buffer_type buffer_type;
enum wl_output_transform buffer_transform;
+
+   cairo_surface_t *cairo_surface;
 };
 
 struct window {
@@ -220,8 +222,6 @@ struct window {
int transparent;
int focus_count;
 
-   cairo_surface_t *cairo_surface;
-
int resizing;
int fullscreen_method;
 
@@ -1143,8 +1143,11 @@ display_get_pointer_image(struct display *display, int 
pointer)
 }
 
 static void
-surface_attach_surface(struct surface *surface)
+surface_flush(struct surface *surface)
 {
+   if (!surface-cairo_surface)
+   return;
+
if (surface-opaque_region) {
wl_surface_set_opaque_region(surface-surface,
 surface-opaque_region);
@@ -1161,20 +1164,9 @@ surface_attach_surface(struct surface *surface)
 
surface-toysurface-swap(surface-toysurface,
  surface-server_allocation);
-}
 
-static void
-window_attach_surface(struct window *window)
-{
-   struct display *display = window-display;
-
-   if (window-type == TYPE_NONE) {
-   window-type = TYPE_TOPLEVEL;
-   if (display-shell)
-   wl_shell_surface_set_toplevel(window-shell_surface);
-   }
-
-   surface_attach_surface(window-main_surface);
+   cairo_surface_destroy(surface-cairo_surface);
+   surface-cairo_surface = NULL;
 }
 
 int
@@ -1186,12 +1178,13 @@ window_has_focus(struct window *window)
 static void
 window_flush(struct window *window)
 {
-   if (!window-cairo_surface)
-   return;
+   if (window-type == TYPE_NONE) {
+   window-type = TYPE_TOPLEVEL;
+   if (window-shell_surface)
+   wl_shell_surface_set_toplevel(window-shell_surface);
+   }
 
-   window_attach_surface(window);
-   cairo_surface_destroy(window-cairo_surface);
-   window-cairo_surface = NULL;
+   surface_flush(window-main_surface);
 }
 
 struct display *
@@ -1200,7 +1193,7 @@ window_get_display(struct window *window)
return window-display;
 }
 
-static cairo_surface_t *
+static void
 surface_create_surface(struct surface *surface, int dx, int dy, uint32_t flags)
 {
struct display *display = surface-window-display;
@@ -1232,10 +1225,9 @@ surface_create_surface(struct surface *surface, int dx, 
int dy, uint32_t flags)
 surface-surface,
 flags, allocation);
 
-   return surface-toysurface-prepare(surface-toysurface, dx, dy,
-   allocation.width,
-   allocation.height,
-   flags);
+   surface-cairo_surface = surface-toysurface-prepare(
+   surface-toysurface, dx, dy,
+   allocation.width, allocation.height, flags);
 }
 
 static void
@@ -1262,8 +1254,7 @@ window_create_surface(struct window *window)
 
window-resize_edges = 0;
 
-   window-cairo_surface = surface_create_surface(window-main_surface,
-  dx, dy, flags);
+   surface_create_surface(surface, dx, dy, flags);
 }
 
 int
@@ -1528,7 +1519,7 @@ widget_schedule_redraw(struct widget *widget)
 cairo_surface_t *
 window_get_surface(struct window *window)
 {
-   return cairo_surface_reference(window-cairo_surface);
+   return cairo_surface_reference(window-main_surface-cairo_surface);
 }
 
 struct wl_surface *
@@ -1550,15 +1541,15 @@ tooltip_redraw_handler(struct widget *widget, void 
*data)
const int32_t r = 3;
struct tooltip *tooltip = data;
int32_t width, height;
-   struct window *window = widget-window;
+   struct surface *surface = widget-surface;
 
-   cr = cairo_create(window-cairo_surface);
+   cr = cairo_create(surface-cairo_surface);
cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
cairo_set_source_rgba(cr, 0.0, 0.0, 0.0, 0.0);
cairo_paint(cr);
 
-   width = window-main_surface-allocation.width;
-   height = window-main_surface-allocation.height;
+   width = surface-allocation.width;
+   height = surface-allocation.height;
rounded_rect(cr, 0, 0, 

[PATCH weston 10/12] window: remove the transparent flag as unused

2013-02-13 Thread Pekka Paalanen
This flag was always true, and never false.

Signed-off-by: Pekka Paalanen ppaala...@gmail.com
---
 clients/window.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/clients/window.c b/clients/window.c
index 17f13b9..2260b87 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -219,7 +219,6 @@ struct window {
struct task redraw_task;
int resize_needed;
int type;
-   int transparent;
int focus_count;
 
int resizing;
@@ -1238,9 +1237,6 @@ window_create_surface(struct window *window)
int dx = 0;
int dy = 0;
 
-   if (!window-transparent)
-   flags |= SURFACE_OPAQUE;
-
if (window-resizing)
flags |= SURFACE_HINT_RESIZE;
 
@@ -3612,7 +3608,6 @@ window_create_internal(struct display *display,
   surface-surface);
}
 
-   window-transparent = 1;
window-type = type;
window-fullscreen_method = WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT;
 
-- 
1.7.12.4

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston 11/12] window: let menu and tooltip redraw use widget size

2013-02-13 Thread Pekka Paalanen
Menu and tooltip redraw functions were using the surface size directly.
For consistency, make them use the widget size instead, it is the same.

Signed-off-by: Pekka Paalanen ppaala...@gmail.com
---
 clients/window.c | 14 ++
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/clients/window.c b/clients/window.c
index 2260b87..29bfdd2 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -1537,15 +1537,14 @@ tooltip_redraw_handler(struct widget *widget, void 
*data)
const int32_t r = 3;
struct tooltip *tooltip = data;
int32_t width, height;
-   struct surface *surface = widget-surface;
 
-   cr = cairo_create(surface-cairo_surface);
+   cr = cairo_create(widget-surface-cairo_surface);
cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
cairo_set_source_rgba(cr, 0.0, 0.0, 0.0, 0.0);
cairo_paint(cr);
 
-   width = surface-allocation.width;
-   height = surface-allocation.height;
+   width = widget-allocation.width;
+   height = widget-allocation.height;
rounded_rect(cr, 0, 0, width, height, r);
 
cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
@@ -3757,15 +3756,14 @@ menu_redraw_handler(struct widget *widget, void *data)
const int32_t r = 3, margin = 3;
struct menu *menu = data;
int32_t width, height, i;
-   struct surface *surface = widget-surface;
 
-   cr = cairo_create(surface-cairo_surface);
+   cr = cairo_create(widget-surface-cairo_surface);
cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
cairo_set_source_rgba(cr, 0.0, 0.0, 0.0, 0.0);
cairo_paint(cr);
 
-   width = surface-allocation.width;
-   height = surface-allocation.height;
+   width = widget-allocation.width;
+   height = widget-allocation.height;
rounded_rect(cr, 0, 0, width, height, r);
 
cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
-- 
1.7.12.4

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston 12/12] window: create Cairo surfaces on demand for redraw

2013-02-13 Thread Pekka Paalanen
This introduces the function widget_cairo_create().

Instead of directly referencing surface-cairo_surface, use the function
widget_cairo_create(), which will create the cairo_surface as necessary,
and just returns a Cairo drawing context. Also fix window_get_surface()
similarly.

Now we can go through idle_redraw() without always creating Cairo
surfaces and committing them. This will be useful with sub-surfaces,
where repainting one sub-surface does not need to force the repaint of
all surfaces of a window.

Signed-off-by: Pekka Paalanen ppaala...@gmail.com
---
 clients/window.c | 45 ++---
 clients/window.h |  4 
 2 files changed, 42 insertions(+), 7 deletions(-)

diff --git a/clients/window.c b/clients/window.c
index 29bfdd2..9abb9ae 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -1230,7 +1230,7 @@ surface_create_surface(struct surface *surface, int dx, 
int dy, uint32_t flags)
 }
 
 static void
-window_create_surface(struct window *window)
+window_create_main_surface(struct window *window)
 {
struct surface *surface = window-main_surface;
uint32_t flags = 0;
@@ -1459,6 +1459,34 @@ widget_get_user_data(struct widget *widget)
return widget-user_data;
 }
 
+static cairo_surface_t *
+widget_get_cairo_surface(struct widget *widget)
+{
+   struct surface *surface = widget-surface;
+   struct window *window = widget-window;
+
+   if (!surface-cairo_surface) {
+   if (surface == window-main_surface)
+   window_create_main_surface(window);
+   else
+   surface_create_surface(surface, 0, 0, 0);
+   }
+
+   return surface-cairo_surface;
+}
+
+cairo_t *
+widget_cairo_create(struct widget *widget)
+{
+   cairo_surface_t *cairo_surface;
+   cairo_t *cr;
+
+   cairo_surface = widget_get_cairo_surface(widget);
+   cr = cairo_create(cairo_surface);
+
+   return cr;
+}
+
 void
 widget_set_resize_handler(struct widget *widget,
  widget_resize_handler_t handler)
@@ -1515,7 +1543,11 @@ widget_schedule_redraw(struct widget *widget)
 cairo_surface_t *
 window_get_surface(struct window *window)
 {
-   return cairo_surface_reference(window-main_surface-cairo_surface);
+   cairo_surface_t *cairo_surface;
+
+   cairo_surface = widget_get_cairo_surface(window-main_surface-widget);
+
+   return cairo_surface_reference(cairo_surface);
 }
 
 struct wl_surface *
@@ -1538,7 +1570,7 @@ tooltip_redraw_handler(struct widget *widget, void *data)
struct tooltip *tooltip = data;
int32_t width, height;
 
-   cr = cairo_create(widget-surface-cairo_surface);
+   cr = widget_cairo_create(widget);
cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
cairo_set_source_rgba(cr, 0.0, 0.0, 0.0, 0.0);
cairo_paint(cr);
@@ -1950,7 +1982,7 @@ frame_button_redraw_handler(struct widget *widget, void 
*data)
if (widget-opaque)
return;
 
-   cr = cairo_create(widget-surface-cairo_surface);
+   cr = widget_cairo_create(widget);
 
if (frame_button-decoration == FRAME_BUTTON_FANCY) {
cairo_set_line_width(cr, 1);
@@ -2032,7 +2064,7 @@ frame_redraw_handler(struct widget *widget, void *data)
if (window-type == TYPE_FULLSCREEN)
return;
 
-   cr = cairo_create(widget-surface-cairo_surface);
+   cr = widget_cairo_create(widget);
 
if (window-focus_count)
flags |= THEME_FRAME_ACTIVE;
@@ -3324,7 +3356,6 @@ idle_redraw(struct task *task, uint32_t events)
if (window-resize_needed)
idle_resize(window);
 
-   window_create_surface(window);
widget_redraw(window-main_surface-widget);
window-redraw_needed = 0;
wl_list_init(window-redraw_task.link);
@@ -3757,7 +3788,7 @@ menu_redraw_handler(struct widget *widget, void *data)
struct menu *menu = data;
int32_t width, height, i;
 
-   cr = cairo_create(widget-surface-cairo_surface);
+   cr = widget_cairo_create(widget);
cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
cairo_set_source_rgba(cr, 0.0, 0.0, 0.0, 0.0);
cairo_paint(cr);
diff --git a/clients/window.h b/clients/window.h
index 792b309..646b3dd 100644
--- a/clients/window.h
+++ b/clients/window.h
@@ -382,6 +382,9 @@ widget_schedule_resize(struct widget *widget, int32_t 
width, int32_t height);
 void *
 widget_get_user_data(struct widget *widget);
 
+cairo_t *
+widget_cairo_create(struct widget *widget);
+
 void
 widget_set_redraw_handler(struct widget *widget,
  widget_redraw_handler_t handler);
@@ -409,6 +412,7 @@ widget_schedule_redraw(struct widget *widget);
 
 struct widget *
 frame_create(struct window *window, void *data);
+
 void
 frame_set_child_size(struct widget *widget, int child_width, int child_height);
 
-- 
1.7.12.4

___

Re: [PATCH weston 2/2] compositor-drm: Only add input devices after a frame is displayed

2013-02-13 Thread Ander Conselvan de Oliveira

On 02/13/2013 10:25 AM, Pekka Paalanen wrote:

On Tue, 12 Feb 2013 18:37:50 +
Rob Bradford robert.bradf...@intel.com wrote:


On 12 February 2013 15:52, Ander Conselvan de Oliveira
ander.conselvan.de.olive...@intel.com wrote:

Input device initialization takes several microseconds to complete. Two


milliseconds, I assume :-)


things causes this: compiling the XKB keymap and reading the properties
database from the udev daemon. The user can't really interact with
anything on the screen until something is displayed, so this can be
delayed.

On my system, this patch saves ~50ms from launching Weston to have the
first frame displayed.


Hey Ander, I like the idea of this :-) However can I raise the concern
that although you're going to be starting weston fast - and getting to
that first frame fast!. Won't we then miss the opportunity to do the
next 3 frames on the vblank - since we'll be be blocked doing the
device setup.


My thoughts exactly. Furthermore, since Weston usually starts with the
fade-in animation, the first frame will be 100% black. I assume the
fade-in animation starts at that point, and then we will have a big
jump when the next frame of the animation gets drawn. Is the speed-up
even visible to a user?

I like the idea, though.


That is a concern I had. It turns out that for this modification alone 
this is not noticeable. Our first frame is black anyway. I changed 
Weston to not have the fade animation and made sure the first frame was 
rendered only when the shell sets the background and I still could not 
notice anything. I can't move my right hand from the keyboard to the 
mouse that fast. ;)


But it seems that a more robust solution is needed. I hope there is more 
stuff that can be done after we are already rendering. On my ideal setup 
the shell would launch fast enough and be able to display something (a 
splash screen at least) while we finish the setup for the rest.


Cheers,
Ander


Can we be clever about this and split the device setup into some
separate blocks of idle code so that we never block for that solid
period? e.g. xkbcommon compilation (could we even cache this compiled
data?) in one idle, udev interaction in another.


Seems possible for the udev part. It seems to take 2ms for each input 
device, so we could try to split that. I'm not sure how we would make 
the event loop give some priority to the page flip events though. Just 
adding a bunch of idle task doesn't seem to cut it.




Might be hard. Especially if you wanted keymap compilation to not stall
the compositor, it would need to be threaded, I believe.


It seems it takes more than the time of a frame to compile the keymap, 
so we would either have to do it in a thread or cache it.




What I have actually seen as a user is, that the initial fade-in
animation appears to start in the middle; it's not always a fade-in
from 100% black, the desktop may just appear in an instant, perhaps due
to skipping the beginning of the fade-in animation.


The fade animation starts from the call weston_compositor_wake() just 
before we start the main loop. So it could happen that the shell sets 
the background only after the fade is already in the middle. Perhaps we 
should have something else trigger the wake.



Cheers,
Ander
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: weston freezes up my system when run it in a separate VT with a normal config file

2013-02-13 Thread Rune Kjær Svendsen
Through trial-and-error editing the config file, I've found that this is
caused by the keymap_layout=en line in weston.ini. No freeze when this is
commented out.

Because of this line weston tries to read /usr/share/X11/xkb/symbols/en
which doesn't exist, and it freezes, or at least makes me unable to switch
to a different VT or do anything besides reboot with Alt+SysRq+REISUB. If I
change the line to keymap_layout=dk there is no freeze
(/usr/share/X11/xkb/symbols/dk exists).

Med venlig hilsen,

Rune Kjær Svendsen
Østerbrogade 111, 3. - 302
2100 København Ø
Tlf.: 2835 0726


On Tue, Feb 12, 2013 at 10:06 PM, Rune Kjær Svendsen runesv...@gmail.comwrote:

 Hello

 I'm trying to use weston with a config file but failing, since it freezes
 up my system when I do this. I'm attaching the config file. The specified
 background does exist, although the icons don't. Running weston in a gnome
 terminal works fine; the background is applied correctly and it runs fine
 (although the launcher icons show X's). It's only when I run it on a
 separate VT the freeze occurs.

 The freeze happens a different times while weston is filling the display
 for the first time. If I just run weston-launcher it will freeze after the
 initializing drm backend message in the console and stay there, although
 it seems the top of the screen is also filled up somewhat it this point.
 When I run it through strace, the screen gets to black with a cursor in the
 upper left corner. I've also tried to have the interface appear and it
 freezing immediately after that. Caps lock and num lock don't have an
 effect on the LED indicators on my keyboard. Restarting weston with
 Ctrl+Alt+Backspace doesn't work, Ctrl+Alt+Del doesn't work, but
 Alt+SysRq+REISUB does restart the system.

 I have a Radeon HD 5770 GPU, and I'm using the drivers for this, and
 wayland/weston, from the xorg-edgers PPA for Ubuntu 12.10. I'm attaching
 the output of stracing the freeze.
 Hope you guys have some ideas on what could be wrong.

 Cheers,
 Rune

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston] configure.ac: Change bugs.freedesktop.org product name to Wayland

2013-02-13 Thread Scott Moreau
The product name is wayland, the component name is weston.
---
 configure.ac |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index d553eae..796bc47 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
 AC_PREREQ([2.64])
 AC_INIT([weston],
 [1.0.90],
-[https://bugs.freedesktop.org/enter_bug.cgi?product=weston],
+[https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland],
 [weston],
 [http://wayland.freedesktop.org/])
 
-- 
1.7.10.4

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston v2] configure.ac: Change bugs.freedesktop.org product to Wayland

2013-02-13 Thread Scott Moreau
Update the bug link. Thanks to Rune K. Svendsen for spotting this.
---
 configure.ac |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index d553eae..0ef2ae1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
 AC_PREREQ([2.64])
 AC_INIT([weston],
 [1.0.90],
-[https://bugs.freedesktop.org/enter_bug.cgi?product=weston],
+
[https://bugs.freedesktop.org/enter_bug.cgi?product=Waylandcomponent=weston],
 [weston],
 [http://wayland.freedesktop.org/])
 
-- 
1.7.10.4

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH] README: Fix typos

2013-02-13 Thread Siddharth Heroor

Signed-off-by: Siddharth Heroor her...@gmail.com
---
 README |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/README b/README
index 5f85888..ca26cc0 100644
--- a/README
+++ b/README
@@ -3,7 +3,7 @@ What is Wayland
 Wayland is a project to define a protocol for a compositor to talk to
 its clients as well as a library implementation of the protocol.  The
 compositor can be a standalone display server running on Linux kernel
-modesetting and evdev input devices, an X applications, or a wayland
+modesetting and evdev input devices, an X application, or a wayland
 client itself.  The clients can be traditional applications, X servers
 (rootless or fullscreen) or other display servers.
 
@@ -19,7 +19,7 @@ themselves, typically through cairo or OpenGL.
 
 The weston compositor is a reference implementation of a wayland
 compositor and the weston repository also includes a few example
-clients clients.
+clients.
 
 Building the wayland libraries is fairly simple, aside from libffi,
 they don't have many dependencies:
@@ -32,4 +32,4 @@ they don't have many dependencies:
 
 where PREFIX is where you want to install the libraries.  See
 http://wayland.freedesktop.org for more complete build instructions
-for wayland, weston, xwayland and various toolkits.
\ No newline at end of file
+for wayland, weston, xwayland and various toolkits.
-- 
1.7.0.4

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel