wayland.rst 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. .. SPDX-License-Identifier: CC-BY-SA-2.0-UK
  2. Using Wayland and Weston
  3. ************************
  4. :wikipedia:`Wayland <Wayland_(display_server_protocol)>`
  5. is a computer display server protocol that provides a method for
  6. compositing window managers to communicate directly with applications
  7. and video hardware and expects them to communicate with input hardware
  8. using other libraries. Using Wayland with supporting targets can result
  9. in better control over graphics frame rendering than an application
  10. might otherwise achieve.
  11. The Yocto Project provides the Wayland protocol libraries and the
  12. reference :wikipedia:`Weston <Wayland_(display_server_protocol)#Weston>`
  13. compositor as part of its release. You can find the integrated packages
  14. in the ``meta`` layer of the :term:`Source Directory`.
  15. Specifically, you
  16. can find the recipes that build both Wayland and Weston at
  17. ``meta/recipes-graphics/wayland``.
  18. You can build both the Wayland and Weston packages for use only with targets
  19. that accept the :wikipedia:`Mesa 3D and Direct Rendering Infrastructure
  20. <Mesa_(computer_graphics)>`, which is also known as Mesa DRI. This implies that
  21. you cannot build and use the packages if your target uses, for example, the
  22. Intel Embedded Media and Graphics Driver (Intel EMGD) that overrides Mesa DRI.
  23. .. note::
  24. Due to lack of EGL support, Weston 1.0.3 will not run directly on the
  25. emulated QEMU hardware. However, this version of Weston will run
  26. under X emulation without issues.
  27. This section describes what you need to do to implement Wayland and use
  28. the Weston compositor when building an image for a supporting target.
  29. Enabling Wayland in an Image
  30. ============================
  31. To enable Wayland, you need to enable it to be built and enable it to be
  32. included (installed) in the image.
  33. Building Wayland
  34. ----------------
  35. To cause Mesa to build the ``wayland-egl`` platform and Weston to build
  36. Wayland with Kernel Mode Setting
  37. (`KMS <https://wiki.archlinux.org/index.php/Kernel_Mode_Setting>`__)
  38. support, include the "wayland" flag in the
  39. :term:`DISTRO_FEATURES`
  40. statement in your ``local.conf`` file::
  41. DISTRO_FEATURES:append = " wayland"
  42. .. note::
  43. If X11 has been enabled elsewhere, Weston will build Wayland with X11
  44. support
  45. Installing Wayland and Weston
  46. -----------------------------
  47. To install the Wayland feature into an image, you must include the
  48. following
  49. :term:`CORE_IMAGE_EXTRA_INSTALL`
  50. statement in your ``local.conf`` file::
  51. CORE_IMAGE_EXTRA_INSTALL += "wayland weston"
  52. Running Weston
  53. ==============
  54. To run Weston inside X11, enabling it as described earlier and building
  55. a Sato image is sufficient. If you are running your image under Sato, a
  56. Weston Launcher appears in the "Utility" category.
  57. Alternatively, you can run Weston through the command-line interpretor
  58. (CLI), which is better suited for development work. To run Weston under
  59. the CLI, you need to do the following after your image is built:
  60. #. Run these commands to export ``XDG_RUNTIME_DIR``::
  61. mkdir -p /tmp/$USER-weston
  62. chmod 0700 /tmp/$USER-weston
  63. export XDG_RUNTIME_DIR=/tmp/$USER-weston
  64. #. Launch Weston in the shell::
  65. weston