Re: [weston, v12, 09/40] compositor-drm: Move repaint state application to flush

2017-09-28 Thread Sergi Granell
On Tue, 2017-09-26 at 18:15 +0100, Daniel Stone wrote: > Split repaint into two stages, as implied by the grouped-repaint > interface: drm_output_repaint generates the repaint state only, and > drm_repaint_flush applies it. > > This also moves DPMS into output state. Previously, the usual way to >

[PATCH weston v2] compositor-wayland: destroy the appropriate output instead of exiting when receiving an xdg_toplevel::close event

2017-09-27 Thread Sergi Granell
v2: Fix use after free spotted by Daniel Stone Signed-off-by: Sergi Granell --- libweston/compositor-wayland.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libweston/compositor-wayland.c b/libweston/compositor-wayland.c index a99d4a5c..507262e3 100644 --- a/libweston

Re: connection: add sanity check to avoid buffer overflow

2017-09-26 Thread Sergi Granell
if (count > empty) { > wl_log("Data too big for buffer (%d > %d).\n", > -count, sizeof(b->data)); > + count, empty); > errno = E2BIG; > return -1; > } Other than

[PATCH weston] compositor-wayland: destroy the appropriate output instead of exiting when receiving an xdg_toplevel::close event

2017-09-25 Thread Sergi Granell
Signed-off-by: Sergi Granell --- libweston/compositor-wayland.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libweston/compositor-wayland.c b/libweston/compositor-wayland.c index a99d4a5c..17b5dbfd 100644 --- a/libweston/compositor-wayland.c +++ b/libweston/compositor

[PATCH] compositor-wayland: use input region instead of opaque region to zxdg_shell_v6::set_window_geometry

2017-09-25 Thread Sergi Granell
The opaque region is a few pixels off due to the rounded corners of the frame decorations, and, therefore, the input region matches the window's geometry more closely. Signed-off-by: Sergi Granell --- libweston/compositor-wayland.c | 12 ++-- 1 file changed, 6 insertions(+), 6 dele

[PATCH weston] wcap: Prevent fd leak in wcap_decoder_create() fail path

