[PATCH weston] configure: don't control egl version
The required version only corresponds to version of mesa implementation. This mesa version requirement causes configure errors, when weston is configured for a different egl implementation than mesa. Because the version of the egl drivers are not alligned to the mesa version. Therefore, I deleted the version controlling for egl, so that weston can be configured for a different egl implementation. Signed-off-by: Emre Ucan --- configure.ac |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index c6f7fc8..50daa62 100644 --- a/configure.ac +++ b/configure.ac @@ -85,8 +85,8 @@ AC_ARG_ENABLE(egl, [ --disable-egl],, AM_CONDITIONAL(ENABLE_EGL, test x$enable_egl = xyes) if test x$enable_egl = xyes; then AC_DEFINE([ENABLE_EGL], [1], [Build Weston with EGL support]) - PKG_CHECK_MODULES(EGL, [egl >= 7.10 glesv2]) -PKG_CHECK_MODULES([EGL_TESTS], [egl >= 7.10 glesv2 wayland-client wayland-egl]) + PKG_CHECK_MODULES(EGL, [egl glesv2]) +PKG_CHECK_MODULES([EGL_TESTS], [egl glesv2 wayland-client wayland-egl]) PKG_CHECK_MODULES([GL_RENDERER], [libdrm]) fi @@ -349,7 +349,7 @@ AC_ARG_ENABLE(simple-egl-clients, AM_CONDITIONAL(BUILD_SIMPLE_EGL_CLIENTS, test "x$enable_simple_egl_clients" = "xyes") if test x$enable_simple_egl_clients = xyes; then PKG_CHECK_MODULES(SIMPLE_EGL_CLIENT, -[egl >= 7.10 glesv2 wayland-client wayland-egl wayland-cursor]) +[egl glesv2 wayland-client wayland-egl wayland-cursor]) fi AC_ARG_ENABLE(simple-intel-dmabuf-client, @@ -377,7 +377,7 @@ if test x$enable_clients = xyes; then # Only check for cairo-egl if a GL or GLES renderer requested AS_IF([test "x$cairo_modules" = "xcairo-gl" -o "x$cairo_modules" = "xcairo-glesv2"], [ -PKG_CHECK_MODULES(CAIRO_EGL, [wayland-egl egl >= 7.10 cairo-egl >= 1.11.3 $cairo_modules], +PKG_CHECK_MODULES(CAIRO_EGL, [wayland-egl egl cairo-egl >= 1.11.3 $cairo_modules], [have_cairo_egl=yes], [have_cairo_egl=no]) AS_IF([test "x$have_cairo_egl" = "xyes"], [AC_DEFINE([HAVE_CAIRO_EGL], [1], [Have cairo-egl])], -- 1.7.9.5 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH wayland] protocol: Improve data source notification around DnD progress
Hi Mike, On Fri, Oct 16, 2015 at 5:58 PM, Mike Blumenkrantz wrote: > On Fri, 16 Oct 2015 16:53:28 +0100 > Daniel Stone wrote: > >> Hi, >> >> On Wednesday, 30 September 2015, Carlos Garnacho >> wrote: >> >> > Currently, there's no means for the DnD origin to know whether the >> > destination is actually finished with the DnD transaction, short of >> > finalizing it after the first transfer finishes, or leaking it >> > forever. >> > >> > But this poses other interoperation problems, drag destinations >> > might be requesting several mimetypes at once, might be just poking >> > to find out the most suitable format, might want to defer the >> > action to a popup, might be poking contents early before the >> > selection was dropped... >> > >> > In addition, data_source.cancelled is suitable for the situations >> > where the DnD operation fails (not on a drop target, no matching >> > mimetypes, etc..), but seems undocumented for that use (and unused >> > in weston's DnD). >> > >> > In order to improve the situation, the drag source should be >> > notified of all stages of DnD. In addition to documenting the >> > "cancelled" event for DnD purposes, The following 2 events have >> > been added: >> > >> > - wl_data_source.drop_performed: Happens when the operation has been >> > physically finished (eg. the button is released), it could be the >> > right place to reset the pointer cursor back and undo any other >> > state resulting from the initial button press. >> > - wl_data_source.drag_finished: Happens when the destination side >> > destroys the wl_data_offer, at this point the source can just >> > forget all data related to the DnD selection as well, plus >> > optionally deleting the data on move operations. >> > >> > Signed-off-by: Carlos Garnacho > >> >> >> Mike had a look at this from EFL - CCing him. >> >> Cheers, >> Daniel > > Hi, > > Having reviewed this, and also having fully implemented the current DND > protocol, I think that this is a good idea and would be a worthwhile > addition. I have no suggestions for modifications or trivial > bikeshedding. I didn't get to say, thanks very much for this. Is it ok to assume a Reviewed-by from you for the protocol patches? I'm very much looking forward to seeing these gaps closed in the protocol, and hopefully a few more R-bs can leverage this in. Cheers, Carlos ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH wayland 2/2] scanner: drop altmacro from dtddata.S
From: Pekka Paalanen Stop using .altmacro in dtddata.S, because clang does not yet implement it. Turns out that we do not actually seem to need it, and we can modify the syntax to work without it. Moving the double quotes from the binfile line to the .incbin line is required to avoid the assembler error "missing string". Instead of & we now use \() to mark the end of macro argument name. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92988 Signed-off-by: Pekka Paalanen --- src/dtddata.S | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/dtddata.S b/src/dtddata.S index 53debf3..68e3435 100644 --- a/src/dtddata.S +++ b/src/dtddata.S @@ -22,19 +22,18 @@ /* from: http://www.linuxjournal.com/content/embedding-file-executable-aka-hello-world-version-5967#comment-348129 */ -.altmacro .macro binfile name file .p2align 2 - .globl \name&_begin -\name&_begin: - .incbin \file -\name&_end: + .globl \name\()_begin +\name\()_begin: + .incbin "\file" +\name\()_end: .byte 0 .p2align 2 - .globl \name&_len -\name&_len: - .int (\name&_end - \name&_begin) + .globl \name\()_len +\name\()_len: + .int (\name\()_end - \name\()_begin) .endm .section .rodata -binfile DTD_DATA "src/wayland.dtd.embed" +binfile DTD_DATA src/wayland.dtd.embed -- 2.4.10 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH wayland 1/2] Makefile: use automake rule for compiling .S
From: Pekka Paalanen Automake seems to have its own rules for compiling an .o from an .S. Essentially it does the same as our hand-crafted rule, but adds some things like dependency file generation. Remove our hand-crafted rule to use the automake rule, it is less surprising. Signed-off-by: Pekka Paalanen --- Makefile.am | 3 --- 1 file changed, 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index 7d31a39..e850abc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -30,9 +30,6 @@ pkgconfig_DATA += src/wayland-scanner.pc src/dtddata.o: protocol/wayland.dtd -%.o: %.S - $(AM_V_GEN)$(CC) $(ASFLAGS) $(CPPFLAGS) $(TARGET_MACH) -c -o $@ $< - if USE_HOST_SCANNER wayland_scanner = wayland-scanner else -- 2.4.10 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH weston] configure: don't control egl version
On Wed, 18 Nov 2015 10:23:50 + "Ucan, Emre (ADITG/SW1)" wrote: > The required version only corresponds to version of mesa implementation. > This mesa version requirement causes configure errors, > when weston is configured for a different egl implementation than mesa. > Because the version of the egl drivers are not alligned > to the mesa version. Yes, this is sad. When Mesa started providing a egl.pc file and others, it encoded the Mesa version in them, not the EGL version. I've tried to ask around about this and people mostly do not care. I think someone even said that other implementations should just advertise Mesa version numbers in their .pc files. Furthermore, Mesa does not install any .pc file that would be specific to Mesa, which means that egl.pc et al. are the only way to impose version requirements on Mesa at build time. We should also note, that .pc version requirements are build time requirements, not necessarily runtime requirements. That's hard to remember, and especially tricky with EGL and GL libs that have several implementations. Often binaries are built against Mesa, but then deployed with a proprietary EGL/GL stack. This is probably a major reason why people don't care that egl.pc encodes Mesa version. If you hacked Weston to use some proprietary APIs, this won't work. > Therefore, I deleted the version controlling for egl, > so that weston can be configured for a different egl implementation. Because of all the above, I will not object to this patch, so: Acked-by: Pekka Paalanen Thanks, pq > Signed-off-by: Emre Ucan > --- > configure.ac |8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/configure.ac b/configure.ac > index c6f7fc8..50daa62 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -85,8 +85,8 @@ AC_ARG_ENABLE(egl, [ --disable-egl],, > AM_CONDITIONAL(ENABLE_EGL, test x$enable_egl = xyes) > if test x$enable_egl = xyes; then > AC_DEFINE([ENABLE_EGL], [1], [Build Weston with EGL support]) > - PKG_CHECK_MODULES(EGL, [egl >= 7.10 glesv2]) > -PKG_CHECK_MODULES([EGL_TESTS], [egl >= 7.10 glesv2 wayland-client > wayland-egl]) > + PKG_CHECK_MODULES(EGL, [egl glesv2]) > +PKG_CHECK_MODULES([EGL_TESTS], [egl glesv2 wayland-client > wayland-egl]) > PKG_CHECK_MODULES([GL_RENDERER], [libdrm]) > fi > > @@ -349,7 +349,7 @@ AC_ARG_ENABLE(simple-egl-clients, > AM_CONDITIONAL(BUILD_SIMPLE_EGL_CLIENTS, test "x$enable_simple_egl_clients" > = "xyes") > if test x$enable_simple_egl_clients = xyes; then >PKG_CHECK_MODULES(SIMPLE_EGL_CLIENT, > -[egl >= 7.10 glesv2 wayland-client wayland-egl > wayland-cursor]) > +[egl glesv2 wayland-client wayland-egl wayland-cursor]) > fi > > AC_ARG_ENABLE(simple-intel-dmabuf-client, > @@ -377,7 +377,7 @@ if test x$enable_clients = xyes; then > ># Only check for cairo-egl if a GL or GLES renderer requested >AS_IF([test "x$cairo_modules" = "xcairo-gl" -o "x$cairo_modules" = > "xcairo-glesv2"], [ > -PKG_CHECK_MODULES(CAIRO_EGL, [wayland-egl egl >= 7.10 cairo-egl >= > 1.11.3 $cairo_modules], > +PKG_CHECK_MODULES(CAIRO_EGL, [wayland-egl egl cairo-egl >= 1.11.3 > $cairo_modules], >[have_cairo_egl=yes], [have_cairo_egl=no]) > AS_IF([test "x$have_cairo_egl" = "xyes"], > [AC_DEFINE([HAVE_CAIRO_EGL], [1], [Have cairo-egl])], signature.asc Description: PGP signature ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH] compositor.h: Remove unused variable from weston_seat structure
This variable may have been used previously when evdev.c was used however that functionality seems to have been consumed by libinput, so there is no need for this variable in the weston_seat structure anymore. Signed-off-by: Chris Michael --- src/compositor.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/compositor.h b/src/compositor.h index f3e0075..669d6c9 100644 --- a/src/compositor.h +++ b/src/compositor.h @@ -536,7 +536,6 @@ struct weston_seat { void (*led_update)(struct weston_seat *ws, enum weston_led leds); - uint32_t slot_map; struct input_method *input_method; char *seat_name; }; -- 2.6.2 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH] compositor.h: Remove unused variable from weston_seat structure
On 18/11/15 09:22 AM, Chris Michael wrote: > This variable may have been used previously when evdev.c was used > however that functionality seems to have been consumed by libinput, so > there is no need for this variable in the weston_seat structure anymore. > > Signed-off-by: Chris Michael Seems obvious enough to me. Reviewed-by: Derek Foreman > --- > src/compositor.h | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/src/compositor.h b/src/compositor.h > index f3e0075..669d6c9 100644 > --- a/src/compositor.h > +++ b/src/compositor.h > @@ -536,7 +536,6 @@ struct weston_seat { > > void (*led_update)(struct weston_seat *ws, enum weston_led leds); > > - uint32_t slot_map; > struct input_method *input_method; > char *seat_name; > }; > ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH wayland] protocol: Remove incorrect statement that attach must precede damage
The documentation for wl_surface.commit makes it clear that the application of damage follows attach during the commit, so it doesn't matter what order the app sends the requests. Many existing apps post damage before attaching a buffer already, and it's really quite reasonable to do so. Signed-off-by: Derek Foreman --- protocol/wayland.xml | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/protocol/wayland.xml b/protocol/wayland.xml index 9c22d45..525e092 100644 --- a/protocol/wayland.xml +++ b/protocol/wayland.xml @@ -1095,10 +1095,8 @@ This request is used to describe the regions where the pending buffer is different from the current surface contents, and where - the surface therefore needs to be repainted. The pending buffer - must be set by wl_surface.attach before sending damage. The - compositor ignores the parts of the damage that fall outside of - the surface. + the surface therefore needs to be repainted. The compositor + ignores the parts of the damage that fall outside of the surface. Damage is double-buffered state, see wl_surface.commit. -- 2.6.2 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH wayland] protocol: Remove incorrect statement that attach must precede damage
On Wed, Nov 18, 2015 at 7:44 AM, Derek Foreman wrote: > The documentation for wl_surface.commit makes it clear that the > application of damage follows attach during the commit, so it > doesn't matter what order the app sends the requests. > > Many existing apps post damage before attaching a buffer already, > and it's really quite reasonable to do so. > Especially because they probably think of the old buffer as being the one that is "damaged", while the new buffer does not have any damage. ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: Changing wl_output.transform type to unsigned?
On Tue, Nov 17, 2015 at 8:07 PM, Jonas Ådahl wrote: > > > We'll see how that patch is received. If anyone complains it breaks > > their thing, I think we have to revert it, because it is technically > > breaking the stability rules. > > The most obvious thing that would "break" is that every client or server > C implementation will suddenly get new compiler warnings and to be able > to build both the version before and after the change without warnings, > they'd need #if #else #fi macros around every such place. > > This is primarily an annoyance anyhow since the warning is mostly > harmless. > The code could use just one #if to define GEOMETRY(x) to either be int(x) or (x) depending on the protocol header version, and then call GEOMETRY(unsigned) everywhere it needs to pass the enumeration to a protocol function. Though I think the best solution is to just fix the code so it does not produce warnings for the newer protocol files and ignore the warnings for old ones. ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH wayland 1/2] Makefile: use automake rule for compiling .S
On Wed, Nov 18, 2015 at 01:07:36PM +0200, Pekka Paalanen wrote: > From: Pekka Paalanen > > Automake seems to have its own rules for compiling an .o from an .S. > Essentially it does the same as our hand-crafted rule, but adds some > things like dependency file generation. > > Remove our hand-crafted rule to use the automake rule, it is less > surprising. > > Signed-off-by: Pekka Paalanen Reviewed-by: Peter Hutterer and I found this reference for it: http://www.gnu.org/software/automake/manual/html_node/Assembly-Support.html Cheers, Peter > --- > Makefile.am | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/Makefile.am b/Makefile.am > index 7d31a39..e850abc 100644 > --- a/Makefile.am > +++ b/Makefile.am > @@ -30,9 +30,6 @@ pkgconfig_DATA += src/wayland-scanner.pc > > src/dtddata.o: protocol/wayland.dtd > > -%.o: %.S > - $(AM_V_GEN)$(CC) $(ASFLAGS) $(CPPFLAGS) $(TARGET_MACH) -c -o $@ $< > - > if USE_HOST_SCANNER > wayland_scanner = wayland-scanner > else > -- > 2.4.10 > ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH wayland 2/2] scanner: drop altmacro from dtddata.S
On Wed, Nov 18, 2015 at 01:07:37PM +0200, Pekka Paalanen wrote: > From: Pekka Paalanen > > Stop using .altmacro in dtddata.S, because clang does not yet implement > it. Turns out that we do not actually seem to need it, and we can modify > the syntax to work without it. > > Moving the double quotes from the binfile line to the .incbin line is > required to avoid the assembler error "missing string". Instead of & we > now use \() to mark the end of macro argument name. > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92988 > > Signed-off-by: Pekka Paalanen Acked-by: Peter Hutterer Cheers, Peter > --- > src/dtddata.S | 17 - > 1 file changed, 8 insertions(+), 9 deletions(-) > > diff --git a/src/dtddata.S b/src/dtddata.S > index 53debf3..68e3435 100644 > --- a/src/dtddata.S > +++ b/src/dtddata.S > @@ -22,19 +22,18 @@ > > /* from: > http://www.linuxjournal.com/content/embedding-file-executable-aka-hello-world-version-5967#comment-348129 > */ > > -.altmacro > .macro binfile name file > .p2align 2 > - .globl \name&_begin > -\name&_begin: > - .incbin \file > -\name&_end: > + .globl \name\()_begin > +\name\()_begin: > + .incbin "\file" > +\name\()_end: > .byte 0 > .p2align 2 > - .globl \name&_len > -\name&_len: > - .int (\name&_end - \name&_begin) > + .globl \name\()_len > +\name\()_len: > + .int (\name\()_end - \name\()_begin) > .endm > > .section .rodata > -binfile DTD_DATA "src/wayland.dtd.embed" > +binfile DTD_DATA src/wayland.dtd.embed > -- > 2.4.10 > ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH wayland v2] protocol: Add wl_surface.damage_buffer
wl_surface.damage uses surface local co-ordinates. Buffer scale and buffer transforms came along, and EGL surfaces have no understanding of them. Theoretically, clients pass damage rectangles - in Y-inverted surface co-ordinates) to EGLSwapBuffersWithDamage, and the EGL implementation passed them on to wayland. However, for this to work the EGL implementation must be able to flip those rectangles into the space the compositor is expecting, but it's unable to do so because it doesn't know the height of the transformed buffer. So, currently, EGLSwapBuffersWithDamage is unusable and EGLSwapBuffers has to pass (0,0) - (INT32_MAX, INT32_MAX) damage to function. wl_surface.damage_buffer allows damage to be registered on a surface in buffer co-ordinates, avoiding this problem. Credit where it's due, these ideas are not entirely my own: Over a year ago the idea of changing damage co-ordinates to buffer co-ordinates was suggested (by Jason Ekstrand), and it was at least partially rejected and abandoned. At the time it was also suggested (by Pekka Paalanen) that adding a new wl_surface.damage_buffer request was another option. This will eventually resolve: https://bugs.freedesktop.org/show_bug.cgi?id=78190 by making the problem irrelevant. Signed-off-by: Derek Foreman --- Differnces from v1: - Don't make such a big deal about GL in the request documentation - rename the request about 3 times, eventually settle on damage_buffer - don't say anything about mixing damage and damage_buffer protocol/wayland.xml | 44 ++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/protocol/wayland.xml b/protocol/wayland.xml index 9c22d45..7665307 100644 --- a/protocol/wayland.xml +++ b/protocol/wayland.xml @@ -176,7 +176,7 @@ - + A compositor. This object is a singleton global. The compositor is in charge of combining the contents of multiple @@ -986,7 +986,7 @@ - + A surface is a rectangular area that is displayed on the screen. It has a location, size and pixel contents. @@ -,6 +,10 @@ wl_surface.commit assigns pending damage as the current damage, and clears pending damage. The server will clear the current damage as it repaints the surface. + + Alternatively, damage can be posted with wl_surface.damage_buffer + which uses buffer co-ordinates instead of surface co-ordinates, + and is probably the preferred and intuitive way of doing this. @@ -1327,6 +1331,42 @@ + + + + + This request is used to describe the regions where the pending + buffer is different from the current surface contents, and where + the surface therefore needs to be repainted. The pending buffer + must be set by wl_surface.attach before sending damage. The + compositor ignores the parts of the damage that fall outside of + the surface. + + Damage is double-buffered state, see wl_surface.commit. + + The damage rectangle is specified in buffer coordinates. + + The initial value for pending damage is empty: no damage. + wl_surface.damage adds pending damage: the new pending damage + is the union of old pending damage and the given rectangle. + + wl_surface.commit assigns pending damage as the current damage, + and clears pending damage. The server will clear the current + damage as it repaints the surface. + + This request differs from wl_surface.damage in only one way - it + takes damage in buffer co-ordinates instead of surface local + co-ordinates. While this generally is more intuitive than surface + co-ordinates, it is especially desirable when using wl_viewport + or when a drawing library (like EGL) is unaware of buffer scale + and buffer transform. + + + + + + + -- 2.6.2 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston 02/11] toytoolkit: Remove window_damage()
It's just a direct call to wl_surface_damage() anyway, and the only caller no longer exists. Signed-off-by: Derek Foreman --- clients/window.c | 7 --- clients/window.h | 4 2 files changed, 11 deletions(-) diff --git a/clients/window.c b/clients/window.c index 47628de..4353698 100644 --- a/clients/window.c +++ b/clients/window.c @@ -4512,13 +4512,6 @@ window_set_text_cursor_position(struct window *window, int32_t x, int32_t y) wl_fixed_from_int(y)); } -void -window_damage(struct window *window, int32_t x, int32_t y, - int32_t width, int32_t height) -{ - wl_surface_damage(window->main_surface->surface, x, y, width, height); -} - static void surface_enter(void *data, struct wl_surface *wl_surface, struct wl_output *wl_output) diff --git a/clients/window.h b/clients/window.h index b61a62a..b92d10c 100644 --- a/clients/window.h +++ b/clients/window.h @@ -343,10 +343,6 @@ window_schedule_redraw(struct window *window); void window_schedule_resize(struct window *window, int width, int height); -void -window_damage(struct window *window, int32_t x, int32_t y, - int32_t width, int32_t height); - cairo_surface_t * window_get_surface(struct window *window); -- 2.6.2 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston 06/11] pixman-renderer: Use output->matrix for region transformations and enable output zoom
From: Jason Ekstrand --- This fixes zoom, but it also changes how pixman's region_global_to_output works... src/pixman-renderer.c | 70 +++ 1 file changed, 60 insertions(+), 10 deletions(-) diff --git a/src/pixman-renderer.c b/src/pixman-renderer.c index e81f784..2a90d4d 100644 --- a/src/pixman-renderer.c +++ b/src/pixman-renderer.c @@ -134,12 +134,68 @@ pixman_renderer_read_pixels(struct weston_output *output, } static void +weston_matrix_transform_region(pixman_region32_t *dest, + struct weston_matrix *matrix, + pixman_region32_t *src) +{ + pixman_box32_t *src_rects, *dest_rects; + int nrects, i; + + src_rects = pixman_region32_rectangles(src, &nrects); + dest_rects = malloc(nrects * sizeof(*dest_rects)); + if (!dest_rects) + return; + + for (i = 0; i < nrects; i++) { + struct weston_vector vec1 = {{ + src_rects[i].x1, src_rects[i].y1, 0, 1 + }}; + weston_matrix_transform(matrix, &vec1); + vec1.f[0] /= vec1.f[3]; + vec1.f[1] /= vec1.f[3]; + + struct weston_vector vec2 = {{ + src_rects[i].x2, src_rects[i].y2, 0, 1 + }}; + weston_matrix_transform(matrix, &vec2); + vec2.f[0] /= vec2.f[3]; + vec2.f[1] /= vec2.f[3]; + + if (vec1.f[0] < vec2.f[0]) { + dest_rects[i].x1 = floor(vec1.f[0]); + dest_rects[i].x2 = ceil(vec2.f[0]); + } else { + dest_rects[i].x1 = floor(vec2.f[0]); + dest_rects[i].x2 = ceil(vec1.f[0]); + } + + + if (vec1.f[1] < vec2.f[1]) { + dest_rects[i].y1 = floor(vec1.f[1]); + dest_rects[i].y2 = ceil(vec2.f[1]); + } else { + dest_rects[i].y1 = floor(vec2.f[1]); + dest_rects[i].y2 = ceil(vec1.f[1]); + } + } + + pixman_region32_clear(dest); + pixman_region32_init_rects(dest, dest_rects, nrects); + free(dest_rects); +} + +static void region_global_to_output(struct weston_output *output, pixman_region32_t *region) { - pixman_region32_translate(region, -output->x, -output->y); - weston_transformed_region(output->width, output->height, - output->transform, output->current_scale, - region, region); + if (output->zoom.active) { + weston_matrix_transform_region(region, &output->matrix, region); + } else { + pixman_region32_translate(region, -output->x, -output->y); + weston_transformed_region(output->width, output->height, + output->transform, + output->current_scale, + region, region); + } } #define D2F(v) pixman_double_to_fixed((double)v) @@ -470,7 +526,6 @@ static void draw_view(struct weston_view *ev, struct weston_output *output, pixman_region32_t *damage) /* in global coordinates */ { - static int zoom_logged = 0; struct pixman_surface_state *ps = get_surface_state(ev->surface); /* repaint bounding region in global coordinates: */ pixman_region32_t repaint; @@ -487,11 +542,6 @@ draw_view(struct weston_view *ev, struct weston_output *output, if (!pixman_region32_not_empty(&repaint)) goto out; - if (output->zoom.active && !zoom_logged) { - weston_log("pixman renderer does not support zoom\n"); - zoom_logged = 1; - } - if (view_transformation_is_translation(ev)) { /* The simple case: The surface regions opaque, non-opaque, * etc. are convertible to global coordinate space. -- 2.6.2 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston 03/11] compositor: Change "touched" to bool
Signed-off-by: Derek Foreman --- src/compositor.c | 4 ++-- src/compositor.h | 2 +- src/rpi-renderer.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/compositor.c b/src/compositor.c index f8437e8..67be07d 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -2044,12 +2044,12 @@ compositor_accumulate_damage(struct weston_compositor *ec) pixman_region32_fini(&clip); wl_list_for_each(ev, &ec->view_list, link) - ev->surface->touched = 0; + ev->surface->touched = false; wl_list_for_each(ev, &ec->view_list, link) { if (ev->surface->touched) continue; - ev->surface->touched = 1; + ev->surface->touched = true; surface_flush_damage(ev->surface); diff --git a/src/compositor.h b/src/compositor.h index f3e0075..fa9c4fd 100644 --- a/src/compositor.h +++ b/src/compositor.h @@ -943,7 +943,7 @@ struct weston_surface { /* Not for long-term storage. This exists for book-keeping while * iterating over surfaces and views */ - int32_t touched; + bool touched; void *renderer_state; diff --git a/src/rpi-renderer.c b/src/rpi-renderer.c index 76e1ddf..33eb67c 100644 --- a/src/rpi-renderer.c +++ b/src/rpi-renderer.c @@ -1347,13 +1347,13 @@ rpi_renderer_repaint_output(struct weston_output *base, /* Swap resources on surfaces as needed */ wl_list_for_each_reverse(wv, &compositor->view_list, link) - wv->surface->touched = 0; + wv->surface->touched = false; wl_list_for_each_reverse(wv, &compositor->view_list, link) { view = to_rpir_view(wv); if (!wv->surface->touched) { - wv->surface->touched = 1; + wv->surface->touched = true; if (view->surface->buffer_type == BUFFER_TYPE_EGL || view->surface->need_swap) -- 2.6.2 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston 10/11] simple-damage: Offset drawing co-ordinates not buffer start
We've been setting up the viewport by moving the start pointer of the draw buffer, but later when we want to post damage in buffer co-ordinates we'll need to keep track of the x,y offsets anyway. Signed-off-by: Derek Foreman --- clients/simple-damage.c | 58 + 1 file changed, 34 insertions(+), 24 deletions(-) diff --git a/clients/simple-damage.c b/clients/simple-damage.c index 13e220a..0551b9d 100644 --- a/clients/simple-damage.c +++ b/clients/simple-damage.c @@ -454,8 +454,8 @@ redraw(void *data, struct wl_callback *callback, uint32_t time) { struct window *window = data; struct buffer *buffer; - int off_x, off_y, bwidth, bheight, bborder, bpitch, bradius; - uint32_t *buffer_data; + int off_x = 0, off_y = 0; + int bwidth, bheight, bborder, bpitch, bradius; float bx, by; buffer = window_next_buffer(window); @@ -494,8 +494,8 @@ redraw(void *data, struct wl_callback *callback, uint32_t time) bborder = window->border * window->scale; bradius = window->ball.radius * window->scale; - buffer_data = buffer->shm_data; if (window->viewport) { + int tx, ty; /* Fill the whole thing with red to detect viewport errors */ paint_box(buffer->shm_data, bpitch, 0, 0, bwidth, bheight, 0x); @@ -508,35 +508,41 @@ redraw(void *data, struct wl_callback *callback, uint32_t time) bheight /= 2; /* Offset the drawing region */ - off_x = (window->width / 3) * window->scale; - off_y = (window->height / 5) * window->scale; + tx = (window->width / 3) * window->scale; + ty = (window->height / 5) * window->scale; switch (window->transform) { default: case WL_OUTPUT_TRANSFORM_NORMAL: - buffer_data += off_y * bpitch + off_x; + off_y = ty; + off_x = tx; break; case WL_OUTPUT_TRANSFORM_90: - buffer_data += off_x * bpitch + (bwidth - off_y); + off_y = tx; + off_x = bwidth - ty; break; case WL_OUTPUT_TRANSFORM_180: - buffer_data += (bheight - off_y) * bpitch + - (bwidth - off_x); + off_y = bheight - ty; + off_x = bwidth - tx; break; case WL_OUTPUT_TRANSFORM_270: - buffer_data += (bheight - off_x) * bpitch + off_y; + off_y = bheight - tx; + off_x = ty; break; case WL_OUTPUT_TRANSFORM_FLIPPED: - buffer_data += off_y * bpitch + (bwidth - off_x); + off_y = ty; + off_x = bwidth - tx; break; case WL_OUTPUT_TRANSFORM_FLIPPED_90: - buffer_data += (bheight - off_x) * bpitch + - (bwidth - off_y); + off_y = bheight - tx; + off_x = bwidth - ty; break; case WL_OUTPUT_TRANSFORM_FLIPPED_180: - buffer_data += (bheight - off_y) * bpitch + off_x; + off_y = bheight - ty; + off_x = tx; break; case WL_OUTPUT_TRANSFORM_FLIPPED_270: - buffer_data += off_x * bpitch + off_y; + off_y = tx; + off_x = ty; break; } wl_viewport_set_source(window->viewport, @@ -547,15 +553,17 @@ redraw(void *data, struct wl_callback *callback, uint32_t time) } /* Paint the border */ - paint_box(buffer_data, bpitch, 0, 0, bwidth, bborder, 0x); - paint_box(buffer_data, bpitch, 0, 0, bborder, bheight, 0x); - paint_box(buffer_data, bpitch, - bwidth - bborder, 0, bborder, bheight, 0x); - paint_box(buffer_data, bpitch, - 0, bheight - bborder, bwidth, bborder, 0x); + paint_box(buffer->shm_data, bpitch, off_x, off_y, + bwidth, bborder, 0x); + paint_box(buffer->shm_data, bpitch, off_x, off_y, + bborder, bheight, 0x); + paint_box(buffer->shm_data, bpitch, off_x + bwidth - bborder, off_y, + bborder, bheight, 0x); + paint_box(buffer->shm_data, bpitch, off_x, off_y + bheight - bborder, + bwidth, bborder, 0x); /* fill with translucent */ - paint_box(buffer_data, bpitch, bborder, bborder, +
[PATCH weston 07/11] compositor: Move weston_matrix_transform_region to compositor.c and export it
We're going to use this to replace much of the other transform code so it's no longer just relevant to pixman-renderer.c Signed-off-by: Derek Foreman --- src/compositor.c | 51 +++ src/compositor.h | 4 src/pixman-renderer.c | 51 --- 3 files changed, 55 insertions(+), 51 deletions(-) diff --git a/src/compositor.c b/src/compositor.c index 67be07d..666bc15 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -727,6 +727,57 @@ weston_transformed_rect(int width, int height, } WL_EXPORT void +weston_matrix_transform_region(pixman_region32_t *dest, + struct weston_matrix *matrix, + pixman_region32_t *src) +{ + pixman_box32_t *src_rects, *dest_rects; + int nrects, i; + + src_rects = pixman_region32_rectangles(src, &nrects); + dest_rects = malloc(nrects * sizeof(*dest_rects)); + if (!dest_rects) + return; + + for (i = 0; i < nrects; i++) { + struct weston_vector vec1 = {{ + src_rects[i].x1, src_rects[i].y1, 0, 1 + }}; + weston_matrix_transform(matrix, &vec1); + vec1.f[0] /= vec1.f[3]; + vec1.f[1] /= vec1.f[3]; + + struct weston_vector vec2 = {{ + src_rects[i].x2, src_rects[i].y2, 0, 1 + }}; + weston_matrix_transform(matrix, &vec2); + vec2.f[0] /= vec2.f[3]; + vec2.f[1] /= vec2.f[3]; + + if (vec1.f[0] < vec2.f[0]) { + dest_rects[i].x1 = floor(vec1.f[0]); + dest_rects[i].x2 = ceil(vec2.f[0]); + } else { + dest_rects[i].x1 = floor(vec2.f[0]); + dest_rects[i].x2 = ceil(vec1.f[0]); + } + + + if (vec1.f[1] < vec2.f[1]) { + dest_rects[i].y1 = floor(vec1.f[1]); + dest_rects[i].y2 = ceil(vec2.f[1]); + } else { + dest_rects[i].y1 = floor(vec2.f[1]); + dest_rects[i].y2 = ceil(vec1.f[1]); + } + } + + pixman_region32_clear(dest); + pixman_region32_init_rects(dest, dest_rects, nrects); + free(dest_rects); +} + +WL_EXPORT void weston_transformed_region(int width, int height, enum wl_output_transform transform, int32_t scale, diff --git a/src/compositor.h b/src/compositor.h index fa9c4fd..79348a1 100644 --- a/src/compositor.h +++ b/src/compositor.h @@ -1621,6 +1621,10 @@ weston_transformed_rect(int width, int height, int32_t scale, pixman_box32_t rect); void +weston_matrix_transform_region(pixman_region32_t *dest, + struct weston_matrix *matrix, + pixman_region32_t *src); +void weston_transformed_region(int width, int height, enum wl_output_transform transform, int32_t scale, diff --git a/src/pixman-renderer.c b/src/pixman-renderer.c index 2a90d4d..9410c9c 100644 --- a/src/pixman-renderer.c +++ b/src/pixman-renderer.c @@ -134,57 +134,6 @@ pixman_renderer_read_pixels(struct weston_output *output, } static void -weston_matrix_transform_region(pixman_region32_t *dest, - struct weston_matrix *matrix, - pixman_region32_t *src) -{ - pixman_box32_t *src_rects, *dest_rects; - int nrects, i; - - src_rects = pixman_region32_rectangles(src, &nrects); - dest_rects = malloc(nrects * sizeof(*dest_rects)); - if (!dest_rects) - return; - - for (i = 0; i < nrects; i++) { - struct weston_vector vec1 = {{ - src_rects[i].x1, src_rects[i].y1, 0, 1 - }}; - weston_matrix_transform(matrix, &vec1); - vec1.f[0] /= vec1.f[3]; - vec1.f[1] /= vec1.f[3]; - - struct weston_vector vec2 = {{ - src_rects[i].x2, src_rects[i].y2, 0, 1 - }}; - weston_matrix_transform(matrix, &vec2); - vec2.f[0] /= vec2.f[3]; - vec2.f[1] /= vec2.f[3]; - - if (vec1.f[0] < vec2.f[0]) { - dest_rects[i].x1 = floor(vec1.f[0]); - dest_rects[i].x2 = ceil(vec2.f[0]); - } else { - dest_rects[i].x1 = floor(vec2.f[0]); - dest_rects[i].x2 = ceil(vec1.f[0]); - } - - - if (vec1.f[1] < vec2.f[1]) { - dest_rects[i].y1 = floor(vec1.f[1]); - dest_rects[i].y2 = ceil(vec2.f[1]); - } else { -
[PATCH weston 11/11] simple-damage: Add --use-buffer-damage flag
Add a new flag for testing damage in buffer co-ordinates Signed-off-by: Derek Foreman --- clients/simple-damage.c | 62 + 1 file changed, 47 insertions(+), 15 deletions(-) diff --git a/clients/simple-damage.c b/clients/simple-damage.c index 0551b9d..8929071 100644 --- a/clients/simple-damage.c +++ b/clients/simple-damage.c @@ -64,6 +64,7 @@ struct buffer { enum window_flags { WINDOW_FLAG_USE_VIEWPORT = 0x1, WINDOW_FLAG_ROTATING_TRANSFORM = 0x2, + WINDOW_FLAG_USE_DAMAGE_BUFFER = 0x4, }; struct window { @@ -261,6 +262,14 @@ create_window(struct display *display, int width, int height, exit(1); } + if (display->compositor_version < 4 && + (flags & WINDOW_FLAG_USE_DAMAGE_BUFFER)) { + fprintf(stderr, "wl_surface.damage_buffer unsupported in " + "wl_surface version %d\n", + display->compositor_version); + exit(1); + } + window = calloc(1, sizeof *window); if (!window) return NULL; @@ -303,8 +312,12 @@ create_window(struct display *display, int width, int height, } /* Initialise damage to full surface, so the padding gets painted */ - wl_surface_damage(window->surface, 0, 0, INT32_MAX, INT32_MAX); - + if (window->flags & WINDOW_FLAG_USE_DAMAGE_BUFFER) { + wl_surface_damage_buffer(window->surface, 0, 0, +INT32_MAX, INT32_MAX); + } else { + wl_surface_damage(window->surface, 0, 0, INT32_MAX, INT32_MAX); + } return window; } @@ -567,12 +580,20 @@ redraw(void *data, struct wl_callback *callback, uint32_t time) bwidth - 2 * bborder, bheight - 2 * bborder, 0x8000); /* Damage where the ball was */ - wl_surface_damage(window->surface, - window->ball.x - window->ball.radius, - window->ball.y - window->ball.radius, - window->ball.radius * 2 + 1, - window->ball.radius * 2 + 1); - + if (window->flags & WINDOW_FLAG_USE_DAMAGE_BUFFER) { + window_get_transformed_ball(window, &bx, &by); + wl_surface_damage_buffer(window->surface, +bx - bradius + off_x, +by - bradius + off_y, +bradius * 2 + 1, +bradius * 2 + 1); + } else { + wl_surface_damage(window->surface, + window->ball.x - window->ball.radius, + window->ball.y - window->ball.radius, + window->ball.radius * 2 + 1, + window->ball.radius * 2 + 1); + } window_advance_game(window, time); window_get_transformed_ball(window, &bx, &by); @@ -595,12 +616,19 @@ redraw(void *data, struct wl_callback *callback, uint32_t time) } /* Damage where the ball is now */ - wl_surface_damage(window->surface, - window->ball.x - window->ball.radius, - window->ball.y - window->ball.radius, - window->ball.radius * 2 + 1, - window->ball.radius * 2 + 1); - + if (window->flags & WINDOW_FLAG_USE_DAMAGE_BUFFER) { + wl_surface_damage_buffer(window->surface, +bx - bradius + off_x, +by - bradius + off_y, +bradius * 2 + 1, +bradius * 2 + 1); + } else { + wl_surface_damage(window->surface, + window->ball.x - window->ball.radius, + window->ball.y - window->ball.radius, + window->ball.radius * 2 + 1, + window->ball.radius * 2 + 1); + } wl_surface_attach(window->surface, buffer->buffer, 0, 0); if (window->display->compositor_version >= 2 && @@ -787,6 +815,7 @@ print_usage(int retval) " --transform=TRANSFORM\tTransform for the surface\n" " --rotating-transform\tUse a different buffer_transform for each frame\n" " --use-viewport\tUse wl_viewport\n" + " --use-damage-buffer\tUse damage_buffer to post damage\n" ); exit(retval); @@ -837,7 +866,7 @@ main(int argc, char **argv) strcmp(argv[i], "-h") == 0) { print_usage(0); } else if (sscanf(argv[i], "--version=%d", &version) > 0) { - if (version < 1 || version > 3) { + if (ver
[PATCH weston 04/11] gl-renderer: Use a bool for needs_full_upload
Signed-off-by: Derek Foreman --- src/gl-renderer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gl-renderer.c b/src/gl-renderer.c index d7231f4..4c231d1 100644 --- a/src/gl-renderer.c +++ b/src/gl-renderer.c @@ -111,7 +111,7 @@ struct gl_surface_state { GLuint textures[3]; int num_textures; - int needs_full_upload; + bool needs_full_upload; pixman_region32_t texture_damage; /* These are only used by SHM surfaces to detect when we need @@ -1253,7 +1253,7 @@ gl_renderer_flush_damage(struct weston_surface *surface) done: pixman_region32_fini(&gs->texture_damage); pixman_region32_init(&gs->texture_damage); - gs->needs_full_upload = 0; + gs->needs_full_upload = false; weston_buffer_reference(&gs->buffer_ref, NULL); } @@ -1331,7 +1331,7 @@ gl_renderer_attach_shm(struct weston_surface *es, struct weston_buffer *buffer, gs->gl_format = gl_format; gs->gl_pixel_type = gl_pixel_type; gs->buffer_type = BUFFER_TYPE_SHM; - gs->needs_full_upload = 1; + gs->needs_full_upload = true; gs->y_inverted = 1; gs->surface = es; -- 2.6.2 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston 05/11] gl-renderer: Make texture_used a bool instead of an int
Signed-off-by: Derek Foreman --- src/gl-renderer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gl-renderer.c b/src/gl-renderer.c index 4c231d1..2c51a83 100644 --- a/src/gl-renderer.c +++ b/src/gl-renderer.c @@ -1173,7 +1173,7 @@ gl_renderer_flush_damage(struct weston_surface *surface) struct gl_surface_state *gs = get_surface_state(surface); struct weston_buffer *buffer = gs->buffer_ref.buffer; struct weston_view *view; - int texture_used; + bool texture_used; #ifdef GL_EXT_unpack_subimage pixman_box32_t *rectangles; @@ -1192,10 +1192,10 @@ gl_renderer_flush_damage(struct weston_surface *surface) * hold the reference to the buffer, in case the surface * migrates back to the primary plane. */ - texture_used = 0; + texture_used = false; wl_list_for_each(view, &surface->views, surface_link) { if (view->plane == &surface->compositor->primary_plane) { - texture_used = 1; + texture_used = true; break; } } -- 2.6.2 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston 00/11] implement damage_buffer
As usual I've included random NOPwork in the vicinity of the important changes. It was convenient to have a way to transform a region with a matrix so I cherry-picked Jason Ekstrand's patch to do so out of my transform series from over a year ago. This changes pixman zooming, which is utterly broken now and works properly (if slowly) after the patch. If that's a problem I can keep the function and stop using it in the pixman renderer, I just didn't want to change the patch. There should be no problem with interaction between damage and damage_buffer. damage_buffer just converts its damage into surface co-ordinates at commit time. The implementation came out fairly clean so I removed warnings about mixing the two from the wayland proto xml. I didn't bother making toytoolkit prefer damage_buffer if available (though I did a hack job of it for testing weston-subsurfaces, not included here). simple-damage has been updated with a --use-damage-buffer switch for testing. There's a bit of a bug fix in here too - currently if we post damage with negative width or height those values are passed right on to pixman which whines in the log. Thanks for looking, Derek Derek Foreman (10): smoke: Don't post extra damage toytoolkit: Remove window_damage() compositor: Change "touched" to bool gl-renderer: Use a bool for needs_full_upload gl-renderer: Make texture_used a bool instead of an int compositor: Move weston_matrix_transform_region to compositor.c and export it compositor: ignore surface_damage with negative height or width compositor: Add buffer_damage simple-damage: Offset drawing co-ordinates not buffer start simple-damage: Add --use-buffer-damage flag Jason Ekstrand (1): pixman-renderer: Use output->matrix for region transformations and enable output zoom clients/simple-damage.c | 120 ++- clients/smoke.c | 2 - clients/window.c| 7 --- clients/window.h| 4 -- src/compositor.c| 148 ++-- src/compositor.h| 10 +++- src/gl-renderer.c | 12 ++-- src/pixman-renderer.c | 19 +++ src/rpi-renderer.c | 4 +- 9 files changed, 237 insertions(+), 89 deletions(-) -- 2.6.2 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston 08/11] compositor: ignore surface_damage with negative height or width
If we pass negative height or width on to pixman we get error messages in the log. Signed-off-by: Derek Foreman --- src/compositor.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/compositor.c b/src/compositor.c index 666bc15..0efb325 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -2574,6 +2574,9 @@ surface_damage(struct wl_client *client, { struct weston_surface *surface = wl_resource_get_user_data(resource); + if (width < 0 || height < 0) + return; + pixman_region32_union_rect(&surface->pending.damage, &surface->pending.damage, x, y, width, height); -- 2.6.2 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston 09/11] compositor: Add buffer_damage
Add an implementation of wl_surface.buffer_damage, similar to wl_surface.damage except it uses buffer co-ordinates. Signed-off-by: Derek Foreman --- src/compositor.c | 90 ++-- src/compositor.h | 4 ++- 2 files changed, 78 insertions(+), 16 deletions(-) diff --git a/src/compositor.c b/src/compositor.c index 0efb325..9a02b34 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -525,7 +525,8 @@ weston_surface_state_init(struct weston_surface_state *state) state->sx = 0; state->sy = 0; - pixman_region32_init(&state->damage); + pixman_region32_init(&state->damage_surface); + pixman_region32_init(&state->damage_buffer); pixman_region32_init(&state->opaque); region_init_infinite(&state->input); @@ -552,7 +553,8 @@ weston_surface_state_fini(struct weston_surface_state *state) pixman_region32_fini(&state->input); pixman_region32_fini(&state->opaque); - pixman_region32_fini(&state->damage); + pixman_region32_fini(&state->damage_surface); + pixman_region32_fini(&state->damage_buffer); if (state->buffer) wl_list_remove(&state->buffer_destroy_listener.link); @@ -2577,8 +2579,23 @@ surface_damage(struct wl_client *client, if (width < 0 || height < 0) return; - pixman_region32_union_rect(&surface->pending.damage, - &surface->pending.damage, + pixman_region32_union_rect(&surface->pending.damage_surface, + &surface->pending.damage_surface, + x, y, width, height); +} + +static void +surface_damage_buffer(struct wl_client *client, + struct wl_resource *resource, + int32_t x, int32_t y, int32_t width, int32_t height) +{ + struct weston_surface *surface = wl_resource_get_user_data(resource); + + if (width < 0 || height < 0) + return; + + pixman_region32_union_rect(&surface->pending.damage_buffer, + &surface->pending.damage_buffer, x, y, width, height); } @@ -2741,6 +2758,40 @@ weston_surface_build_buffer_matrix(struct weston_surface *surface, weston_matrix_scale(matrix, vp->buffer.scale, vp->buffer.scale, 1); } +/* Translate pending damage in buffer co-ordinates to surface + * co-ordinates and union it with a pixman_region32_t. + * This should only be called after the buffer is attached. + */ +static void +apply_damage_buffer(pixman_region32_t *dest, + struct weston_surface *surface, + struct weston_surface_state *state) +{ + struct weston_buffer *buffer = surface->buffer_ref.buffer; + + /* wl_surface.damage_buffer needs to be clipped to the buffer, +* translated into surface co-ordinates and unioned with +* any other surface damage. +* None of this makes sense if there is no buffer though. +*/ + if (buffer && pixman_region32_not_empty(&state->damage_buffer)) { + pixman_region32_t buffer_damage; + + pixman_region32_intersect_rect(&state->damage_buffer, + &state->damage_buffer, + 0, 0, buffer->width, + buffer->height); + pixman_region32_init(&buffer_damage); + weston_matrix_transform_region(&buffer_damage, + &surface->buffer_to_surface_matrix, + &state->damage_buffer); + pixman_region32_union(dest, dest, &buffer_damage); + pixman_region32_fini(&buffer_damage); + } + /* We should clear this on commit even if there was no buffer */ + pixman_region32_clear(&state->damage_buffer); +} + static void weston_surface_commit_state(struct weston_surface *surface, struct weston_surface_state *state) @@ -2774,15 +2825,20 @@ weston_surface_commit_state(struct weston_surface *surface, state->newly_attached = 0; state->buffer_viewport.changed = 0; - /* wl_surface.damage */ + /* wl_surface.damage and wl_surface.damage_buffer */ if (weston_timeline_enabled_ && - pixman_region32_not_empty(&state->damage)) + (pixman_region32_not_empty(&state->damage_surface) || +pixman_region32_not_empty(&state->damage_buffer))) TL_POINT("core_commit_damage", TLP_SURFACE(surface), TLP_END); + pixman_region32_union(&surface->damage, &surface->damage, - &state->damage); + &state->damage_surface); + + apply_damage_buffer(&surface->damage, surface, state); + pixman_region32_intersect_rect(&surface->damage, &s
[PATCH weston 01/11] smoke: Don't post extra damage
We're going to post damage when the widget redraw happens anyway. Signed-off-by: Derek Foreman --- clients/smoke.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/clients/smoke.c b/clients/smoke.c index c8fdc06..77120b4 100644 --- a/clients/smoke.c +++ b/clients/smoke.c @@ -201,8 +201,6 @@ redraw_handler(struct widget *widget, void *data) render(smoke, surface); - window_damage(smoke->window, 0, 0, smoke->width, smoke->height); - cairo_surface_destroy(surface); widget_schedule_redraw(smoke->widget); -- 2.6.2 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH v5 wayland] protocol: add wl_pointer.frame, axis_source, axis_stop, and axis_discrete
On Mon, Nov 16, 2015 at 07:07:46PM +, Daniel Stone wrote: > Hi, > > On Monday, 16 November 2015, Bill Spitzak wrote: > > > > Since the "frame" event groups everything together, it does not seem like > > there is a need to talk about "latching". _descrete events are "latching" > > in that they are in the same frame. This could remove some complexity from > > your description I think. > > > > Indeed, talking about grouped rather than latched events may help a bit. We > already use latched to describe, e.g. wl_surface.commit, and using > different language may help clarify a bit. discrete events are latching for axis events though, they're not just grouped in the same frame, they always precede the axis event. If you have two axis updates in the same frame, the only allowed order is: axis_discrete axis axis_discrete axis frame it is not permitted to have: axis_discrete axis_discrete axis axis frame Theoretically possible now that we carry the axis information, but that'd require buy-in from all the current reviewers. Cheers, Peter ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH wayland-protocols 1/2] Introduce wp_relative_pointer interface
On Tue, Nov 17, 2015 at 06:09:17PM +0800, Jonas Ådahl wrote: > The wp_relative_pointer interface is an extension to the wl_pointer > interface created from wl_seat. It has the same focus, but adds the > functionality of sending relative pointer motions unhindered by > constraints such as monitor edges or other barriers. It also contains > unaccelerated pointer motion information. > > Signed-off-by: Jonas Ådahl > --- > > There has alreay been RBs on this protocol, but I'd like to get them > explicitly re-RB:ed considering that the protocol has changed some, even > though the changes have not been major ones. > > > Changes since the last version sent as weston patches: > > Interfaces and protocol renamed according to wayland-protocols naming > conventions. > > Accelerated and unaccelerated motion deltas have the data type > wl_fixed_t now again. 64 bit fixed point deltas was deemed unnecessary, > and wl_double_fixed_t was dropped. > > 64 bit timestamp argument name suffix changed from msb/lsb to hi/lo. > > Various other minor changes. > > > Jonas > > > Makefile.am| 1 + > unstable/relative-pointer/README | 4 + > .../relative-pointer-unstable-v1.xml | 122 > + > 3 files changed, 127 insertions(+) > create mode 100644 unstable/relative-pointer/README > create mode 100644 unstable/relative-pointer/relative-pointer-unstable-v1.xml > > diff --git a/Makefile.am b/Makefile.am > index f1bac16..2db6bd5 100644 > --- a/Makefile.am > +++ b/Makefile.am > @@ -5,6 +5,7 @@ nobase_dist_pkgdata_DATA = > \ > unstable/text-input/text-input-unstable-v1.xml > \ > unstable/input-method/input-method-unstable-v1.xml > \ > unstable/xdg-shell/xdg-shell-unstable-v5.xml > \ > + unstable/relative-pointer/relative-pointer-unstable-v1.xml > \ > $(NULL) > > pkgconfigdir = $(libdir)/pkgconfig > diff --git a/unstable/relative-pointer/README > b/unstable/relative-pointer/README > new file mode 100644 > index 000..64c42a1 > --- /dev/null > +++ b/unstable/relative-pointer/README > @@ -0,0 +1,4 @@ > +Relative pointer protocol > + > +Maintainers: > +Jonas Ådahl > diff --git a/unstable/relative-pointer/relative-pointer-unstable-v1.xml > b/unstable/relative-pointer/relative-pointer-unstable-v1.xml > new file mode 100644 > index 000..0411d1f > --- /dev/null > +++ b/unstable/relative-pointer/relative-pointer-unstable-v1.xml > @@ -0,0 +1,122 @@ > + > + It'd be nice to use here to add a high-level overview of the protocol, this is the best place to add prose to put people in the right mindset :) > + > + > +Copyright © 2014 Jonas Ådahl > +Copyright © 2015 Red Hat Inc. > + > +Permission is hereby granted, free of charge, to any person obtaining a > +copy of this software and associated documentation files (the > "Software"), > +to deal in the Software without restriction, including without limitation > +the rights to use, copy, modify, merge, publish, distribute, sublicense, > +and/or sell copies of the Software, and to permit persons to whom the > +Software is furnished to do so, subject to the following conditions: > + > +The above copyright notice and this permission notice (including the next > +paragraph) shall be included in all copies or substantial portions of the > +Software. > + > +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS > OR > +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL > +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR > OTHER > +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING > +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER > +DEALINGS IN THE SOFTWARE. > + > + > + > + > + A global interface used for getting the relative pointer object for a > + given seat. > + > + Warning! The protocol described in this file is experimental and > backward > + incompatible changes may be made. Backward compatible changes may be > added > + together with the corresponding interface version bump. Backward > + incompatible changes are done by bumping the version number in the > + protocol and interface names and resetting the interface version. Once > + the protocol is to be declared stable, the 'z' prefix and the version > + number in the protocol and interface names are removed and the > interface > + version number is reset. > + > + > + > + > + Used by the client to notify the server that it will no longer use this > + relative pointer manager object. > + > + > + > + > + > +
Re: [PATCH wayland-protocols 2/2] Introduce pointer locking and confinement protocol
On Tue, Nov 17, 2015 at 06:09:18PM +0800, Jonas Ådahl wrote: > This patch introduces a new protocol for locking and confining a > pointer. It consists of a new global object with two requests; one for > locking the surface to a position, one for confining the pointer to a > given region. > > Signed-off-by: Jonas Ådahl > --- > > Changes since last version sent as weston patches: > > Interfaces and protocol renamed according to wayland-protocols naming > conventions. > > The global interface is now called wl_pointer_constraints instead of > wl_pointer_lock. > > The position hint is now double buffered. > > Various other minor changes. > > > Jonas > > > Makefile.am| 1 + > unstable/pointer-constraints/README| 4 + > .../pointer-constraints-unstable-v1.xml| 283 > + > 3 files changed, 288 insertions(+) > create mode 100644 unstable/pointer-constraints/README > create mode 100644 > unstable/pointer-constraints/pointer-constraints-unstable-v1.xml > > diff --git a/Makefile.am b/Makefile.am > index 2db6bd5..983ae1b 100644 > --- a/Makefile.am > +++ b/Makefile.am > @@ -6,6 +6,7 @@ nobase_dist_pkgdata_DATA = > \ > unstable/input-method/input-method-unstable-v1.xml > \ > unstable/xdg-shell/xdg-shell-unstable-v5.xml > \ > unstable/relative-pointer/relative-pointer-unstable-v1.xml > \ > + unstable/pointer-constraints/pointer-constraints-unstable-v1.xml > \ > $(NULL) > > pkgconfigdir = $(libdir)/pkgconfig > diff --git a/unstable/pointer-constraints/README > b/unstable/pointer-constraints/README > new file mode 100644 > index 000..8a242f8 > --- /dev/null > +++ b/unstable/pointer-constraints/README > @@ -0,0 +1,4 @@ > +Pointer constraints protocol > + > +Maintainers: > +Jonas Ådahl > diff --git a/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml > b/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml > new file mode 100644 > index 000..c71d6d5 > --- /dev/null > +++ b/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml > @@ -0,0 +1,283 @@ > + > + > + > + > +Copyright © 2014 Jonas Ådahl > +Copyright © 2015 Red Hat Inc. > + > +Permission is hereby granted, free of charge, to any person obtaining a > +copy of this software and associated documentation files (the > "Software"), > +to deal in the Software without restriction, including without limitation > +the rights to use, copy, modify, merge, publish, distribute, sublicense, > +and/or sell copies of the Software, and to permit persons to whom the > +Software is furnished to do so, subject to the following conditions: > + > +The above copyright notice and this permission notice (including the next > +paragraph) shall be included in all copies or substantial portions of the > +Software. > + > +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS > OR > +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL > +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR > OTHER > +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING > +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER > +DEALINGS IN THE SOFTWARE. > + > + > + > + > + The global interface exposing pointer constraining functionality. It > + exposes two requests; lock_pointer for locking the pointer to its > + position, and confine_pointer for locking the pointer to a region. > + > + The lock_pointer and confine_pointer creates the objects > wp_locked_pointer typo: create and either skip "The" or use "The ... requests" > + and wp_confined_pointer respectively, and the client can use these > objects > + to interact with the lock. > + > + For any surface, only one lock or confinement per seat may be active at > + any time. If a lock or confinement is requested when another lock or > + confinement is active or requested on that surface and seat, an > + 'already_constrained' error will be raised. > + > + Warning! The protocol described in this file is experimental and > + backward incompatible changes may be made. Backward compatible changes > + may be added together with the corresponding interface version bump. > + Backward incompatible changes are done by bumping the version number in > + the protocol and interface names and resetting the interface version. > + Once the protocol is to be declared stable, the 'z' prefix and the > + version number in the protocol and interface names are removed and the > + interface version number is reset. > + > + > + > +
Re: [PATCH v5 wayland] protocol: add wl_pointer.frame, axis_source, axis_stop, and axis_discrete
On Wed, Nov 18, 2015 at 2:46 PM, Peter Hutterer wrote: > On Mon, Nov 16, 2015 at 07:07:46PM +, Daniel Stone wrote: > > Hi, > > > > On Monday, 16 November 2015, Bill Spitzak wrote: > > > > > > Since the "frame" event groups everything together, it does not seem > like > > > there is a need to talk about "latching". _descrete events are > "latching" > > > in that they are in the same frame. This could remove some complexity > from > > > your description I think. > > > > > > > Indeed, talking about grouped rather than latched events may help a bit. > We > > already use latched to describe, e.g. wl_surface.commit, and using > > different language may help clarify a bit. > > discrete events are latching for axis events though, they're not just > grouped in the same frame, they always precede the axis event. If you have > two axis updates in the same frame, the only allowed order is: > axis_discrete > axis > axis_discrete > axis > frame > > it is not permitted to have: > axis_discrete > axis_discrete > axis > axis > frame > > Theoretically possible now that we carry the axis information, but that'd > require buy-in from all the current reviewers. > I think you might want to check to see if everybody thinks that is ok, because it makes things simpler by only having to talk about frames, and removing the latching discussion. I think what is happening is that wayland is starting to group events and requests, and is settling on an idea of a frame message to delimit the groups, rather than the latching idea. The Weston code can still always send them in the alternating order, with a comment in the code that this is for back-compatibility, but removing any discussion of latching from the documentation. ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH weston 11/11] simple-damage: Add --use-buffer-damage flag
As this code is going to be referred to by people trying to figure out wayland, it might be best to use this by default. Fall back to the old damage request only if the api is too old or if a special switch is passed. On Wed, Nov 18, 2015 at 2:32 PM, Derek Foreman wrote: > Add a new flag for testing damage in buffer co-ordinates > > Signed-off-by: Derek Foreman > --- > clients/simple-damage.c | 62 > + > 1 file changed, 47 insertions(+), 15 deletions(-) > > diff --git a/clients/simple-damage.c b/clients/simple-damage.c > index 0551b9d..8929071 100644 > --- a/clients/simple-damage.c > +++ b/clients/simple-damage.c > @@ -64,6 +64,7 @@ struct buffer { > enum window_flags { > WINDOW_FLAG_USE_VIEWPORT = 0x1, > WINDOW_FLAG_ROTATING_TRANSFORM = 0x2, > + WINDOW_FLAG_USE_DAMAGE_BUFFER = 0x4, > }; > > struct window { > @@ -261,6 +262,14 @@ create_window(struct display *display, int width, int > height, > exit(1); > } > > + if (display->compositor_version < 4 && > + (flags & WINDOW_FLAG_USE_DAMAGE_BUFFER)) { > + fprintf(stderr, "wl_surface.damage_buffer unsupported in " > + "wl_surface version %d\n", > + display->compositor_version); > + exit(1); > + } > + > window = calloc(1, sizeof *window); > if (!window) > return NULL; > @@ -303,8 +312,12 @@ create_window(struct display *display, int width, int > height, > } > > /* Initialise damage to full surface, so the padding gets painted > */ > - wl_surface_damage(window->surface, 0, 0, INT32_MAX, INT32_MAX); > - > + if (window->flags & WINDOW_FLAG_USE_DAMAGE_BUFFER) { > + wl_surface_damage_buffer(window->surface, 0, 0, > +INT32_MAX, INT32_MAX); > + } else { > + wl_surface_damage(window->surface, 0, 0, INT32_MAX, > INT32_MAX); > + } > return window; > } > > @@ -567,12 +580,20 @@ redraw(void *data, struct wl_callback *callback, > uint32_t time) > bwidth - 2 * bborder, bheight - 2 * bborder, 0x8000); > > /* Damage where the ball was */ > - wl_surface_damage(window->surface, > - window->ball.x - window->ball.radius, > - window->ball.y - window->ball.radius, > - window->ball.radius * 2 + 1, > - window->ball.radius * 2 + 1); > - > + if (window->flags & WINDOW_FLAG_USE_DAMAGE_BUFFER) { > + window_get_transformed_ball(window, &bx, &by); > + wl_surface_damage_buffer(window->surface, > +bx - bradius + off_x, > +by - bradius + off_y, > +bradius * 2 + 1, > +bradius * 2 + 1); > + } else { > + wl_surface_damage(window->surface, > + window->ball.x - window->ball.radius, > + window->ball.y - window->ball.radius, > + window->ball.radius * 2 + 1, > + window->ball.radius * 2 + 1); > + } > window_advance_game(window, time); > > window_get_transformed_ball(window, &bx, &by); > @@ -595,12 +616,19 @@ redraw(void *data, struct wl_callback *callback, > uint32_t time) > } > > /* Damage where the ball is now */ > - wl_surface_damage(window->surface, > - window->ball.x - window->ball.radius, > - window->ball.y - window->ball.radius, > - window->ball.radius * 2 + 1, > - window->ball.radius * 2 + 1); > - > + if (window->flags & WINDOW_FLAG_USE_DAMAGE_BUFFER) { > + wl_surface_damage_buffer(window->surface, > +bx - bradius + off_x, > +by - bradius + off_y, > +bradius * 2 + 1, > +bradius * 2 + 1); > + } else { > + wl_surface_damage(window->surface, > + window->ball.x - window->ball.radius, > + window->ball.y - window->ball.radius, > + window->ball.radius * 2 + 1, > + window->ball.radius * 2 + 1); > + } > wl_surface_attach(window->surface, buffer->buffer, 0, 0); > > if (window->display->compositor_version >= 2 && > @@ -787,6 +815,7 @@ print_usage(int retval) > " --transform=TRANSFORM\tTransform for the surface\n" > " --rotating-transform\tUse a different buffer_transform > for eac
Re: [PATCH weston 10/11] simple-damage: Offset drawing co-ordinates not buffer start
You sure this has to change? On Wed, Nov 18, 2015 at 2:32 PM, Derek Foreman wrote: > We've been setting up the viewport by moving the start pointer of the > draw buffer, but later when we want to post damage in buffer co-ordinates > we'll need to keep track of the x,y offsets anyway. > > Signed-off-by: Derek Foreman > --- > clients/simple-damage.c | 58 > + > 1 file changed, 34 insertions(+), 24 deletions(-) > > diff --git a/clients/simple-damage.c b/clients/simple-damage.c > index 13e220a..0551b9d 100644 > --- a/clients/simple-damage.c > +++ b/clients/simple-damage.c > @@ -454,8 +454,8 @@ redraw(void *data, struct wl_callback *callback, > uint32_t time) > { > struct window *window = data; > struct buffer *buffer; > - int off_x, off_y, bwidth, bheight, bborder, bpitch, bradius; > - uint32_t *buffer_data; > + int off_x = 0, off_y = 0; > + int bwidth, bheight, bborder, bpitch, bradius; > float bx, by; > > buffer = window_next_buffer(window); > @@ -494,8 +494,8 @@ redraw(void *data, struct wl_callback *callback, > uint32_t time) > bborder = window->border * window->scale; > bradius = window->ball.radius * window->scale; > > - buffer_data = buffer->shm_data; > if (window->viewport) { > + int tx, ty; > /* Fill the whole thing with red to detect viewport errors > */ > paint_box(buffer->shm_data, bpitch, 0, 0, bwidth, bheight, > 0x); > @@ -508,35 +508,41 @@ redraw(void *data, struct wl_callback *callback, > uint32_t time) > bheight /= 2; > > /* Offset the drawing region */ > - off_x = (window->width / 3) * window->scale; > - off_y = (window->height / 5) * window->scale; > + tx = (window->width / 3) * window->scale; > + ty = (window->height / 5) * window->scale; > switch (window->transform) { > default: > case WL_OUTPUT_TRANSFORM_NORMAL: > - buffer_data += off_y * bpitch + off_x; > + off_y = ty; > + off_x = tx; > break; > case WL_OUTPUT_TRANSFORM_90: > - buffer_data += off_x * bpitch + (bwidth - off_y); > + off_y = tx; > + off_x = bwidth - ty; > break; > case WL_OUTPUT_TRANSFORM_180: > - buffer_data += (bheight - off_y) * bpitch + > - (bwidth - off_x); > + off_y = bheight - ty; > + off_x = bwidth - tx; > break; > case WL_OUTPUT_TRANSFORM_270: > - buffer_data += (bheight - off_x) * bpitch + off_y; > + off_y = bheight - tx; > + off_x = ty; > break; > case WL_OUTPUT_TRANSFORM_FLIPPED: > - buffer_data += off_y * bpitch + (bwidth - off_x); > + off_y = ty; > + off_x = bwidth - tx; > break; > case WL_OUTPUT_TRANSFORM_FLIPPED_90: > - buffer_data += (bheight - off_x) * bpitch + > - (bwidth - off_y); > + off_y = bheight - tx; > + off_x = bwidth - ty; > break; > case WL_OUTPUT_TRANSFORM_FLIPPED_180: > - buffer_data += (bheight - off_y) * bpitch + off_x; > + off_y = bheight - ty; > + off_x = tx; > break; > case WL_OUTPUT_TRANSFORM_FLIPPED_270: > - buffer_data += off_x * bpitch + off_y; > + off_y = tx; > + off_x = ty; > break; > } > wl_viewport_set_source(window->viewport, > @@ -547,15 +553,17 @@ redraw(void *data, struct wl_callback *callback, > uint32_t time) > } > > /* Paint the border */ > - paint_box(buffer_data, bpitch, 0, 0, bwidth, bborder, 0x); > - paint_box(buffer_data, bpitch, 0, 0, bborder, bheight, 0x); > - paint_box(buffer_data, bpitch, > - bwidth - bborder, 0, bborder, bheight, 0x); > - paint_box(buffer_data, bpitch, > - 0, bheight - bborder, bwidth, bborder, 0x); > + paint_box(buffer->shm_data, bpitch, off_x, off_y, > + bwidth, bborder, 0x); > + paint_box(buffer->shm_data, bpitch, off_x, off_y, > + bborder, bheight, 0x); > + paint_box(buffer->shm_data, bpitch, off_x + bwidth
Re: [PATCH weston 08/11] compositor: ignore surface_damage with negative height or width
On Wed, Nov 18, 2015 at 2:32 PM, Derek Foreman wrote: > If we pass negative height or width on to pixman we get error messages > in the log. > > Signed-off-by: Derek Foreman > --- > src/compositor.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/src/compositor.c b/src/compositor.c > index 666bc15..0efb325 100644 > --- a/src/compositor.c > +++ b/src/compositor.c > @@ -2574,6 +2574,9 @@ surface_damage(struct wl_client *client, > { > struct weston_surface *surface = > wl_resource_get_user_data(resource); > > + if (width < 0 || height < 0) > + return; > Might as well quit on <= 0 here, since a zero-sized rectangle won't do anything. > pixman_region32_union_rect(&surface->pending.damage, >&surface->pending.damage, >x, y, width, height); > ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH weston v4 11/20] Implement the relative pointer protocol
On Tue, Nov 17, 2015 at 06:10:57PM +0800, Jonas Ådahl wrote: > A wp_relative_pointer object is an extension to the wl_pointer interface > only used for emitting relative pointer events. It will only emit events > when the parent pointer has focus. > > To get a relative pointer object, use the get_relative_pointer request > of the global wp_relative_pointer_manager object. > > The relative pointer protocol is currently an unstable protocol, so > unstable protocol naming conventions has been applied. > > Signed-off-by: Jonas Ådahl Reviewed-by: Peter Hutterer one comment regarding indentation below > --- > > Changes since v3: > > Uses the XML file from wayland-protocols. > > Updated implementation given interface renaming. > > Updated implementation given protocol changes (see protocol patch). > > > > Makefile.am | 4 +- > src/compositor.c | 3 + > src/compositor.h | 4 ++ > src/input.c | 188 > +-- > 4 files changed, 180 insertions(+), 19 deletions(-) > > diff --git a/Makefile.am b/Makefile.am > index cbb3b57..08a3444 100644 > --- a/Makefile.am > +++ b/Makefile.am > @@ -126,7 +126,9 @@ nodist_weston_SOURCES = > \ > protocol/scaler-protocol.c \ > protocol/scaler-server-protocol.h \ > protocol/linux-dmabuf-unstable-v1-protocol.c\ > - protocol/linux-dmabuf-unstable-v1-server-protocol.h > + protocol/linux-dmabuf-unstable-v1-server-protocol.h \ > + protocol/relative-pointer-unstable-v1-protocol.c\ > + protocol/relative-pointer-unstable-v1-server-protocol.h > > BUILT_SOURCES += $(nodist_weston_SOURCES) > > diff --git a/src/compositor.c b/src/compositor.c > index 6f8d769..12bd18e 100644 > --- a/src/compositor.c > +++ b/src/compositor.c > @@ -4508,6 +4508,9 @@ weston_compositor_create(struct wl_display *display, > void *user_data) > ec, bind_presentation)) > goto fail; > > + if (weston_input_init(ec) != 0) > + goto fail; > + > wl_list_init(&ec->view_list); > wl_list_init(&ec->plane_list); > wl_list_init(&ec->layer_list); > diff --git a/src/compositor.h b/src/compositor.h > index bd0d134..46a4d1f 100644 > --- a/src/compositor.h > +++ b/src/compositor.h > @@ -335,6 +335,7 @@ struct weston_pointer_client { > struct wl_list link; > struct wl_client *client; > struct wl_list pointer_resources; > + struct wl_list relative_pointer_resources; > }; > > struct weston_pointer { > @@ -1647,6 +1648,9 @@ int > noop_renderer_init(struct weston_compositor *ec); > > int > +weston_input_init(struct weston_compositor *compositor); > + > +int > backend_init(struct weston_compositor *c, >int *argc, char *argv[], >struct weston_config *config, > diff --git a/src/input.c b/src/input.c > index e9723fc..97bffab 100644 > --- a/src/input.c > +++ b/src/input.c > @@ -37,6 +37,7 @@ > #include "shared/helpers.h" > #include "shared/os-compatibility.h" > #include "compositor.h" > +#include "protocol/relative-pointer-unstable-v1-server-protocol.h" > > static void > empty_region(pixman_region32_t *region) > @@ -56,6 +57,7 @@ weston_pointer_client_create(struct wl_client *client) > > pointer_client->client = client; > wl_list_init(&pointer_client->pointer_resources); > + wl_list_init(&pointer_client->relative_pointer_resources); > > return pointer_client; > } > @@ -69,7 +71,9 @@ weston_pointer_client_destroy(struct weston_pointer_client > *pointer_client) > static bool > weston_pointer_client_is_empty(struct weston_pointer_client *pointer_client) > { > - return wl_list_empty(&pointer_client->pointer_resources); > + return > + wl_list_empty(&pointer_client->pointer_resources) && > + wl_list_empty(&pointer_client->relative_pointer_resources); this is odd-looking indentation... Cheers, Peter > } > > static struct weston_pointer_client * > @@ -140,6 +144,49 @@ static void unbind_resource(struct wl_resource *resource) > } > > WL_EXPORT void > +weston_pointer_motion_to_abs(struct weston_pointer *pointer, > + struct weston_pointer_motion_event *event, > + wl_fixed_t *x, wl_fixed_t *y) > +{ > + if (event->mask & WESTON_POINTER_MOTION_ABS) { > + *x = wl_fixed_from_double(event->x); > + *y = wl_fixed_from_double(event->y); > + } else if (event->mask & WESTON_POINTER_MOTION_REL) { > + *x = pointer->x + wl_fixed_from_double(event->dx); > + *y = pointer->y + wl_fixed_from_double(event->dy); > + } else { > + assert(!"invalid motion event"); > + *x = *y = 0; > + } > +} > + > +static bool > +weston_pointer_motion_to_rel(struct weston_pointer *pointer, > + struct weston_po
Re: [PATCH weston v4 07/20] libinput: Expose unaccelerated motion deltas in motion event struct
On Tue, Nov 17, 2015 at 06:10:53PM +0800, Jonas Ådahl wrote: > Signed-off-by: Jonas Ådahl > --- > src/compositor.h | 3 +++ > src/libinput-device.c | 9 - > 2 files changed, 11 insertions(+), 1 deletion(-) > > diff --git a/src/compositor.h b/src/compositor.h > index 032c637..3b1f63e 100644 > --- a/src/compositor.h > +++ b/src/compositor.h > @@ -243,6 +243,7 @@ struct weston_output { > enum weston_pointer_motion_mask { > WESTON_POINTER_MOTION_ABS = 1 << 0, > WESTON_POINTER_MOTION_REL = 1 << 1, > + WESTON_POINTER_MOTION_REL_UNACCEL = 1 << 2, > }; > > struct weston_pointer_motion_event { > @@ -251,6 +252,8 @@ struct weston_pointer_motion_event { > double y; > double dx; > double dy; > + double dx_unaccel; > + double dy_unaccel; > }; > > struct weston_pointer_grab; > diff --git a/src/libinput-device.c b/src/libinput-device.c > index 7cc6a35..f60d1e0 100644 > --- a/src/libinput-device.c > +++ b/src/libinput-device.c > @@ -87,11 +87,18 @@ handle_pointer_motion(struct libinput_device > *libinput_device, > struct evdev_device *device = > libinput_device_get_user_data(libinput_device); > struct weston_pointer_motion_event event = { 0 }; > + double dx_unaccel, dy_unaccel; > + > + dx_unaccel = libinput_event_pointer_get_dx_unaccelerated(pointer_event); > + dy_unaccel = libinput_event_pointer_get_dy_unaccelerated(pointer_event); > > event = (struct weston_pointer_motion_event) { > - .mask = WESTON_POINTER_MOTION_REL, > + .mask = WESTON_POINTER_MOTION_REL | > + WESTON_POINTER_MOTION_REL_UNACCEL, > .dx = libinput_event_pointer_get_dx(pointer_event), > .dy = libinput_event_pointer_get_dy(pointer_event), > + .dx_unaccel = dx_unaccel, > + .dy_unaccel = dy_unaccel, it'd probably be nicer to look at to add variables for dx/dy and have the libinput calls grouped together, but either way: Reviewed-by: Peter Hutterer Cheers, Peter > }; > > notify_motion(device->seat, > -- > 2.4.3 > > ___ > wayland-devel mailing list > wayland-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/wayland-devel > ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH weston v4 09/20] input: Keep per client pointer resources in their own structs
On Tue, Nov 17, 2015 at 06:10:55PM +0800, Jonas Ådahl wrote: > Keep all per client wl_pointer resources in a new struct called > 'weston_pointer_client'. When focus changes, instead of moving a list > of resources between different lists, just change the focused pointer > client. > > The intention with this is to make it easier to add wl_pointer > extensions that share the same focus as the corresponding wl_pointer. > > Signed-off-by: Jonas Ådahl Reviewed-by: Peter Hutterer Cheers, Peter > --- > desktop-shell/shell.c | 14 ++-- > src/compositor.h | 11 ++- > src/input.c | 187 > -- > 3 files changed, 170 insertions(+), 42 deletions(-) > > diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c > index ab5be7a..c6b1f5c 100644 > --- a/desktop-shell/shell.c > +++ b/desktop-shell/shell.c > @@ -3150,6 +3150,7 @@ popup_grab_motion(struct weston_pointer_grab *grab, > uint32_t time, > { > struct weston_pointer *pointer = grab->pointer; > struct wl_resource *resource; > + struct wl_list *resource_list; > wl_fixed_t x, y; > wl_fixed_t sx, sy; > > @@ -3161,7 +3162,11 @@ popup_grab_motion(struct weston_pointer_grab *grab, > uint32_t time, > > weston_pointer_move(pointer, event); > > - wl_resource_for_each(resource, &pointer->focus_resource_list) { > + if (!pointer->focus_client) > + return; > + > + resource_list = &pointer->focus_client->pointer_resources; > + wl_resource_for_each(resource, resource_list) { > weston_view_from_global_fixed(pointer->focus, > pointer->x, pointer->y, > &sx, &sy); > @@ -3179,10 +3184,11 @@ popup_grab_button(struct weston_pointer_grab *grab, > struct wl_display *display = shseat->seat->compositor->wl_display; > enum wl_pointer_button_state state = state_w; > uint32_t serial; > - struct wl_list *resource_list; > + struct wl_list *resource_list = NULL; > > - resource_list = &grab->pointer->focus_resource_list; > - if (!wl_list_empty(resource_list)) { > + if (grab->pointer->focus_client) > + resource_list = &grab->pointer->focus_client->pointer_resources; > + if (resource_list && !wl_list_empty(resource_list)) { > serial = wl_display_get_serial(display); > wl_resource_for_each(resource, resource_list) { > wl_pointer_send_button(resource, serial, > diff --git a/src/compositor.h b/src/compositor.h > index 3b1f63e..1f5d89b 100644 > --- a/src/compositor.h > +++ b/src/compositor.h > @@ -330,12 +330,19 @@ struct weston_data_source { > void (*cancel)(struct weston_data_source *source); > }; > > +struct weston_pointer_client { > + struct wl_list link; > + struct wl_client *client; > + struct wl_list pointer_resources; > +}; > + > struct weston_pointer { > struct weston_seat *seat; > > - struct wl_list resource_list; > - struct wl_list focus_resource_list; > + struct wl_list pointer_clients; > + > struct weston_view *focus; > + struct weston_pointer_client *focus_client; > uint32_t focus_serial; > struct wl_listener focus_view_listener; > struct wl_listener focus_resource_listener; > diff --git a/src/input.c b/src/input.c > index 3fd4dae..e9723fc 100644 > --- a/src/input.c > +++ b/src/input.c > @@ -45,6 +45,95 @@ empty_region(pixman_region32_t *region) > pixman_region32_init(region); > } > > +static struct weston_pointer_client * > +weston_pointer_client_create(struct wl_client *client) > +{ > + struct weston_pointer_client *pointer_client; > + > + pointer_client = zalloc(sizeof *pointer_client); > + if (!pointer_client) > + return NULL; > + > + pointer_client->client = client; > + wl_list_init(&pointer_client->pointer_resources); > + > + return pointer_client; > +} > + > +static void > +weston_pointer_client_destroy(struct weston_pointer_client *pointer_client) > +{ > + free(pointer_client); > +} > + > +static bool > +weston_pointer_client_is_empty(struct weston_pointer_client *pointer_client) > +{ > + return wl_list_empty(&pointer_client->pointer_resources); > +} > + > +static struct weston_pointer_client * > +weston_pointer_get_pointer_client(struct weston_pointer *pointer, > + struct wl_client *client) > +{ > + struct weston_pointer_client *pointer_client; > + > + wl_list_for_each(pointer_client, &pointer->pointer_clients, link) { > + if (pointer_client->client == client) > + return pointer_client; > + } > + > + return NULL; > +} > + > +static struct weston_pointer_client * > +weston_pointer_ensure_pointer_client(struct weston_pointer *pointer, > + struct wl_client *client) > +{ > + struct weston_pointer_client
Re: [PATCH weston v4 10/20] input: Provide microsecond timestamps in motion events
On Tue, Nov 17, 2015 at 06:10:56PM +0800, Jonas Ådahl wrote: > Provide timestamps with microsecond granularity if the backend can > provide it. Backends that can't should set it to 0. > > Signed-off-by: Jonas Ådahl Reviewed-by: Peter Hutterer > --- > src/compositor.h | 1 + > src/libinput-device.c | 3 +++ > 2 files changed, 4 insertions(+) > > diff --git a/src/compositor.h b/src/compositor.h > index 1f5d89b..bd0d134 100644 > --- a/src/compositor.h > +++ b/src/compositor.h > @@ -248,6 +248,7 @@ enum weston_pointer_motion_mask { > > struct weston_pointer_motion_event { > uint32_t mask; > + uint64_t time_usec; > double x; > double y; > double dx; > diff --git a/src/libinput-device.c b/src/libinput-device.c > index f60d1e0..918541c 100644 > --- a/src/libinput-device.c > +++ b/src/libinput-device.c > @@ -87,6 +87,8 @@ handle_pointer_motion(struct libinput_device > *libinput_device, > struct evdev_device *device = > libinput_device_get_user_data(libinput_device); > struct weston_pointer_motion_event event = { 0 }; > + uint64_t time_usec = > + libinput_event_pointer_get_time_usec(pointer_event); > double dx_unaccel, dy_unaccel; > > dx_unaccel = libinput_event_pointer_get_dx_unaccelerated(pointer_event); > @@ -95,6 +97,7 @@ handle_pointer_motion(struct libinput_device > *libinput_device, > event = (struct weston_pointer_motion_event) { > .mask = WESTON_POINTER_MOTION_REL | > WESTON_POINTER_MOTION_REL_UNACCEL, > + .time_usec = time_usec, > .dx = libinput_event_pointer_get_dx(pointer_event), > .dy = libinput_event_pointer_get_dy(pointer_event), > .dx_unaccel = dx_unaccel, > -- > 2.4.3 > > ___ > wayland-devel mailing list > wayland-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/wayland-devel > ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH weston v4 08/20] input: Don't send wl_pointer.motion if position didn't change
On Tue, Nov 17, 2015 at 06:10:54PM +0800, Jonas Ådahl wrote: > Signed-off-by: Jonas Ådahl Reviewed-by: Peter Hutterer Cheers, Peter > --- > src/input.c | 12 > 1 file changed, 8 insertions(+), 4 deletions(-) > > diff --git a/src/input.c b/src/input.c > index 0a567da..3fd4dae 100644 > --- a/src/input.c > +++ b/src/input.c > @@ -173,6 +173,8 @@ default_grab_pointer_motion(struct weston_pointer_grab > *grab, uint32_t time, > struct wl_list *resource_list; > struct wl_resource *resource; > wl_fixed_t x, y; > + wl_fixed_t old_sx = pointer->sx; > + wl_fixed_t old_sy = pointer->sy; > > if (pointer->focus) { > weston_pointer_motion_to_abs(pointer, event, &x, &y); > @@ -182,10 +184,12 @@ default_grab_pointer_motion(struct weston_pointer_grab > *grab, uint32_t time, > > weston_pointer_move(pointer, event); > > - resource_list = &pointer->focus_resource_list; > - wl_resource_for_each(resource, resource_list) { > - wl_pointer_send_motion(resource, time, > -pointer->sx, pointer->sy); > + if (old_sx != pointer->sx || old_sy != pointer->sy) { > + resource_list = &pointer->focus_resource_list; > + wl_resource_for_each(resource, resource_list) { > + wl_pointer_send_motion(resource, time, > +pointer->sx, pointer->sy); > + } > } > } > > -- > 2.4.3 > > ___ > wayland-devel mailing list > wayland-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/wayland-devel > ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH weston v4 01/20] input: Make pointer grab motion callbacks take an event struct
On Tue, Nov 17, 2015 at 06:10:47PM +0800, Jonas Ådahl wrote: > Instead of only passing absolute pointer coordinates, effectively > loosing motion event data, pass a struct that can potentially contain > different types of motion events, currently being absolute and relative. > > A helper function to get resulting absolute coordinates was added for > when previous callbacks simply used the (x, y) coordinates. > > Signed-off-by: Jonas Ådahl > --- Reviewed-by: Peter Hutterer Cheers, Peter > desktop-shell/exposay.c| 4 +-- > desktop-shell/shell.c | 22 + > ivi-shell/hmi-controller.c | 8 +++--- > src/compositor-x11.c | 9 ++- > src/compositor.h | 24 +++--- > src/data-device.c | 4 +-- > src/input.c| 61 > +- > src/libinput-device.c | 13 ++ > tests/weston-test.c| 11 ++--- > 9 files changed, 116 insertions(+), 40 deletions(-) > > diff --git a/desktop-shell/exposay.c b/desktop-shell/exposay.c > index eb4070e..8bd55fb 100644 > --- a/desktop-shell/exposay.c > +++ b/desktop-shell/exposay.c > @@ -348,12 +348,12 @@ exposay_focus(struct weston_pointer_grab *grab) > > static void > exposay_motion(struct weston_pointer_grab *grab, uint32_t time, > -wl_fixed_t x, wl_fixed_t y) > +struct weston_pointer_motion_event *event) > { > struct desktop_shell *shell = > container_of(grab, struct desktop_shell, exposay.grab_ptr); > > - weston_pointer_move(grab->pointer, x, y); > + weston_pointer_move(grab->pointer, event); > > exposay_pick(shell, >wl_fixed_to_int(grab->pointer->x), > diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c > index 00c3260..d58a830 100644 > --- a/desktop-shell/shell.c > +++ b/desktop-shell/shell.c > @@ -1632,14 +1632,14 @@ constrain_position(struct weston_move_grab *move, int > *cx, int *cy) > > static void > move_grab_motion(struct weston_pointer_grab *grab, uint32_t time, > - wl_fixed_t x, wl_fixed_t y) > + struct weston_pointer_motion_event *event) > { > struct weston_move_grab *move = (struct weston_move_grab *) grab; > struct weston_pointer *pointer = grab->pointer; > struct shell_surface *shsurf = move->base.shsurf; > int cx, cy; > > - weston_pointer_move(pointer, x, y); > + weston_pointer_move(pointer, event); > if (!shsurf) > return; > > @@ -1758,7 +1758,7 @@ struct weston_resize_grab { > > static void > resize_grab_motion(struct weston_pointer_grab *grab, uint32_t time, > -wl_fixed_t x, wl_fixed_t y) > +struct weston_pointer_motion_event *event) > { > struct weston_resize_grab *resize = (struct weston_resize_grab *) grab; > struct weston_pointer *pointer = grab->pointer; > @@ -1767,7 +1767,7 @@ resize_grab_motion(struct weston_pointer_grab *grab, > uint32_t time, > wl_fixed_t from_x, from_y; > wl_fixed_t to_x, to_y; > > - weston_pointer_move(pointer, x, y); > + weston_pointer_move(pointer, event); > > if (!shsurf) > return; > @@ -1973,9 +1973,9 @@ busy_cursor_grab_focus(struct weston_pointer_grab *base) > > static void > busy_cursor_grab_motion(struct weston_pointer_grab *grab, uint32_t time, > - wl_fixed_t x, wl_fixed_t y) > + struct weston_pointer_motion_event *event) > { > - weston_pointer_move(grab->pointer, x, y); > + weston_pointer_move(grab->pointer, event); > } > > static void > @@ -3141,18 +3141,20 @@ popup_grab_focus(struct weston_pointer_grab *grab) > > static void > popup_grab_motion(struct weston_pointer_grab *grab, uint32_t time, > - wl_fixed_t x, wl_fixed_t y) > + struct weston_pointer_motion_event *event) > { > struct weston_pointer *pointer = grab->pointer; > struct wl_resource *resource; > + wl_fixed_t x, y; > wl_fixed_t sx, sy; > > if (pointer->focus) { > + weston_pointer_motion_to_abs(pointer, event, &x, &y); > weston_view_from_global_fixed(pointer->focus, x, y, > &pointer->sx, &pointer->sy); > } > > - weston_pointer_move(pointer, x, y); > + weston_pointer_move(pointer, event); > > wl_resource_for_each(resource, &pointer->focus_resource_list) { > weston_view_from_global_fixed(pointer->focus, > @@ -4812,7 +4814,7 @@ terminate_binding(struct weston_keyboard *keyboard, > uint32_t time, > > static void > rotate_grab_motion(struct weston_pointer_grab *grab, uint32_t time, > -wl_fixed_t x, wl_fixed_t y) > +struct weston_pointer_motion_event *event) > { > struct rotate_grab *rotate = > container_of(grab, struct rotate_grab, base.grab); > @@ -4820,7 +4822,7 @@ rotate
Re: [PATCH weston v4 06/20] compositor: Keep track of what views were activated by clicking
On Tue, Nov 17, 2015 at 06:10:52PM +0800, Jonas Ådahl wrote: > Adds a weston_view_activate() that can be passed an additional active > flag WESTON_ACTIVATE_CLICKED, that the shell passes when a view was > activated by clicking. > > This allows shell independent components implement heuristics depending typo: shell-independent 02-06 are Acked-by: Peter Hutterer one comment at the bottom of this email: > on how a view was activated. > > Signed-off-by: Jonas Ådahl > --- > desktop-shell/shell.c | 3 ++- > src/compositor.c | 2 ++ > src/compositor.h | 11 +++ > src/input.c | 30 ++ > 4 files changed, 45 insertions(+), 1 deletion(-) > > diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c > index 3b34529..ab5be7a 100644 > --- a/desktop-shell/shell.c > +++ b/desktop-shell/shell.c > @@ -5055,7 +5055,7 @@ activate(struct desktop_shell *shell, struct > weston_view *view, >* Leave fullscreen surfaces on unrelated outputs alone. */ > lower_fullscreen_layer(shell, shsurf->output); > > - weston_surface_activate(es, seat); > + weston_view_activate(view, seat, flags); > > state = ensure_focus_state(shell, seat); > if (state == NULL) > @@ -5130,6 +5130,7 @@ click_to_activate_binding(struct weston_pointer > *pointer, uint32_t time, > return; > > activate_binding(pointer->seat, data, pointer->focus, > + WESTON_ACTIVATE_FLAG_CLICKED | >WESTON_ACTIVATE_FLAG_CONFIGURE); > } > > diff --git a/src/compositor.c b/src/compositor.c > index f8437e8..6f8d769 100644 > --- a/src/compositor.c > +++ b/src/compositor.c > @@ -4490,6 +4490,8 @@ weston_compositor_create(struct wl_display *display, > void *user_data) > ec->output_id_pool = 0; > ec->repaint_msec = DEFAULT_REPAINT_WINDOW; > > + ec->activate_serial = 1; > + > if (!wl_global_create(ec->wl_display, &wl_compositor_interface, 3, > ec, compositor_bind)) > goto fail; > diff --git a/src/compositor.h b/src/compositor.h > index d1f7b04..032c637 100644 > --- a/src/compositor.h > +++ b/src/compositor.h > @@ -750,6 +750,8 @@ struct weston_compositor { > clockid_t presentation_clock; > int32_t repaint_msec; > > + unsigned int activate_serial; > + > int exit_code; > > void *user_data; > @@ -848,6 +850,8 @@ struct weston_view { > /* For weston_layer inheritance from another view */ > struct weston_view *parent_view; > > + unsigned int click_to_activate_serial; > + > pixman_region32_t clip; /* See weston_view_damage_below() */ > float alpha; /* part of geometry, see below */ > > @@ -1067,6 +1071,7 @@ enum weston_key_state_update { > enum weston_activate_flag { > WESTON_ACTIVATE_FLAG_NONE = 0, > WESTON_ACTIVATE_FLAG_CONFIGURE = 1 << 0, > + WESTON_ACTIVATE_FLAG_CLICKED = 1 << 1, > }; > > void > @@ -1123,6 +1128,12 @@ weston_spring_done(struct weston_spring *spring); > void > weston_surface_activate(struct weston_surface *surface, > struct weston_seat *seat); > + > +void > +weston_view_activate(struct weston_view *view, > + struct weston_seat *seat, > + enum weston_activate_flag flags); > + > void > notify_motion(struct weston_seat *seat, uint32_t time, > struct weston_pointer_motion_event *event); > diff --git a/src/input.c b/src/input.c > index 53e84a0..0a567da 100644 > --- a/src/input.c > +++ b/src/input.c > @@ -1102,6 +1102,20 @@ notify_motion_absolute(struct weston_seat *seat, > pointer->grab->interface->motion(pointer->grab, time, &event); > } > > +static unsigned int > +peek_next_activate_serial(struct weston_compositor *c) > +{ > + unsigned serial = c->activate_serial + 1; > + > + return serial == 0 ? 1 : serial; > +} > + > +static void > +inc_activate_serial(struct weston_compositor *c) > +{ > + c->activate_serial = peek_next_activate_serial (c); > +} > + > WL_EXPORT void > weston_surface_activate(struct weston_surface *surface, > struct weston_seat *seat) > @@ -1109,6 +1123,8 @@ weston_surface_activate(struct weston_surface *surface, > struct weston_compositor *compositor = seat->compositor; > struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); > > + inc_activate_serial(compositor); > + > if (keyboard) { > weston_keyboard_set_focus(keyboard, surface); > wl_data_device_set_keyboard_focus(seat); > @@ -1118,6 +1134,20 @@ weston_surface_activate(struct weston_surface *surface, > } > > WL_EXPORT void > +weston_view_activate(struct weston_view *view, > + struct weston_seat *seat, > + uint32_t flags) > +{ > + struct weston_compositor *compositor = seat->compositor; > + > + if (flags & WESTON_ACTIVATE_FLAG_CLICKED)
Re: [PATCH wayland v2] protocol: Add wl_surface.damage_buffer
I am certainly not against these changes .. +1 for the effort ;) However, I would like to know (and possible others would also), what does this mean for toolkits ?? Aside from bumping compositor and surface versions, what sort of changes (short version please) should we look at implementing to facilitate this ?? Is this going to be a separate surface request ? What happens if we continue using "current implementation" ?? Please understand, I am all FOR these changes as it makes sense to have this work with EGL :) .. I am more asking out of curiosity (wrt: what does this mean for "us" as toolkit developers) Cheers, Chris On 11/18/2015 05:17 PM, Derek Foreman wrote: wl_surface.damage uses surface local co-ordinates. Buffer scale and buffer transforms came along, and EGL surfaces have no understanding of them. Theoretically, clients pass damage rectangles - in Y-inverted surface co-ordinates) to EGLSwapBuffersWithDamage, and the EGL implementation passed them on to wayland. However, for this to work the EGL implementation must be able to flip those rectangles into the space the compositor is expecting, but it's unable to do so because it doesn't know the height of the transformed buffer. So, currently, EGLSwapBuffersWithDamage is unusable and EGLSwapBuffers has to pass (0,0) - (INT32_MAX, INT32_MAX) damage to function. wl_surface.damage_buffer allows damage to be registered on a surface in buffer co-ordinates, avoiding this problem. Credit where it's due, these ideas are not entirely my own: Over a year ago the idea of changing damage co-ordinates to buffer co-ordinates was suggested (by Jason Ekstrand), and it was at least partially rejected and abandoned. At the time it was also suggested (by Pekka Paalanen) that adding a new wl_surface.damage_buffer request was another option. This will eventually resolve: https://bugs.freedesktop.org/show_bug.cgi?id=78190 by making the problem irrelevant. Signed-off-by: Derek Foreman --- Differnces from v1: - Don't make such a big deal about GL in the request documentation - rename the request about 3 times, eventually settle on damage_buffer - don't say anything about mixing damage and damage_buffer protocol/wayland.xml | 44 ++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/protocol/wayland.xml b/protocol/wayland.xml index 9c22d45..7665307 100644 --- a/protocol/wayland.xml +++ b/protocol/wayland.xml @@ -176,7 +176,7 @@ - + A compositor. This object is a singleton global. The compositor is in charge of combining the contents of multiple @@ -986,7 +986,7 @@ - + A surface is a rectangular area that is displayed on the screen. It has a location, size and pixel contents. @@ -,6 +,10 @@ wl_surface.commit assigns pending damage as the current damage, and clears pending damage. The server will clear the current damage as it repaints the surface. + + Alternatively, damage can be posted with wl_surface.damage_buffer + which uses buffer co-ordinates instead of surface co-ordinates, + and is probably the preferred and intuitive way of doing this. @@ -1327,6 +1331,42 @@ + + + + + This request is used to describe the regions where the pending + buffer is different from the current surface contents, and where + the surface therefore needs to be repainted. The pending buffer + must be set by wl_surface.attach before sending damage. The + compositor ignores the parts of the damage that fall outside of + the surface. + + Damage is double-buffered state, see wl_surface.commit. + + The damage rectangle is specified in buffer coordinates. + + The initial value for pending damage is empty: no damage. + wl_surface.damage adds pending damage: the new pending damage + is the union of old pending damage and the given rectangle. + + wl_surface.commit assigns pending damage as the current damage, + and clears pending damage. The server will clear the current + damage as it repaints the surface. + + This request differs from wl_surface.damage in only one way - it + takes damage in buffer co-ordinates instead of surface local + co-ordinates. While this generally is more intuitive than surface + co-ordinates, it is especially desirable when using wl_viewport + or when a drawing library (like EGL) is unaware of buffer scale + and buffer transform. + + + + + + + ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH weston v4 12/20] Implement pointer locking and confinement
On Tue, Nov 17, 2015 at 06:10:58PM +0800, Jonas Ådahl wrote: > This patch implements the wp_pointer_constraints protocol used for > locking or confining a pointer. It consists of a new global object with > two requests; one for locking the surface to a position, one for > confining the pointer to a given region. > > In this patch, only the locking part is fully implemented as in > specified in the protocol, while confinement is only implemented for > when the union of the passed region and the input region of the confined > surface is a single rectangle. > > Note that the pointer constraints protocol is still unstable and as > such has the unstable protocol naming conventions applied. > > Signed-off-by: Jonas Ådahl > --- > > Changes since v3: > > Uses the XML file from wayland-protocols. > > Updated implementation given interface renaming. > > Updated implementation given protocol changes (see protocol patch). > > > Makefile.am | 4 +- > src/compositor.c | 11 + > src/compositor.h | 41 +++ > src/input.c | 794 > -- > xwayland/window-manager.c | 3 +- > 5 files changed, 829 insertions(+), 24 deletions(-) > > diff --git a/Makefile.am b/Makefile.am > index 08a3444..a640d74 100644 > --- a/Makefile.am > +++ b/Makefile.am > @@ -128,7 +128,9 @@ nodist_weston_SOURCES = > \ > protocol/linux-dmabuf-unstable-v1-protocol.c\ > protocol/linux-dmabuf-unstable-v1-server-protocol.h \ > protocol/relative-pointer-unstable-v1-protocol.c\ > - protocol/relative-pointer-unstable-v1-server-protocol.h > + protocol/relative-pointer-unstable-v1-server-protocol.h \ > + protocol/pointer-constraints-unstable-v1-protocol.c \ > + protocol/pointer-constraints-unstable-v1-server-protocol.h > > BUILT_SOURCES += $(nodist_weston_SOURCES) > > diff --git a/src/compositor.c b/src/compositor.c > index 12bd18e..23f54de 100644 > --- a/src/compositor.c > +++ b/src/compositor.c > @@ -584,6 +584,7 @@ weston_surface_create(struct weston_compositor > *compositor) > return NULL; > > wl_signal_init(&surface->destroy_signal); > + wl_signal_init(&surface->commit_signal); > > surface->compositor = compositor; > surface->ref_count = 1; > @@ -610,6 +611,8 @@ weston_surface_create(struct weston_compositor > *compositor) > weston_matrix_init(&surface->buffer_to_surface_matrix); > weston_matrix_init(&surface->surface_to_buffer_matrix); > > + wl_list_init(&surface->pointer_constraints); > + > return surface; > } > > @@ -1820,6 +1823,7 @@ weston_surface_destroy(struct weston_surface *surface) > { > struct weston_frame_callback *cb, *next; > struct weston_view *ev, *nv; > + struct weston_pointer_constraint *constraint, *next_constraint; > > if (--surface->ref_count > 0) > return; > @@ -1847,6 +1851,11 @@ weston_surface_destroy(struct weston_surface *surface) > > weston_presentation_feedback_discard_list(&surface->feedback_list); > > + wl_list_for_each_safe(constraint, next_constraint, > + &surface->pointer_constraints, > + link) > + weston_pointer_constraint_destroy(constraint); > + > free(surface); > } > > @@ -2761,6 +2770,8 @@ weston_surface_commit_state(struct weston_surface > *surface, > wl_list_insert_list(&surface->feedback_list, > &state->feedback_list); > wl_list_init(&state->feedback_list); > + > + wl_signal_emit(&surface->commit_signal, surface); > } > > static void > diff --git a/src/compositor.h b/src/compositor.h > index 46a4d1f..4b27197 100644 > --- a/src/compositor.h > +++ b/src/compositor.h > @@ -58,6 +58,7 @@ struct weston_output; > struct input_method; > struct weston_pointer; > struct linux_dmabuf_buffer; > +struct weston_pointer_constraint; > > enum weston_keyboard_modifier { > MODIFIER_CTRL = (1 << 0), > @@ -350,6 +351,7 @@ struct weston_pointer { > struct wl_listener focus_resource_listener; > struct wl_signal focus_signal; > struct wl_signal motion_signal; > + struct wl_signal destroy_signal; > > struct weston_view *sprite; > struct wl_listener sprite_destroy_listener; > @@ -424,6 +426,9 @@ void > weston_pointer_set_default_grab(struct weston_pointer *pointer, > const struct weston_pointer_grab_interface *interface); > > +void > +weston_pointer_constraint_destroy(struct weston_pointer_constraint > *constraint); > + > struct weston_keyboard * > weston_keyboard_create(void); > void > @@ -764,6 +769,8 @@ struct weston_compositor { > > unsigned int activate_serial; > > + struct wl_global *pointer_constraints; > + > int exit_code; > > void *user_data; > @@ -961,10 +968,41 @@ struct we
Re: [PATCH wayland] protocol: Remove incorrect statement that attach must precede damage
On Wed, Nov 18, 2015 at 09:44:11AM -0600, Derek Foreman wrote: > The documentation for wl_surface.commit makes it clear that the > application of damage follows attach during the commit, so it > doesn't matter what order the app sends the requests. > > Many existing apps post damage before attaching a buffer already, > and it's really quite reasonable to do so. > > Signed-off-by: Derek Foreman Yes, the documentation of commit seems to kind of contradict what you removed here. While it can't hurt to mention that the damage affects either the buffer attached within the same commit or the already attached buffer, if no new buffer was attached, it is already spelled out pretty clearly in wl_surface.commit, so consider this patch Reviewed-by: Jonas Ådahl Jonas > --- > protocol/wayland.xml | 6 ++ > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/protocol/wayland.xml b/protocol/wayland.xml > index 9c22d45..525e092 100644 > --- a/protocol/wayland.xml > +++ b/protocol/wayland.xml > @@ -1095,10 +1095,8 @@ > > This request is used to describe the regions where the pending > buffer is different from the current surface contents, and where > - the surface therefore needs to be repainted. The pending buffer > - must be set by wl_surface.attach before sending damage. The > - compositor ignores the parts of the damage that fall outside of > - the surface. > + the surface therefore needs to be repainted. The compositor > + ignores the parts of the damage that fall outside of the surface. > > Damage is double-buffered state, see wl_surface.commit. > > -- > 2.6.2 > > ___ > wayland-devel mailing list > wayland-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/wayland-devel ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH weston] releasing.txt: Add step about checking wayland-protocols dependency
On Wed, Nov 18, 2015 at 10:45:28AM +0800, Jonas Ådahl wrote: > Signed-off-by: Jonas Ådahl > Cc: Bryce Harrington > --- > > Hi Bryce, > > Last time you asked about something like this, but it slipped my mind. Is this > enough of a reminder or should it be more descriptive? Thanks, yeah that'll do. It does leave the question of how to do the determination, and the question of how to handle getting a release of wayland-protocols but that can get sorted out in time I guess. This is enough to make sure we don't forget to look into that. Bryce > Jonas > > > releasing.txt | 20 > 1 file changed, 12 insertions(+), 8 deletions(-) > > diff --git a/releasing.txt b/releasing.txt > index 52adaa3..fe6aa59 100644 > --- a/releasing.txt > +++ b/releasing.txt > @@ -5,7 +5,11 @@ To make a release of Weston and/or Wayland, follow these > steps. > >$ make check > > - 1. Update the first three lines of configure.ac to the intended > + 1. Verify that the wayland-protocols version dependency is correct, > + and that wayland-protocols has had a release with any needed > + protocol updates. > + > + 2. Update the first three lines of configure.ac to the intended >version, commit. Also note that Weston includes versioned >dependencies on 'wayland-server' and 'wayland-client' in >configure.ac which occasionally need updated as well. Then commit > @@ -17,7 +21,7 @@ To make a release of Weston and/or Wayland, follow these > steps. >$ git commit configure.ac -m "configure.ac: bump to version > $RELEASE_NUMBER for the $RELEASE_NAME release" >$ git push > > - 2. For Weston releases, install Xwayland, either from your distro or > + 3. For Weston releases, install Xwayland, either from your distro or >manually (see http://wayland.freedesktop.org/building.html). If >you install it to a location other than /usr/bin/Xwayland, specify >this in the following env var: > @@ -33,7 +37,7 @@ To make a release of Weston and/or Wayland, follow these > steps. >export LD_LIBRARY_PATH=$WLD/lib >export PKG_CONFIG_PATH=$WLD/lib/pkgconfig:$WLD/share/pkgconfig/ > > - 3. Run the release.sh script to generate the tarballs, sign and > + 4. Run the release.sh script to generate the tarballs, sign and >upload them, and generate a release announcement template. >This script can be obtained from X.org's modular package: > > @@ -53,19 +57,19 @@ To make a release of Weston and/or Wayland, follow these > steps. >$ ./publish-doc > > > - 4. Compose the release announcements. The script will generate > + 5. Compose the release announcements. The script will generate >*.x.y.0.announce files with a list of changes and tags, one for >wayland, one for weston. Prepend these with a human-readable >listing of the most notable changes. For x.y.0 releases, indicate >the schedule for the x.y+1.0 release. > > - 5. pgp sign the the release announcements and send them to > + 6. pgp sign the the release announcements and send them to >wayland-devel@lists.freedesktop.org > > - 6. Get your freshly posted release email URL from > + 7. Get your freshly posted release email URL from >http://lists.freedesktop.org/archives/wayland-devel/ > > - 7. Update releases.html in wayland-web with links to tarballs and > + 8. Update releases.html in wayland-web with links to tarballs and >the release email URL. > >The register_release script in wayland-web will generate an HTML > @@ -79,7 +83,7 @@ To make a release of Weston and/or Wayland, follow these > steps. >$ git push >$ ./deploy > > - 8. Update topic in #wayland to point to the release announcement URL > + 9. Update topic in #wayland to point to the release announcement URL > > For x.y.0 releases, also create the release series x.y branch. The x.y > branch is for bug fixes and conservative changes to the x.y.0 release, > -- > 2.4.3 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH wayland 2/2] scanner: drop altmacro from dtddata.S
On Thu, 19 Nov 2015 08:10:14 +1000 Peter Hutterer wrote: > On Wed, Nov 18, 2015 at 01:07:37PM +0200, Pekka Paalanen wrote: > > From: Pekka Paalanen > > > > Stop using .altmacro in dtddata.S, because clang does not yet implement > > it. Turns out that we do not actually seem to need it, and we can modify > > the syntax to work without it. > > > > Moving the double quotes from the binfile line to the .incbin line is > > required to avoid the assembler error "missing string". Instead of & we > > now use \() to mark the end of macro argument name. > > > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92988 > > > > Signed-off-by: Pekka Paalanen > > Acked-by: Peter Hutterer Both pushed: f66e2d5..b644594 master -> master Thanks, pq signature.asc Description: PGP signature ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel