1. 16 May, 2019 1 commit
  2. 02 May, 2019 1 commit
    • Antonio Borneo's avatar
      log: remove "%m" from format strings by using strerror(errno) · 39578636
      Antonio Borneo authored
      The printf() format specifier "%m" is a glibc extension to print
      the string returned by strerror(errno). While supported by other
      libraries (e.g. uClibc and musl), it is not widely portable.
      
      In Weston code the format string is often passed to a logging
      function that calls other syscalls before the conversion of "%m"
      takes place. If one of such syscall modifies the value in errno,
      the conversion of "%m" will incorrectly report the error string
      corresponding to the new value of errno.
      
      Remove all the occurrences of the specifier "%m" in Weston code
      by using directly the string returned by strerror(errno).
      While there, fix some minor indentation issue.
      Signed-off-by: Antonio Borneo's avatarAntonio Borneo <borneo.antonio@gmail.com>
      39578636
  3. 18 Apr, 2019 7 commits
  4. 28 Mar, 2019 4 commits
  5. 15 Feb, 2019 2 commits
    • Pekka Paalanen's avatar
      meson: IVI plugin tests do not use config · c58648b0
      Pekka Paalanen authored
      If Weston is not installed, running ivi-layout test would fail on lots of image
      files not found which presumably causes the creation of some ivi surfaces to
      fail, leading to an assert failure.
      
      Looking at the test setup in weston-tests-env, these IVI plugin tests are
      supposed to run with --no-config instead.
      
      Fixes: #195Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      c58648b0
    • Pekka Paalanen's avatar
      meson: set WESTON_DATA_DIR for tests · fcd9f674
      Pekka Paalanen authored
      It seems WESTON_DATA_DIR was missed. If you have already installed Weston, then
      the files will be found in the install location, but if not, they were not
      found at all.
      
      This caused the xwayland test to SEGV the compositor in
      weston_wm_window_create_frame() when frame_crate() returned NULL.
      
      This patch fixes the test suite only.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      fcd9f674
  6. 06 Feb, 2019 5 commits
    • Alexandros Frantzis's avatar
      tests: Add tests for per commit zwp_buffer_release_v1 behavior · c715c750
      Alexandros Frantzis authored
      Add tests to check that the zwp_buffer_release_v1 events are emitted per
      surface commit.
      
      To be able to test this we need to use a renderer that holds the buffer
      until the next buffer is committed, hence we use the pixman renderer.
      
      Changes in v7:
        - Remove references to obsolete noop-hold renderer.
      
      Changes in v5:
        - Meson support.
      
      Changes in v4:
        - Use the pixman renderer instead of the (now gone) noop-hold
          renderer.
      Signed-off-by: Alexandros Frantzis's avatarAlexandros Frantzis <alexandros.frantzis@collabora.com>
      c715c750
    • Alexandros Frantzis's avatar
      libweston: Support zwp_surface_synchronization_v1.get_release · 67629674
      Alexandros Frantzis authored
      Implement the get_release request of the zwp_surface_synchronization_v1
      interface.
      
      This commit implements the zwp_buffer_release_v1 interface. It supports
      the zwp_buffer_release_v1.fenced_release event for surfaces rendered by
      the GL renderer, and the zwp_buffer_release_v1.immediate_release event
      for other cases.
      
      Note that the immediate_release event is safe to be used for surface
      buffers used as planes in the DRM backend, since the backend releases
      them only after the next page flip that doesn't use the buffers has
      finished.
      
      Changes in v7:
        - Remove "partial" from commit title and description.
        - Fix inverted check when clearing used_in_output_repaint flag.
      
      Changes in v5:
        - Use the new, generic explicit sync server error reporting function.
        - Introduce and use weston_buffer_release_move.
        - Introduce internally and use weston_buffer_release_destroy.
      
      Changes in v4:
        - Support the zwp_buffer_release_v1.fenced_release event.
        - Support release fences in the GL renderer.
        - Assert that pending state buffer_release is always NULL after a
          commit.
        - Simplify weston_buffer_release_reference.
        - Move removal of destroy listener before resource destruction to
          avoid concerns about use-after-free in
          weston_buffer_release_reference
        - Rename weston_buffer_release_reference.busy_count to ref_count.
        - Add documentation for weston_buffer_release and ..._reference.
      
      Changes in v3:
        - Raise NO_BUFFER for get_release if no buffer has been committed,
          don't raise UNSUPPORTED_BUFFER for non-dmabuf buffers,
          so get_release works for all valid buffers.
        - Destroy the buffer_release object after sending an event.
        - Track lifetime of buffer_release objects per commit, independently
          of any buffers.
        - Use updated protocol interface names.
        - Use correct format specifier for resource ids.
      
      Changes in v2:
        - Raise UNSUPPORTED_BUFFER at commit if client has requested a
          buffer_release, but the committed buffer is not a valid linux_dmabuf.
        - Remove tests that are not viable anymore due to our inability to
          create dmabuf buffers and fences in a unit-test environment.
      Signed-off-by: Alexandros Frantzis's avatarAlexandros Frantzis <alexandros.frantzis@collabora.com>
      67629674
    • Alexandros Frantzis's avatar
      libweston: Support zwp_surface_synchronization_v1.set_acquire_fence · acff29b3
      Alexandros Frantzis authored
      Implement the set_acquire_fence request of the
      zwp_surface_synchronization_v1 interface.
      
      The implementation uses the acquire fence in two ways:
      
      1. If the associated buffer is used as GL render source, an
         EGLSyncKHR is created from the fence and used to synchronize
         access.
      2. If the associated buffer is used as a plane framebuffer,
         the acquire fence is treated as an in-fence for the atomic
         commit operation. If in-fences are not supported and the buffer
         has an acquire fence, we don't consider it for plane placement.
      
      If the used compositor/renderer doesn't support explicit
      synchronization, we don't advertise the protocol at all. Currently only
      the DRM and X11 backends when using the GL renderer advertise the
      protocol for production use.
      
      Issues for discussion
      ---------------------
      
      a. Currently, a server-side wait of EGLSyncKHR is performed before
         using the EGLImage/texture during rendering. Unfortunately, it's not clear
         from the specs whether this is generally safe to do, or we need to
         sync before glEGLImageTargetTexture2DOES. The exception is
         TEXTURE_EXTERNAL_OES where the spec mentions it's enough to sync
         and then glBindTexture for any changes to take effect.
      
      Changes in v5:
        - Meson support.
        - Make explicit sync server error reporting more generic, supporting
          all explicit sync related interfaces not just
          wp_linux_surface_synchronization.
        - Fix typo in warning for missing EGL_KHR_wait_sync extension.
        - Support minor version 2 of the explicit sync protocol (i.e., support
          fences for opaque EGL buffers).
      
      Changes in v4:
        - Introduce and use fd_clear and and fd_move helpers.
        - Don't check for a valid buffer when updating surface acquire fence fd
          from state.
        - Assert that pending state acquire fence fd is always clear
          after a commit.
        - Clarify that WESTON_CAP_EXPLICIT_SYNC applies to just the
          renderer.
        - Check for EGL_KHR_wait_sync before using eglWaitSyncKHR.
        - Dup the acquire fence before passing to EGL.
      
      Changes in v3:
        - Keep acquire_fence_fd in surface instead of buffer.
        - Clarify that WESTON_CAP_EXPLICIT_SYNC applies to both backend and
          renderer.
        - Move comment about non-ownership of in_fence_fd to struct
          drm_plane_state definition.
        - Assert that we don't try to use planes with in-fences when using the
          legacy KMS API.
        - Remove unnecessary info from wayland error messages.
        - Handle acquire fence for subsurface commits.
        - Guard against self-update in fd_update.
        - Disconnect the client if acquire fence EGLSyncKHR creation or wait
          fails.
        - Use updated protocol interface names.
        - User correct format specifier for resource ids.
        - Advertise protocol for X11 backend with GL renderer.
      
      Changes in v2:
        - Remove sync file wait fallbacks.
        - Raise UNSUPPORTED_BUFFER error at commit if we have an acquire
          fence, but the committed buffer is not a valid linux_dmabuf.
        - Don't put buffers with in-fences on planes that don't support
          in-fences.
        - Don't advertise explicit sync protocol if backend does not
          support explicit sync.
      Signed-off-by: Alexandros Frantzis's avatarAlexandros Frantzis <alexandros.frantzis@collabora.com>
      acff29b3
    • Alexandros Frantzis's avatar
      libweston: Introduce zwp_linux_explicit_synchronization_v1 · 27d7c395
      Alexandros Frantzis authored
      Introduce support for the zwp_linux_explicit_synchronization_unstable_v1
      protocol with an implementation of the zwp_linux_explicit_synchronization_v1
      interface.
      
      Explicit synchronization provides a more versatile notification
      mechanism for buffer readiness and availability, and can be used to
      improve efficiency by integrating with related functionality in display
      and graphics APIs.
      
      In addition, the per-commit nature of the release events provided by
      this protocol potentially offers a solution to a deficiency of the
      wl_buffer.release event (see
      wayland/wayland#46).
      
      Support for this protocol depends on the capabilities of the backend, so
      we don't register it by default but provide a function which each
      backend will need to call. In this commit only the headless backend when
      using the noop renderer supports this to enable testing.
      
      Note that the zwp_surface_synchronization_v1 interface, which contains
      the core functionality of the protocol, is not implemented in this
      commit. Support for it will be added in future commits.
      
      Changes in v7:
        - Added some information in the commit message about the benefits of
          the explicit sync protocol.
      
      Changes in v6:
        - Fall back to advertising minor version 1 of the explicit sync protocol,
          although we support minor version 2 features, until the new
          wayland-protocols version is released.
      
      Changes in v5:
        - Meson support.
        - Advertise minor version 2 of the explicit sync protocol.
      
      Changes in v4:
        - Enable explicit sync support in the headless backend for all
          renderers.
      
      Changes in v3:
        - Use wl_resource_get_version() instead of hardcoding version 1.
        - Use updated protocol interface names.
        - Use correct format specifier for resource id.
        - Change test name to 'linux-explicit-synchronization.weston'
          (s/_/-/g).
      
      Changes in v2:
        - Move implementation to separate file so protocol can be registered
          on demand by backends.
        - Register protocol in headless+noop backend for testing purposes.
      Signed-off-by: Alexandros Frantzis's avatarAlexandros Frantzis <alexandros.frantzis@collabora.com>
      27d7c395
    • Pekka Paalanen's avatar
      tests: use weston_compositor_exit · a37920e7
      Pekka Paalanen authored
      Use the proper function to exit instead of the libwayland one, to allow main
      handle_exit() to be called.
      
      This is just to unify the exit paths.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      a37920e7
  7. 09 Jan, 2019 2 commits
  8. 07 Jan, 2019 1 commit
    • Pekka Paalanen's avatar
      tests: remove remnants of buffer-count test · 91bf16be
      Pekka Paalanen authored
      The buffer-count test was added in
      40c0c3f9 and removed in
      4938f93f, but the removal left around
      the dependency to EGL headers in weston-test.c.
      
      Removal of those unneeded includes allows us to drop the EGL dependency
      completely from weston-test.c build.
      
      For the Meson build this means that there are no dependency('egl')
      directives anymore without the user friendly error message.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pq@iki.fi>
      91bf16be
  9. 20 Dec, 2018 1 commit
  10. 09 Dec, 2018 3 commits
    • Daniel Stone's avatar
      Add Meson build system · 8011b0fa
      Daniel Stone authored
      Meson is a build system, currently implemented in Python, with multiple
      output backends, including Ninja and Make. The build file syntax is
      clean and easy to read unlike autotools. In practise, configuring and
      building with Meson and Ninja has been observed to be much faster than
      with autotools. Also cross-building support is excellent.
      
      More information at http://mesonbuild.com
      
      Since moving to Meson requires some changes from users in any case, we
      took this opportunity to revamp build options. Most of the build options
      still exist, some have changed names or more, and a few have been
      dropped. The option to choose the Cairo flavour is not implemented since
      for the longest time the Cairo image backend has been the only
      recommended one.
      
      This Meson build should be fully functional and it installs everything
      an all-enabled autotools build does. Installed pkg-config files have
      some minor differences that should be insignificant. Building of some
      developer documentation that was never installed with autotools is
      missing.
      
      It is expected that the autotools build system will be removed soon
      after the next Weston release.
      Signed-off-by: Daniel Stone's avatarDaniel Stone <daniels@collabora.com>
      Co-authored-by: Pekka Paalanen's avatarPekka Paalanen <pq@iki.fi>
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pq@iki.fi>
      8011b0fa
    • Daniel Stone's avatar
      tests: fix include in input-timestamps-helper.c · ed75c89f
      Daniel Stone authored
      No need to use the protocol directory prefix. This may even be necessary
      for the Meson build.
      Signed-off-by: Daniel Stone's avatarDaniel Stone <daniels@collabora.com>
      
      Extracted from the patch adding the Meson build system.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pq@iki.fi>
      ed75c89f
    • Daniel Stone's avatar
      tests: Rename surface-screenshot · 51c9b0e2
      Daniel Stone authored
      Give it a more regular name, matching all the other test plugins.
      Signed-off-by: Daniel Stone's avatarDaniel Stone <daniels@collabora.com>
      51c9b0e2
  11. 09 Jul, 2018 1 commit
    • Daniel Stone's avatar
      helpers: Move static_assert definition to shared · 11f91bbd
      Daniel Stone authored
      Collect the fallback definitions of static_assert() from desktop-shell
      and the test shell, and move them to helpers.h. This allows code
      throughout the tree to use static_assert() for build-time assertions,
      where it is supported by the compiler.
      
      As GCC goes out of its way to only add static_assert() when C11 has been
      explicitly requested - which we don't do - make sure to use the more
      widely available _Static_assert() if that is provided.
      
      This will be used in future patches to ensure two array lengths don't go
      out of sync.
      Signed-off-by: Daniel Stone's avatarDaniel Stone <daniels@collabora.com>
      Reviewed-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
      11f91bbd
  12. 20 Jun, 2018 3 commits
  13. 30 May, 2018 2 commits
    • Pekka Paalanen's avatar
      libweston: notify_touch API to use weston_touch_device · bcbce330
      Pekka Paalanen authored
      Relay touch input events into libweston core through the
      weston_touch_device, so that the core can tell which individual physical
      device they come from.
      
      This is necessary for supporting touchscreen calibration, where one
      needs to process a single physical device at a time instead of the
      aggregate of all touch devices on the weston_seat.
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
      v1 Tested-by: Matt Hoosier <matt.hoosier@gmail.com>
      Reviewed-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
      bcbce330
    • Louis-Francis Ratté-Boulianne's avatar
      input: introduce weston_touch_device · 6ef59c98
      Louis-Francis Ratté-Boulianne authored
      Introduce weston_touch_device for libweston core to track individual
      touchscreen input devices. A weston_seat/weston_touch may be an
      aggregation of several physical touchscreen input devices. Separating
      the physical devices will be required for implementing touchscreen
      calibration. One can only calibrate one device at a time, and we want to
      make sure to handle the right one.
      
      Both backends that support touch devices are updated to create
      weston_touch_devices. Wayland-backend provides touch devices that cannot
      be calibrated, because we have no access to raw touch coordinates from
      the device - calibration is the responsibility of the parent display
      server. Libinput backend provides touch devices that can be calibrated,
      hence implementing the set and get calibration hooks.
      
      Backends need to maintain an output pointer in any case, so we have a
      get_output() hook instead of having to maintain an identical field in
      weston_touch_device. The same justification applies to
      get_calibration_head_name.
      
      Also update the test plugin to manage weston_touch_device objects.
      
      Co-developed by Louis-Francis and Pekka.
      
      v2:
      - Consistently use 'cal' instead of 'calb' or 'matrix'.
      - change devpath into syspath
      - update copyrights
      Signed-off-by: 's avatarLouis-Francis Ratté-Boulianne <lfrb@collabora.com>
      Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
      v1 Tested-by: Matt Hoosier <matt.hoosier@gmail.com>
      Reviewed-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
      6ef59c98
  14. 20 Apr, 2018 1 commit
  15. 10 Apr, 2018 1 commit
  16. 20 Feb, 2018 5 commits