2017-03-29 Thread Sergi Granell
Signed-off-by: Sergi Granell --- wcap/wcap-decode.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wcap/wcap-decode.c b/wcap/wcap-decode.c index e3b8985f..7e8c8477 100644 --- a/wcap/wcap-decode.c +++ b/wcap/wcap-decode.c @@ -131,6 +131,7 @@ wcap_decoder_create(const char *filename

[PATCH weston] compositor-drm: Add missing drmModeFreeResources in drm_device_is_kms

2017-03-28 Thread Sergi Granell
Signed-off-by: Sergi Granell --- libweston/compositor-drm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c index 4cb27b1d..3f7e97e6 100644 --- a/libweston/compositor-drm.c +++ b/libweston/compositor-drm.c @@ -3055,6 +3055,8

[PATCH weston] compositor-wayland: Call weston_compositor_exit when receiving an xdg toplevel close event

2017-03-25 Thread Sergi Granell
Signed-off-by: Sergi Granell --- libweston/compositor-wayland.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libweston/compositor-wayland.c b/libweston/compositor-wayland.c index 1900ab08..a76dd08e 100644 --- a/libweston/compositor-wayland.c +++ b/libweston/compositor-wayland.c

[PATCH weston] compositor-wayland: Call set_window_geometry when using zxdg_shell_v6

2017-03-24 Thread Sergi Granell
This way Wayland compositors will be aware of Weston's "visible bounds" (and ignore its shadows). Signed-off-by: Sergi Granell --- libweston/compositor-wayland.c | 16 1 file changed, 16 insertions(+) diff --git a/libweston/compositor-wayland.c b/libweston/compo

[PATCH weston v2 1/2] compositor-wayland: Refactor struct wayland_output::name usage

2017-03-24 Thread Sergi Granell
t::name to struct wayland_output::title and precompute it on wayland_output_create_common(), so it can be later used on xdg's set_title and frame_create. v2: Move zxdg_toplevel_v6_set_title() before the wl_surface_commit() as per Quentin Glidic's suggestion. Signed-off-by: Sergi Gra

[PATCH weston v2 2/2] compositor-wayland: Check the return value of wayland_output_create_common

2017-03-24 Thread Sergi Granell
If wayland_output_create_common returns NULL, it means that the output creation failed. Signed-off-by: Sergi Granell --- libweston/compositor-wayland.c | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/libweston/compositor-wayland.c b/libweston/compositor

[PATCH weston 2/2] compositor-wayland: Check the return value of wayland_output_create_common

2017-03-24 Thread Sergi Granell
If wayland_output_create_common returns NULL, it means that the output creation failed. Signed-off-by: Sergi Granell --- libweston/compositor-wayland.c | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/libweston/compositor-wayland.c b/libweston/compositor

[PATCH weston 1/2] compositor-wayland: Refactor struct wayland_output::name usage

2017-03-24 Thread Sergi Granell
t::name to struct wayland_output::title and precompute it on wayland_output_create_common(), so it can be later used on xdg's set_title and frame_create. Signed-off-by: Sergi Granell --- libweston/compositor-wayland.c | 67 +++--- 1 file changed, 30 in

[PATCH] Fix uninitialized msec_to_next in output_repaint_timer_arm

2017-03-18 Thread Sergi Granell
Signed-off-by: Sergi Granell --- libweston/compositor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libweston/compositor.c b/libweston/compositor.c index fb647daa..048b195c 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -2388,7 +2388,7

[PATCH] wayland-server: Remove unused members from struct wl_client

2017-02-26 Thread Sergi Granell
Those struct members are no longer used so we can remove them. Signed-off-by: Sergi Granell --- src/wayland-server.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/wayland-server.c b/src/wayland-server.c index 6a8b3e4..82a3b01 100644 --- a/src/wayland-server.c +++ b/src/wayland

Re: Student project

2017-02-20 Thread Sergi Granell
Hi, exactly, helping to get Daniel's atomic modesetting patches landed is my first priority. Maybe it would be a good idea to write some kind of Weston client demo that makes extensive use of subsurfarces in some way, in order to make Weston use and change plane configurations in atomic commits to

Student project

2017-02-17 Thread Sergi Granell
Hi everyone! My name is Sergi Granell and I am a last year student at the Facultat d'Informàtica de Barcelona in the Universitat Politècnica de Catalunya [1]. As this is my last semester there, I have to do my end of degree project. I have been interested in Wayland for a long time, and

[PATCH] server: Fix shm_create_pool size fail path fd leak

2016-02-18 Thread Sergi Granell
If the client passed a size <= 0 to shm_create_pool, it would go to err_free, which wouldn't close the fd, and thus leave it opened. We can also move the size check before the struct wl_shm_pool malloc, so in case the client passes a wrong size, it won't do an unnecessary malloc and then free. ---

[PATCH] cosmetic: add an space after if

2016-02-04 Thread Sergi Granell
--- src/wayland-shm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wayland-shm.c b/src/wayland-shm.c index 8e7adc9..a4343a4 100644 --- a/src/wayland-shm.c +++ b/src/wayland-shm.c @@ -117,7 +117,7 @@ format_is_supported(struct wl_client *client, uint32_t format)

[PATCH] cosmetic: use tabs instead of spaces

2016-02-04 Thread Sergi Granell
--- src/wayland-util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wayland-util.c b/src/wayland-util.c index 3f95877..748476a 100644 --- a/src/wayland-util.c +++ b/src/wayland-util.c @@ -123,7 +123,7 @@ wl_array_add(struct wl_array *array, size_t size) if (array

[PATCH] server: Fix possible wl_display_add_socket_fd memleak

2016-02-01 Thread Sergi Granell
If wl_event_loop_add_fd failed, the fail path didn't free the newly allocated struct wl_socket. --- src/wayland-server.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/wayland-server.c b/src/wayland-server.c index 6654cd7..3ba8a5d 100644 --- a/src/wayland-server.c