Commit Graph

1532 Commits

Author SHA1 Message Date
Peter Hutterer
f34cab2946 doc: reduce chunk_section_depth to 0
One html page per chapter.
2014-07-06 12:39:16 +03:00
Boyan Ding
113aac5afb connection: remove unreached code 2014-06-18 17:13:31 -07:00
Silvan Jegen
1a6fd1621e protocol: remove redundant 'the' in description
Signed-off-by: Silvan Jegen <s.jegen@gmail.com>
2014-06-18 16:09:49 -07:00
Jonny Lamb
0dd019925b protocol: add wl_surface errors enum for bad scale and transform values 2014-06-03 09:59:35 +03:00
Kristian Høgsberg
3de6a1de3f configure.ac: Bump configure.ac version to 1.5.90 on master 2014-05-28 10:11:55 -07:00
Kristian Høgsberg
3ac62cd6b6 configure.ac: Bump version to 1.5.0 2014-05-19 16:24:00 -07:00
Kristian Høgsberg
8511544e6b scanner: Downgrade non-increasing version error to warning
Commit 99a72777f9 introduced a new error
for when the 'since' version decreases.  It also reset the version for
messages without a version to 1.  Versioning semantics in the spec files
was a little under-specified and we don't want to break projects caught in
this grey zone.

This commits replaces previous configure.ac as the 1.4.93 tag and the
final 1.5 RC.
2014-05-12 15:35:04 -07:00
Kristian Høgsberg
bad885170f configure.ac: Bump version 1.4.93
This is the last RC before 1.5.
2014-05-12 12:54:13 -07:00
Thierry Reding
6b27878559 Do not distribute generated headers
The wayland-server-protocol.h and wayland-client-protocol.h headers are
currently being shipped in tarballs created using make dist. This causes
out-of-tree builds to fail since make will detect that the headers exist
by looking at the source directory (via VPATH) and not regenerate them.
But as opposed to ${top_builddir}/protocol, ${top_srcdir}/protocol is
not part of the include path and therefore the shipped files can't be
found during compilation.

Two solutions exist to this problem: 1) add ${top_srcdir}/protocol to
the include path to allow shipped files to be used if available or 2)
don't ship these generated files in release tarballs. The latter seems
the most appropriate. wayland-scanner is already a prerequisite in order
to generate wayland-protocol.c, so it is either built as part of the
package or provided externally. Generating all files from the protocol
definition at build time also ensures that they don't get out of sync.

Both of the generated headers are already listed in Makefile.am as
nodist_*_SOURCES, but at the same time they appear in include_HEADERS,
which will cause them to be added to the list of distributable files
after all. To prevent that, split them off into nodist_include_HEADERS.

Note that this problem will be hidden if a previous version of wayland
has been installed, since these files will exist in /usr/include and be
included from there. So this build error will only show for out-of-tree
builds on systems that don't have wayland installed yet.

Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-05-12 10:55:01 -07:00
Boyan Ding
3e007aef2f doc: Remove obsolete doxygen tags 2014-05-12 10:15:07 -07:00
Jonas Ådahl
35be5a7c65 scanner: Generate macros for getting the 'since' version of an event
This could be useful for compositors who need to be able to not send
events if the client bound a version lower than the newest provided.

