summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-11-27libweston: Use struct timespec for motion eventsAlexandros Frantzis13-43/+79
Change code related to motion events to use struct timespec to represent time. This commit is part of a larger effort to transition the Weston codebase to struct timespec. Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-11-27libweston: Use struct timespec for the output presentation timestampAlexandros Frantzis3-8/+9
Store the output presentation timestamp as struct timespec. This commit is part of a larger effort to transition the Weston codebase to struct timespec. Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-11-27build,libweston: Use struct timespec for animationsAlexandros Frantzis8-38/+55
Change code related to animations to use struct timespec to represent time. This commit is part of a larger effort to transition the Weston codebase to struct timespec. Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> This bumps the libweston major version due to breakage in the animation ABI. The commits following this one break more ABI in other parts. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-11-27shared: Add helpers to convert between various time units and timespecAlexandros Frantzis2-0/+119
Add helper functions to make it easy and less error-prone to convert between values in various time units (nsec, usec, msec) and struct timespec. These helpers are going to be used in the upcoming commits to transition the Weston codebase to struct timespec. Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-11-27shared: Add timespec_is_zero helperAlexandros Frantzis2-0/+23
Add a helper function to check if a struct timespec is zero. This helper will be used in the upcoming commits to transition the Weston codebase to struct timespec. Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-11-24ivi-shell: Fix incorrect use of logical instead of bitwise operatorAlexandros Frantzis1-1/+1
Fix the code to use the correct bitwise AND operator '&', instead of the currently used logical AND operator '&&', to check the value of a bit flag in a bit mask. This problem was reported as a warning when building with clang. Reviewed-by: Emre Ucan <eucan@de.adit-jv.com>
2017-11-10buildsystem: add missing pkg-config stub for libweston uninstalledReynaldo H. Verdejo Pinochet3-0/+20
-uninstalled.pc files are a pkg-config facility for working with uninstalled libraries. With pkg-config, foo-uninstalled.pc overrides foo.pc. foo-uninstalled.pc should never be installed, and will be generated with references to the build directory. If you set up your environment so pkg-config looks for .pc files in your build directories, you can use this to build and link against libraries you haven't installed with "make install". This can save time and space over installing with a prefix. Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com> Acked-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
2017-10-24compositor-wayland: fix shm_buffer damage initPekka Paalanen1-3/+3
It appears that wayland_shm_buffer::damage is in the global coordinate space. Therefore initializing it to width x height at 0,0 is not correct for any output not positioned at 0,0. That is, all outputs after the first one get it wrong. Initialize it from the output region, which is in the global coordinate space. While at it, add a comment to note that damage is in global coordinate space. As I can see, this was the last confusion about it. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net> Acked-by: Daniel Stone <daniels@collabora.com>
2017-10-24compositor-wayland: fix damage coordinates with pixman rendererArmin Krezović1-1/+5
Damage coordinates are in global coordinate space, and they need to be translated to local coordinate space so multiple outputs can work. This path now matches the similar path in the X11 backend. This patch fixes the appearance of multiple windows in the parent compositor. Previously, all windows except the one with nested output position 0,0 would have their damage for the parent wl_surface always fall outside of the wl_surface, save the decorations which were handled separately. If the parent compositor was Weston/GL, this would lead to the output area remaining black as partial GL texture uploads would practically never update the texture. If the parent compositor was Weston/pixman, the parent windows would not update on screen unless something else caused the area to be repainted. [Pekka: adjusted commit message] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net> Acked-by: Daniel Stone <daniels@collabora.com>
2017-10-24compositor-wayland: clarify wl_display_connect() errorPekka Paalanen1-1/+4
Clarify the error message to explicitly say one was trying to connect to a parent Wayland compositor. This hopefully is a good enough hint on what using the wayland-backend is trying to do. Add the command line display option value and WAYLAND_DISPLAY values for good measure. WAYLAND_SOCKET is not shown as libwayland-client removes it. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net> Acked-by: Daniel Stone <daniels@collabora.com>
2017-10-24compositor-wayland: windowed/fullscreen not on fullscreen-shellPekka Paalanen1-7/+4
The set_windowed and set_fullscreen functions are only useful on a desktop shell, and never called on fullscreen-shell. Remove the confusing dead code, and ensure we notice if these functions get called in the wrong environment. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net> Acked-by: Daniel Stone <daniels@collabora.com>
2017-10-24compositor-wayland: allow to unset fullscreenPekka Paalanen1-1/+4
To be more symmetric with wayland_output_set_fullscreen(), implement the xdg-shell path in wayland_output_set_windowed(). This should make it possible to use the fullscreen key binding to toggle between a floating window and fullscreen also under xdg-shell. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net> Acked-by: Daniel Stone <daniels@collabora.com>
2017-10-24compositor-wayland: actually free parent_outputPekka Paalanen1-2/+5
I could not find anywhere where struct parent_output was freed, so apparently we were leaking it. Check against wayland_backend_register_output() and add the missing clean-up: removal from the parent output list, and free(). registry_handle_global_remove() also needs fixing to use a safer loop, because now we are actually removing the list item. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net> Acked-by: Daniel Stone <daniels@collabora.com>
2017-10-23compositor-wayland: fix mode_list corruption on --sprawlPekka Paalanen1-4/+8
The wayland-backend with --sprawl is one way to trigger wayland_output_create_for_parent_output(), which intends to find a mode from the parent mode list and use it. Calling wayland_output_set_size() initialized an embedded struct weston_mode and inserts that into the mode list. Then the assignment output->mode = *mode; corrupts the mode_list by overwriting the link entry. This leads to an endless loop in bind_output() in compositor.c. Fix this by manually doing the setup that wayland_output_set_size() did and do not call it. As a side effect, it now relays the parent compositor's physical output size to our own clients. It no longer smashes the refresh rate either. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net> Acked-by: Daniel Stone <daniels@collabora.com>
2017-10-23compositor-wayland: remove unused 'scale'Pekka Paalanen1-2/+0
This member is only ever set and never read, therefore it is dead. Delete dead code. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net> Acked-by: Daniel Stone <daniels@collabora.com>
2017-10-23compositor-wayland: avoid recursive dispatch with wl_outputsPekka Paalanen1-2/+28
Calling wl_display_roundtrip() from within a Wayland event handler means we will re-enter event dispatch, that is, it will lead to recursive dispatch. Even if libwayland-client was safe, this would lead to unexpected code paths: the first event handler function has not returned when other event handler functions may get called. In this particular case it maybe didn't hurt, but it's still a fragile pattern to use. Replace the wl_display_roundtrip() with a manual sync callback to do the work. This does not break the wayland-backend initialization sequence, because sprawl_across_outputs was set only after the roundtrip to ensure wl_registry globals have been received so the code would not have been hit anyway, and weston_backend_init() also has a second roundtrip that ensures the per wl_output events have been received before continuing. For wayland-backend output hotplug the change is insignificant because it will only delay the output creation a bit, and the parent outputs are not processed anywhere in between. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net> Acked-by: Daniel Stone <daniels@collabora.com>
2017-10-23weston: fix boolean wayland backend optionsPekka Paalanen1-6/+9
Surprisingly, WESTON_OPTION_BOOLEAN uses the type int32_t, not bool. Passing in a pointer bool does not end well. Fix this to pass in pointers as parse_options() expects. This fixes a bug where 'weston --use-pixman --sprawl' would work but 'weston --sprawl --use-pixman' would ignore the --sprawl option. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net> Acked-by: Daniel Stone <daniels@collabora.com>
2017-10-18libweston-desktop/xdg-shell-v6: Actually send same-as-current configure if ↵Quentin Glidic1-6/+25
needed If a surface is in state A, and we just sent a configure for state B, setting back state A would be ignored, because state B has not been committed yet. Now, we check against the latest configured state (which is current state if configure list is empty). Reported on wlroots https://github.com/swaywm/wlroots/pull/280 Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net> Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2017-10-13compositor-wayland: Don't use two different presentation methods for fs shellArmin Krezović1-39/+51
This patch fixes the wayland backend to not use two different presentation methods when running on fullscreen-shell. See also: https://patchwork.freedesktop.org/patch/114534/ v2: - Add missing wayland_output_resize_surface() call - Start repaint loop after initial frame has been drawn v3: - Redraw the initial frame if present for mode fails Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93514 Signed-off-by: Armin Krezović <krezovic.armin@gmail.com> Tested-by: nerdopolis <bluescreen_avenger@verizon.net> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-10-13compositor-wayland: destroy the appropriate output instead of exiting when ↵Sergi Granell1-1/+5
receiving an xdg_toplevel::close event v2: Fix use after free spotted by Daniel Stone Signed-off-by: Sergi Granell <xerpi.g.12@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-10-13compositor-wayland: use input region instead of opaque region to ↵Sergi Granell1-6/+6
zxdg_shell_v6::set_window_geometry The opaque region is a few pixels off due to the rounded corners of the frame decorations, and, therefore, the input region matches the window's geometry more closely. Signed-off-by: Sergi Granell <xerpi.g.12@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-10-04compositor-drm: Allow disabling universal planesDaniel Stone1-2/+4
Add a test environment variable to allow disabling universal planes. Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-10-04gl-renderer: Ignore INVALID modifierDaniel Stone1-3/+12
If the user has passed an INVALID modifier, it's because there is no applicable modifier, and the buffer layout should be determined by a magic side-channel call (e.g. bo_get_tiling). If the modifier is INVALID, don't try to pass it through to EGL, but just drop it. On the other hand, if a modifier _is_ explicitly specified and we don't have the modifiers extension, then refuse to import the buffer. Signed-off-by: Daniel Stone <daniels@collabora.com>
2017-10-04compositor-fbdev: fix finish_frame_timer leakPekka Paalanen1-0/+3
The timer was never removed anywhere. Remove it in disable() to match what happens in enable(). Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Ian Ray <ian.ray@ge.com> Acked-by Daniel Stone <daniels@collabora.com>
2017-10-04compositor-fbdev: rename fbdev_output_disable_handler()Pekka Paalanen1-3/+3
This is a more logical name for the function, matching the pattern used in other backends and the hook names. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Ian Ray <ian.ray@ge.com> Acked-by Daniel Stone <daniels@collabora.com>
2017-10-04compositor-fbdev: always destroy renderer-output on disablePekka Paalanen1-3/+1
If we pass the base->enabled test, then the renderer output is guaranteed to be there, so we can just destroy it. Destroying it before unmap makes the sequence match better the enable path. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Ian Ray <ian.ray@ge.com> Acked-by Daniel Stone <daniels@collabora.com>
2017-10-04compositor-fbdev: simplify FB destroy/unmap/disablePekka Paalanen1-31/+21
Rename fbdev_frame_buffer_destroy() to fbdev_frame_buffer_unmap() because that is what it does. Adding the destruction of hw_surface in it makes it the perfect counterpart to fbdev_frame_buffer_map() which simplifies the code. fbdev_frame_buffer_map() can no longer call that, so just open-code the munmap() there. It is an error path, we don't really care about failures in an error path. The error path of fbdev_output_enable() is converted to call buffer_unmap() since that is exactly what it did. fbdev_output_disable() became redundant, being identical to fbdev_frame_buffer_unmap(). Invariant: output->hw_surface cannot be non-NULL without output->fb being non-NULL. hw_surface wraps the mmapped memory so cannot exist without the mmap. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Ian Ray <ian.ray@ge.com> Acked-by Daniel Stone <daniels@collabora.com>
2017-10-04compositor-fbdev: remove unused output argumentsPekka Paalanen1-13/+9
A few functions had argument 'output' which was not used at all. Remove such unused arguments. The coming migration to the head-based output API would have made it awkward to come up with the output argument for these, but luckily they are not actually needed. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Sergi Granell <xerpi.g.12@gmail.com> Acked-by Daniel Stone <daniels@collabora.com>
2017-10-04libweston: set backend pointer earlierPekka Paalanen6-10/+11
Change all backends to set the core backend pointer early. This is necessary for libweston core to be able to access the backend vfuncs before the backend init function returns. Particularly, weston_output_init() will be needing to inspect the backend vfuncs to see if the backend has been converted to a new API. Backends that create outputs as part of their init would fail without setting the pointer earlier. For consistency, all backends are modified instead of just those that could hit an issue. Libweston core will take care of resetting the backend pointer to NULL in case of error since "libweston: ensure backend is not loaded twice". Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Ian Ray <ian.ray@ge.com> Acked-by Daniel Stone <daniels@collabora.com>
2017-10-04libweston: ensure backend is not loaded twicePekka Paalanen1-1/+11
Check and ensure that a compositor can only load one backend successfully. If a backend fails to load, it is theoretically possible to try another backend. Once loading succeeds, only destroying the compositor would allow "unloading" a backend. If backend init fail, ensure the backend pointer remains NULL to avoid calling into a half-loaded backend on e.g. compositor destruction. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Ian Ray <ian.ray@ge.com> Acked-by Daniel Stone <daniels@collabora.com>
2017-10-04libweston: rename weston_output_destroy() to weston_output_release()Pekka Paalanen8-12/+12
'release' is a more appropriate name because the function does not free the underlying memory. The main reason for this is that we need the name weston_output_destroy() for new API that actually will free also the underlying memory. Since the function is only used in backends and external backends are not a thing, this does not cause libweston major version bump, even though it does change the ABI. There is no way external users could have successfully used this function. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Ian Ray <ian.ray@ge.com> Acked-by Daniel Stone <daniels@collabora.com>
2017-10-04libweston: send more wl_surface.enter/leave eventsPekka Paalanen1-13/+40
A client may have bound the same wl_output multiple times, for who knows what reason. As the server cannot know which wl_output resource to use for which wl_surface, send enter/leave events for all of them. This is a protocol correctness fix. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Ian Ray <ian.ray@ge.com> Acked-by Daniel Stone <daniels@collabora.com>
2017-10-04compositor-drm: set all properties in create_output_for_connectorPekka Paalanen1-9/+9
Move the remaining scattered setup of the fixed properties into create_output_for_connector(). All these are already known and they cannot change. This helps future refactoring. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Ian Ray <ian.ray@ge.com> Acked-by Daniel Stone <daniels@collabora.com>
2017-10-04compositor-drm: set output make/model/serial oncePekka Paalanen1-11/+29
This fixes a regression where monitor make and model would always be advertised as "unknown" to Wayland clients. The EDID strings were parsed at create_output_for_connector() time, but the fallback "unknown" values were set in weston_drm_output_api::set_mode vfunc later. This made the correct monitor info be shown in the log, but not sent to clients. The purpose of the "unknown" assignments is to give fallback values in case EDID is not providing them. Fix all that by moving all setting of the make, model and serial into create_output_for_connector(). These values cannot change afterwards anyway. While at it, document find_and_parse_output_edid(). The ugly casts in create_output_for_connector() are required to silence compositor warnings from ignoring const attribute. This is temporary, and a future refactoring will get rid of the casts. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Ian Ray <ian.ray@ge.com> Acked-by Daniel Stone <daniels@collabora.com>
2017-10-04compositor-wayland: move output init into common, fix error pathPekka Paalanen1-11/+10
Move the weston_output_init() call into wayland_output_create_common(). This avoids passing the name twice to different functions, and follows the precedent set in "libweston: weston_output_init(..., +name)" for calling init before accessing fields. Since the error paths in wayland_output_create_for_parent_output() and wayland_output_create_fullscreen() are now guaranteed to have weston_output init'd, call weston_output_destroy() appropriately. There might be more to free than just the name. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Ian Ray <ian.ray@ge.com> Acked-by Daniel Stone <daniels@collabora.com>
2017-10-04libweston: weston_output_init(..., +name)Pekka Paalanen8-22/+25
Add 'name' argument to weston_output_init(). This is much more obvious than the assert inside weston_output_init() to ensure the caller has set a field in weston_output first. Now weston_output_init() will strdup() the name itself, which means we can drop a whole bunch of strdup()s in the backends. This matches weston_output_destroy() which was already calling free() on the name. All backends are slightly reordered to call weston_output_init() before accessing any fields of weston_output, except the Wayland backend which would make it a little awkward to do it in this patch. Mind, that weston_output_init() still does not reset the struct to zero - it is presumed the caller has done it, since weston_output is embedded in the backend output structs. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Ian Ray <ian.ray@ge.com> Reviewed-by: David Fort <contact@hardening-consulting.com> [Daniel: document name copying] Acked-by Daniel Stone <daniels@collabora.com>
2017-10-04tests: ensure output dependent IVI tests runPekka Paalanen1-4/+4
There are IVI tests that require an output. Previously these tests would silently skip if no outputs were present. However, a test setup should always have outputs with these tests. Skipping could easily leave the tests dead without notice. Make these tests fail instead of skip if there are no outputs. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Ian Ray <ian.ray@ge.com> Reviewed-by: Emre Ucan <eucan@de.adit-jv.com> Acked-by Daniel Stone <daniels@collabora.com>
2017-10-04libweston: move weston_output::mode_list init to corePekka Paalanen7-8/+1
Initialize the list in weston_output_init() instead of doing it separately in each backend. One would expect weston_output_init() to initialize all weston_output members, at least those that are not NULL. We rely on the set_size() functions to be called only once, as is assert()'d. If set_size() becomes callable multiple times, this patch will force them to be fixed to properly manage the mode list instead of losing all members. compositor-wayland.c is strange in wayland_output_create_for_parent_output(): it first called wayland_output_set_size() that initialized the mode list with a single mode manufactured from width and height and set that mode as current. Then it continued to reset the mode list and adding the list of modes from the parent output, leaving the current mode left to point to a mode struct that is no longer in the mode list and with a broken 'link' element. This patch changes things such that the manufactured mode is left in the list, and the parent mode list is added. This is probably not quite right either. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Emre Ucan <eucan@de.adit-jv.com> Reviewed-by: Ian Ray <ian.ray@ge.com> Acked-by Daniel Stone <daniels@collabora.com>
2017-10-03Fix API troubles with FreeRDP 2.0 v2David Fort1-3/+11
With FreeRDP 2.0 the crypto needs to be initialized or we fail as soon as we try to compute a md5. The API also changed for the suppress output callback. Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-10-02shared: struct timespec is in time.hYann E. MORIN1-0/+1
On the musl C library, tests/timespec-text.c does not build, with the following error: In file included from tests/timespec-test.c:36:0: ./shared/timespec-util.h:41:21: warning: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration timespec_sub(struct timespec *r, ^~~~~~~~ [...] Indeed, struct timespec is defined in time.h, so we must include it. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-09-29gl-renderer: Emit GPU rendering begin and end timeline timepointsAlexandros Frantzis2-0/+175
Use EGL fence sync objects to emit timepoints for the beginning and the end of rendering on the GPU. The timepoints are emitted asynchronously using the sync file fds associated with the fence sync objects. The sync file fds are acquired using the facilities provided by the EGL_ANDROID_native_fence_sync extension. The asynchronous timepoint submissions are stored in a list in gl_output_state until they are executed, and any pending submissions that remain at output destruction time are cleaned up. If timelining is inactive or the required EGL extensions are not present, then GPU timepoint processing and emission are skipped. Note that the GPU timestamps returned by sync files are in the CLOCK_MONOTONIC clock domain, and are thus compatible with the timeline timestamps (which also are in the CLOCK_MONOTONIC domain). Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-09-29libweston: Add check and fallback for linux/sync_file.hAlexandros Frantzis3-0/+32
The sync file functionality is required by the upcoming GPU render timeline work, but it's only available in relatively new linux kernel versions (4.7 and above). This commit provides a "sanitized" version of the required sync file definitions. On systems that don't have the sync file header (due to having an older kernel), we will be able to fall back to our own definitions when building. Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-09-29gl-renderer: Add support for fence sync extensionsAlexandros Frantzis2-0/+32
Check for the EGL_KHR_fence_sync and EGL_ANDROID_native_fence_sync extensions and get pointers to required extension functions. These extensions allow us to acquire GPU timestamp information asynchronously, and are required by the upcoming work to add rendering begin/end timepoints to the weston timeline. Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-09-29timeline: Add GPU timestamp timepoint argumentAlexandros Frantzis2-0/+14
The purpose of this argument is to hold timestamp information about events that occurred on the GPU. This argument allows us to include GPU timestamps in timepoints such as the beginning and end of frame rendering. Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-09-26compositor: fix starvation of wl_buffer::releaseMatt Hoosier2-4/+2
This change replaces a queued emission of buffer-release events (which is prone to starvation) with a regular event emission. This means that client programs no longer need to secretly install surface frame listeners just to guarantee that they get correctly notified of buffer lifecycle events. v2: More information about the historical reasons why this change hadn't happened yet, and the consensus to finally move ahead with it can be found at the discussion terminating in this message: https://lists.freedesktop.org/archives/wayland-devel/2017-September/035147.html Signed-off-by: Matt Hoosier <matt.hoosier@gmail.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
2017-09-25compositor-drm: unref udev on backend destructionPekka Paalanen1-0/+2
Fixes a small memory leak, spotted with Valgrind. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Ian Ray <ian.ray@ge.com>
2017-09-25compositor-fbdev: unref udev on backend destructionPekka Paalanen1-0/+2
Fixes a small memory leak, spotted with Valgrind. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Ian Ray <ian.ray@ge.com>
2017-09-25compositor-fbdev: remove unused field 'depth'Pekka Paalanen1-1/+0
Not referenced anywhere ever, has been there since the introduction of fbdev-backend. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Ian Ray <ian.ray@ge.com>
2017-09-25compositor-fbdev: MAP_FAILED is not NULLPekka Paalanen1-0/+1
Fix the assumption that MAP_FAILED would be equal to NULL. It is not. Set 'fb' explicitly to NULL on mmap failure so that comparisons to NULL would produce the expected result. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-09-25compositor-wayland: use asprintf for output titlePekka Paalanen1-12/+7
Simplifies the code, and makes moving weston_output_init() into wayland_output_create_common() a little easier. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Ian Ray <ian.ray@ge.com>