Event version numbers are exposed as
[INTERFACE_NAME]_[EVENT_NAME]_SINCE_VERSION for example wl_output.scale
will have the version macro WL_OUTPUT_SCALE_SINCE_VERSION.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2014-05-09 14:33:20 -07:00
Jonas Ådahl
e2b1218422 tests: Add message version sanity test
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2014-05-09 14:32:04 -07:00
Jonas Ådahl
99a72777f9 scanner: Also fail when an implicitly versioned message is out of order
Fail if a message with version implicitly set to 1 (i.e. not specified)
comes after a message with since-version > 1.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2014-05-09 14:31:28 -07:00
Jonas Ådahl
3ed76204a9 protocol: Fix order of wl_pointer, wl_keyboard and wl_touch messages
The "release" message of wl_pointer, wl_keyboard and wl_touch introduced
in version 3 was placed first in the respective interface XML element,
causing wayland-scanner to misbehave and set the version number of the
"release" message to all subsequent messages with no explicitly specified
"since" version.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2014-05-09 14:30:14 -07:00
Jonas Ådahl
6b66034268 doc: Remove deprecated doxygen tag
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2014-05-09 14:29:36 -07:00
Jonas Ådahl
591f5ee3b1 event-loop-test: Remove unused variable
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2014-05-09 14:29:27 -07:00
Srivardhan Hebbar
cde83a24b3 doc: Added API documentation for wl_display_create function.
Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>
2014-05-09 12:44:32 -07:00
U. Artie Eoff
0f23b73a06 server: fix potential memleak and NULL deref
If for some reason that errno is neither value (ENOMEM or
EINVAL), then prior to this patch, there would be a NULL
deref in wl_closure_lookup(...) at the "else if" conditional
when closure == NULL. Also, closure might not be NULL but still
fall into the block due to the wl_closure_lookup < 0 condition...
in that case, we need to destroy the closure to avoid a memory
leak.

Currently, wl_connection_demarshal only sets errno to ENOMEM
or EINVAL... we've already checked for ENOMEM so remove check
for EINVAL (just assume it).  Also, call wl_closure_destroy(...)
unconditionally in the "else if" block (assume it can handle
NULL closure, too, which it does right now).

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2014-05-06 15:00:31 -07:00
U. Artie Eoff
b41ded812d connection-test: check malloc result
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2014-05-06 14:59:33 -07:00
U. Artie Eoff
7a17b05187 scanner: check wl_array_add result
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2014-05-06 14:57:35 -07:00
Kristian Høgsberg
4a4523fa92 configure.ac: Bump version to 1.4.92 2014-05-01 13:44:09 -07:00
Kristian Høgsberg
88f3bd84c8 Avoid printing to stderr
Use wl_log in the last few places where we print to stderr.  Remove
logging in a couple of places where we properly return an error code.

https://bugs.freedesktop.org/show_bug.cgi?id=73339
2014-04-30 12:18:52 -07:00
Andrew Wedgbury
3e962728bf Use non-blocking timerfd to prevent blocking when updating timer event sources
This implements a simple fix for the blocking problem that occurs when
updating a timer event source after the timer expires, but before its
callback is dispatched. This can happen when another event happens during the
same epoll wakeup as the timer event, and causes the read() call in
wl_event_source_timer_dispatch() to block for the updated duration of the
timer.

We never want this read() call to block, so I believe it makes sense for the
timerfd to be non-blocking, and we simply ignore the case where the read fails
with EAGAIN. We still report all other errors as before, and still ignore the
actual value read from the socket.

With this change, the event_loop_timer_updates unit test case I submitted
previously now passes, and weston appears to work as before.
2014-04-25 14:38:22 -07:00
Andrew Wedgbury
74df22befe test: Add test showing blocking problem when updating timers
I've noticed a blocking problem in Wayland's event-loop code when updating
timer event sources. The problem occurs if you update the timer at a point
after is has expired, but before it has been dispatched, i.e. from an event
callback that happens during the same epoll wakeup.

When the timer is subsequently dispatched, wl_event_source_timer_dispatch
blocks for the duration of the new timeout in its call to read() from the
timer fd (which is the expected behaviour according to the man page for
timerfd_settime).

This isn't too uncommon a scenario - for example, a socket with an associated
timeout timer. You'd typically want to update the timer when reading from the
socket. This is how I noticed the issue, since I was setting a timeout of
1 minute, and saw my server blocking for this duration!

The following patch adds a (currently failing) test case to Wayland's
event-loop-test.c. It demonstrates the problem using two timers, which are
set to expire at the same time. The first timer to receive its expiry
callback updates the other timer with a much larger timeout, which then
causes the test to block for this timeout before calling the second timer's
callback.

As for a fix, I'm not so sure (which is why I thought I'd post the failing
test case first to show what I mean). I notice that it doesn't actually do
anything with the value read from the timerfd socket, which gives the number
of times the timer expired since the last read, or when the timer was last
updated (which blocks if the timer hasn't yet expired). I believe this value
should always read as 1 anyway, since we don't use periodic timers.

A simple fix would be to use the TFD_NONBLOCK option when creating the
timerfd, ensuring that the read call won't block. We'd then have to ignore
the case when the read returns EAGAIN.
2014-04-25 14:08:31 -07:00
Giulio Camuffo
5535757a40 connection: fix a format string typo in error message 2014-04-25 13:28:19 -07:00
Ander Conselvan de Oliveira
bfc93649cb connection: Don't write past the end of the connection buffer
If a message was too big to fit in the connection buffer, the code
in wl_buffer_put would just write past the end of it.

I haven't seen any real world use case that would trigger this bug, but
it was possible to trigger it by sending a long enough string to the
wl_data_source.offer request.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=69267
2014-04-21 14:51:42 -07:00
Kristian Høgsberg
5e2cfd2a0a configure.ac: Bump version to 1.4.91 2014-04-07 16:08:42 -07:00
Kristian Høgsberg
24cdbe3d69 shm: Disallow shrinking shm pools
Unused shm space will be automatically reclaimed if unused or can be
explicitly returned by using fallocate FALLOC_FL_PUNCH_HOLE.

https://bugs.freedesktop.org/show_bug.cgi?id=74632
2014-04-07 16:01:25 -07:00
Kristian Høgsberg
c1aa1291a1 scanner: Only output each forward declaration once
Just sort the types and only print unique type names.  We avoid using
the GCC pragma.
2014-04-03 15:58:06 -07:00
Kristian Høgsberg
00703ad2bc Add WL_PRINTF attribute and annotate wl_log_func_t 2014-04-03 14:18:45 -07:00
Rui Matos
2142c03a8b protocol: Document how clients are supposed to get the xkb keycode
This encodes what everyone is doing and avoids other implementers
having to guess.
2014-04-01 16:47:04 -07:00
Hardening
256324773f Add error handling for wl_cursors
This patch adds some error management in wayland cursors

Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
2014-04-01 16:47:04 -07:00
Kristian Høgsberg
051f3838de client: Delay EPIPE handling so we get a chance to handle error events 2014-03-26 13:28:27 -07:00
Jasper St. Pierre
1bf13ae918 server: Kill some unnecessary logs
In order to set a logging function all the time, the output we get
needs to be useful. Logging about trivial things like the socket
we're using and when clients disconnect doesn't realy help anyone.
2014-03-25 09:50:09 -07:00
Bryce W. Harrington
3adcf6f11b tests: Fix build of noinst fixed-benchmark test
Solves this build error:

  tests/fixed-benchmark.o: In function `benchmark':
  ./wayland/tests/fixed-benchmark.c:82: undefined reference to `clock_gettime'
  ./wayland/tests/fixed-benchmark.c:84: undefined reference to `clock_gettime'

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2014-03-11 09:20:27 -07:00
Pekka Paalanen
2c319d341b protocol: try to clarify frame callback semantics
"the callback event will arrive after the next output refresh" is wrong,
if you interpret "output refresh" as framebuffer flip or the moment when
the new pixels turn into light the first time. Weston has probably never
worked this way.

Weston triggers the frame callbacks when it submits repainting commands
to the GPU, which is before the framebuffer flip.

Strike the incorrect claim, and the rest of the paragraph which no
longer offers useful information.

As a replacement, expand on the "throttling and driving animations"
characteristic. The main purpose is to let clients animate at the
display refresh rate, while avoiding drawing frames that will never be
presented.

The new claim is that the server should give some time between
triggering frame callbacks and repainting itself, for clients to draw
and commit. This is somewhat intimate with the repaint scheduling
algorithm a compositor uses, but hopefully the right intention.

Another point of this update is to imply, that frame callbacks should
not be used to count compositor repaint cycles nor monitor refresh
cycles. It has never been guaranteed to work. Removing the mention of
frame callback without an attach hopefully discourages such use.

v2: Don't just remove a paragraph, but add useful information about the
request's intent.

v3: Specify the order of posting frame callbacks.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Cc: Axel Davy <axel.davy@ens.fr>
Cc: Jason Ekstrand <jason@jlekstrand.net>
2014-03-11 09:09:55 -07:00
Pekka Paalanen
9cfffffe07 update .gitignore
Makes 'git status' clean again after a successful 'make distcheck'.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-03-10 13:11:09 -07:00
Pekka Paalanen
52a531b4df build: hide doxygen commands with AM_V_GEN
I suppose the purpose was to print just one GEN line for each doxygen
rule being executed, not print the doxygen command.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-03-10 13:11:02 -07:00
Pekka Paalanen
538ee6bed6 doc: do not rebuild man pages if they are up to date
The doxygen.man make target was not a real file that was generated,
therefore the man page rule was ran on every make invocation. Replace it
with a real file that is produced by the man page rule.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-03-10 13:10:28 -07:00
Pekka Paalanen
d533839735 build: depend on generated protocol headers
Fixes the build failure where the protocol headers were not generated at
all before compiling src/.libs/libwayland_server_la-wayland-server.o.

The failure was reproducable by starting fresh with 'git clean -dxf' and
not having any wayland headers installed system-wide.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-03-10 13:10:10 -07:00
Kristian Høgsberg
be75659ad1 build: Include protocol/ so we pick up generated headers 2014-03-07 16:02:19 -08:00
Kristian Høgsberg
1e716d6fcf build: Generated protocol files live in protocol/ now
Fix up the references in include_HEADERS.
2014-03-07 14:02:32 -08:00
Kristian Høgsberg
bb41c57446 build: Consolidate scanner build rules 2014-03-07 12:00:13 -08:00
Kristian Høgsberg
7ecb102409 build: Move tests/Makefile.am into toplevel Makefile.am 2014-03-07 12:00:06 -08:00
Kristian Høgsberg
4c163b9b00 build: Move src/Makefile.am into toplevel Makefile.am 2014-03-07 11:50:59 -08:00
Kristian Høgsberg
267b28887d build: Move cursor Makefile.am into toplevel Makefile.am 2014-03-06 23:15:02 -08:00
Kristian Høgsberg
bb5344ee6d build: Move protocol/ Makefile.am into toplevel Makefile.am
A small step towards non-recursive build system for wayland too.
2014-02-18 14:55:09 -08:00
Kristian Høgsberg
6292fe2af6 build: Stop using xmllint to validate protocol files
Same reason as commit cd31275f28b0a04d2ec5426dc81e875197b47e52 from weston:

    The scanner needs to be good enough.  If it crashes or fails to report
    invalid input, that needs to get fixed.
2014-02-18 14:52:02 -08:00
Jasper St. Pierre
52a77fca57 connection: Use wl_log to report errors
In some cases, like Xwayland, stdout and stderr are redirected to
/dev/null, losing us valuable information, while wl_log can be
overridden, allowing us to send it to a log file instead. This
can help debugging immensely.
2014-02-18 14:45:45 -08:00
Jasper St. Pierre
859b3e41f5 scanner: Add GCC pragmas to disable -Wredundant-decls
The code very intentionally emits a lot of redundant declarations
to simplify the scanner code. Somebody building with -Wredundant-decls
would have compile errors, so emit special pragmas to turn those
warnings off.

These pragmas should be ignored outside of gcc/clang.
2014-02-18 14:28:08 -08:00