2016-11-24 18:54:51 +03:00
|
|
|
deps_libweston = [
|
|
|
|
dep_wayland_server,
|
|
|
|
dep_pixman,
|
|
|
|
dep_libm,
|
|
|
|
dep_libdl,
|
2021-07-12 12:58:34 +03:00
|
|
|
dep_libdrm,
|
2016-11-24 18:54:51 +03:00
|
|
|
dep_xkbcommon,
|
2019-04-05 13:50:43 +03:00
|
|
|
dep_matrix_c
|
2016-11-24 18:54:51 +03:00
|
|
|
]
|
|
|
|
srcs_libweston = [
|
|
|
|
git_version_h,
|
|
|
|
'animation.c',
|
2022-11-19 11:52:01 +03:00
|
|
|
'auth.c',
|
2016-11-24 18:54:51 +03:00
|
|
|
'bindings.c',
|
|
|
|
'clipboard.c',
|
libweston: introduce CMS component architecture
See: https://gitlab.freedesktop.org/wayland/weston/-/issues/467#note_814985
This starts building the framework required for implementing color
management.
The main new interface is struct weston_color_manager. This commit also
adds a no-op color manager implementation, which is used if no other
color manager is loaded. This no-op color manager simply provides
identity color transforms for everything, so that Weston keeps running
exactly like before.
weston_color_manager interface is incomplete and will be extended later.
Colorspace objects are not introduced in this commit. However, when
client content colorspace and output colorspace definitions are
combined, they will produce color transformations from client content to
output blending space and from output blending space to output space.
This commit introduces a placeholder struct for color transforms,
weston_color_transform. Objects of this type are expected to be heavy to
create and store, which is why they are designed to be shared as much as
possible, ideally making their instances unique. As color transform
description is intended to be generic in libweston core, renderers and
backends are expected to derive their own state for each transform
object as necessary. Creating and storing the derived state maybe be
expensive as well, more the reason to re-use these objects as much as
possible. E.g. GL-renderer might upload a 3D LUT into a texture and keep
the texture around. DRM-backend might create a KMS blob for a LUT and
keep that around.
As a color transform depends on both the surface and the output, a
transform object may need to be created for each unique pair of them.
Therefore color transforms are referenced from weston_paint_node. As
paint nodes exist for not just surface+output but surface+view+output
triplets, the code ensures that all paint nodes (having different view)
for the same surface+output have the same color transform state.
As a special case, if weston_color_transform is NULL, it means identity
transform. This short-circuits some checks and memory allocations, but
it does mean we use a separate member on weston_paint_node to know if
the color transform has been initialized or not.
Color transformations are pre-created at the weston_output
paint_node_z_order_list creation step. Currently the z order lists
contain all views globally, which means we populate color transforms we
may never need, e.g. a view is never shown on a particular output.
This problem should get fixed naturally when z order lists are
constructed "pruned" in the future: to contain only those paint nodes
that actually contribute to the output's image.
As nothing actually supports color transforms yet, both renderers and
the DRM-backend assert that they only get identity transforms. This
check has the side-effect that all surface-output pairs actually get a
weston_surface_color_transform_ref even though it points to NULL
weston_color_transform.
This design is inspired by Sebastian Wick's Weston color management
work.
Co-authored-by: Sebastian Wick <sebastian@sebastianwick.net>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-25 13:03:28 +03:00
|
|
|
'color.c',
|
2024-01-26 18:11:57 +03:00
|
|
|
'color-properties.c',
|
2024-01-26 18:15:51 +03:00
|
|
|
'color-management.c',
|
libweston: introduce CMS component architecture
See: https://gitlab.freedesktop.org/wayland/weston/-/issues/467#note_814985
This starts building the framework required for implementing color
management.
The main new interface is struct weston_color_manager. This commit also
adds a no-op color manager implementation, which is used if no other
color manager is loaded. This no-op color manager simply provides
identity color transforms for everything, so that Weston keeps running
exactly like before.
weston_color_manager interface is incomplete and will be extended later.
Colorspace objects are not introduced in this commit. However, when
client content colorspace and output colorspace definitions are
combined, they will produce color transformations from client content to
output blending space and from output blending space to output space.
This commit introduces a placeholder struct for color transforms,
weston_color_transform. Objects of this type are expected to be heavy to
create and store, which is why they are designed to be shared as much as
possible, ideally making their instances unique. As color transform
description is intended to be generic in libweston core, renderers and
backends are expected to derive their own state for each transform
object as necessary. Creating and storing the derived state maybe be
expensive as well, more the reason to re-use these objects as much as
possible. E.g. GL-renderer might upload a 3D LUT into a texture and keep
the texture around. DRM-backend might create a KMS blob for a LUT and
keep that around.
As a color transform depends on both the surface and the output, a
transform object may need to be created for each unique pair of them.
Therefore color transforms are referenced from weston_paint_node. As
paint nodes exist for not just surface+output but surface+view+output
triplets, the code ensures that all paint nodes (having different view)
for the same surface+output have the same color transform state.
As a special case, if weston_color_transform is NULL, it means identity
transform. This short-circuits some checks and memory allocations, but
it does mean we use a separate member on weston_paint_node to know if
the color transform has been initialized or not.
Color transformations are pre-created at the weston_output
paint_node_z_order_list creation step. Currently the z order lists
contain all views globally, which means we populate color transforms we
may never need, e.g. a view is never shown on a particular output.
This problem should get fixed naturally when z order lists are
constructed "pruned" in the future: to contain only those paint nodes
that actually contribute to the output's image.
As nothing actually supports color transforms yet, both renderers and
the DRM-backend assert that they only get identity transforms. This
check has the side-effect that all surface-output pairs actually get a
weston_surface_color_transform_ref even though it points to NULL
weston_color_transform.
This design is inspired by Sebastian Wick's Weston color management
work.
Co-authored-by: Sebastian Wick <sebastian@sebastianwick.net>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-25 13:03:28 +03:00
|
|
|
'color-noop.c',
|
2016-11-24 18:54:51 +03:00
|
|
|
'compositor.c',
|
2019-03-28 12:35:42 +03:00
|
|
|
'content-protection.c',
|
2016-11-24 18:54:51 +03:00
|
|
|
'data-device.c',
|
2020-12-01 22:39:47 +03:00
|
|
|
'drm-formats.c',
|
2024-01-11 00:49:17 +03:00
|
|
|
'id-number-allocator.c',
|
2016-11-24 18:54:51 +03:00
|
|
|
'input.c',
|
|
|
|
'linux-dmabuf.c',
|
2018-10-19 12:14:11 +03:00
|
|
|
'linux-explicit-synchronization.c',
|
libweston: Support zwp_surface_synchronization_v1.set_acquire_fence
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 <alexandros.frantzis@collabora.com>
2018-10-19 12:14:11 +03:00
|
|
|
'linux-sync-file.c',
|
2016-11-24 18:54:51 +03:00
|
|
|
'log.c',
|
|
|
|
'noop-renderer.c',
|
2022-07-14 17:42:14 +03:00
|
|
|
'output-capture.c',
|
2016-11-24 18:54:51 +03:00
|
|
|
'pixel-formats.c',
|
|
|
|
'pixman-renderer.c',
|
|
|
|
'plugin-registry.c',
|
|
|
|
'screenshooter.c',
|
|
|
|
'timeline.c',
|
|
|
|
'touch-calibration.c',
|
2019-06-25 13:29:57 +03:00
|
|
|
'weston-log-wayland.c',
|
2019-06-22 20:12:24 +03:00
|
|
|
'weston-log-file.c',
|
2019-06-23 23:24:34 +03:00
|
|
|
'weston-log-flight-rec.c',
|
2019-06-21 22:49:18 +03:00
|
|
|
'weston-log.c',
|
2019-11-16 20:22:48 +03:00
|
|
|
'weston-direct-display.c',
|
2024-01-26 18:15:51 +03:00
|
|
|
color_management_v1_protocol_c,
|
|
|
|
color_management_v1_server_protocol_h,
|
2016-11-24 18:54:51 +03:00
|
|
|
linux_dmabuf_unstable_v1_protocol_c,
|
|
|
|
linux_dmabuf_unstable_v1_server_protocol_h,
|
2018-10-19 12:14:11 +03:00
|
|
|
linux_explicit_synchronization_unstable_v1_protocol_c,
|
|
|
|
linux_explicit_synchronization_unstable_v1_server_protocol_h,
|
2016-11-24 18:54:51 +03:00
|
|
|
input_method_unstable_v1_protocol_c,
|
|
|
|
input_method_unstable_v1_server_protocol_h,
|
|
|
|
input_timestamps_unstable_v1_protocol_c,
|
|
|
|
input_timestamps_unstable_v1_server_protocol_h,
|
|
|
|
presentation_time_protocol_c,
|
|
|
|
presentation_time_server_protocol_h,
|
|
|
|
pointer_constraints_unstable_v1_protocol_c,
|
|
|
|
pointer_constraints_unstable_v1_server_protocol_h,
|
|
|
|
relative_pointer_unstable_v1_protocol_c,
|
|
|
|
relative_pointer_unstable_v1_server_protocol_h,
|
2022-01-21 17:13:58 +03:00
|
|
|
single_pixel_buffer_v1_protocol_c,
|
|
|
|
single_pixel_buffer_v1_server_protocol_h,
|
2022-11-24 23:05:28 +03:00
|
|
|
tearing_control_v1_protocol_c,
|
|
|
|
tearing_control_v1_server_protocol_h,
|
2016-11-24 18:54:51 +03:00
|
|
|
text_cursor_position_protocol_c,
|
|
|
|
text_cursor_position_server_protocol_h,
|
|
|
|
text_input_unstable_v1_protocol_c,
|
|
|
|
text_input_unstable_v1_server_protocol_h,
|
|
|
|
weston_touch_calibration_protocol_c,
|
|
|
|
weston_touch_calibration_server_protocol_h,
|
2019-03-28 12:35:42 +03:00
|
|
|
weston_content_protection_protocol_c,
|
|
|
|
weston_content_protection_server_protocol_h,
|
2016-11-24 18:54:51 +03:00
|
|
|
viewporter_protocol_c,
|
|
|
|
viewporter_server_protocol_h,
|
2019-03-29 15:01:06 +03:00
|
|
|
xdg_output_unstable_v1_protocol_c,
|
|
|
|
xdg_output_unstable_v1_server_protocol_h,
|
2016-11-24 18:54:51 +03:00
|
|
|
weston_debug_protocol_c,
|
|
|
|
weston_debug_server_protocol_h,
|
2019-11-16 20:22:48 +03:00
|
|
|
weston_direct_display_protocol_c,
|
|
|
|
weston_direct_display_server_protocol_h,
|
2022-07-14 17:42:14 +03:00
|
|
|
weston_output_capture_protocol_c,
|
|
|
|
weston_output_capture_server_protocol_h,
|
2021-01-20 11:05:45 +03:00
|
|
|
tablet_unstable_v2_protocol_c,
|
|
|
|
tablet_unstable_v2_server_protocol_h,
|
2016-11-24 18:54:51 +03:00
|
|
|
]
|
|
|
|
|
2022-06-21 19:48:46 +03:00
|
|
|
subdir('desktop')
|
2022-11-22 14:28:57 +03:00
|
|
|
subdir('shell-utils')
|
2022-06-21 19:48:46 +03:00
|
|
|
|
2019-02-13 17:10:35 +03:00
|
|
|
if get_option('renderer-gl')
|
|
|
|
dep_egl = dependency('egl', required: false)
|
|
|
|
if not dep_egl.found()
|
|
|
|
error('libweston + gl-renderer requires egl which was not found. Or, you can use \'-Drenderer-gl=false\'.')
|
|
|
|
endif
|
|
|
|
deps_libweston += dep_egl
|
2022-12-08 18:19:34 +03:00
|
|
|
else
|
|
|
|
dep_egl = dependency('', required: false)
|
2019-02-13 17:10:35 +03:00
|
|
|
endif
|
|
|
|
|
2022-11-19 11:52:01 +03:00
|
|
|
if get_option('backend-vnc')
|
|
|
|
dep_pam = dependency('pam', required: false)
|
|
|
|
if not dep_pam.found()
|
|
|
|
dep_pam = cc.find_library('pam')
|
|
|
|
endif
|
|
|
|
if not dep_pam.found()
|
|
|
|
error('VNC backend requires libpam which was not found. Or, you can use \'-Dbackend-vnc=false\'.')
|
|
|
|
endif
|
|
|
|
config_h.set('HAVE_PAM', '1')
|
|
|
|
deps_libweston += dep_pam
|
|
|
|
endif
|
|
|
|
|
2016-11-24 18:54:51 +03:00
|
|
|
lib_weston = shared_library(
|
|
|
|
'weston-@0@'.format(libweston_major),
|
|
|
|
srcs_libweston,
|
2019-04-05 17:09:28 +03:00
|
|
|
include_directories: common_inc,
|
2016-11-24 18:54:51 +03:00
|
|
|
install: true,
|
|
|
|
version: '0.0.@0@'.format(libweston_revision),
|
2019-02-06 17:42:09 +03:00
|
|
|
link_whole: lib_libshared,
|
2016-11-24 18:54:51 +03:00
|
|
|
dependencies: deps_libweston
|
|
|
|
)
|
|
|
|
|
2019-10-17 16:32:34 +03:00
|
|
|
|
2019-04-18 16:43:55 +03:00
|
|
|
# For external users, like Weston.
|
|
|
|
dep_libweston_public = declare_dependency(
|
|
|
|
link_with: lib_weston,
|
|
|
|
include_directories: public_inc,
|
2019-10-17 16:32:34 +03:00
|
|
|
dependencies: deps_for_libweston_users
|
2019-04-18 16:43:55 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
# For internal users, like the backends.
|
|
|
|
dep_libweston_private = declare_dependency(
|
2016-11-24 18:54:51 +03:00
|
|
|
link_with: lib_weston,
|
2019-03-28 17:35:56 +03:00
|
|
|
include_directories: [ include_directories('.'), public_inc ],
|
2019-10-17 16:32:34 +03:00
|
|
|
dependencies: deps_for_libweston_users
|
2016-11-24 18:54:51 +03:00
|
|
|
)
|
|
|
|
|
2019-04-18 16:43:55 +03:00
|
|
|
# XXX: We should be able to use dep_libweston_private.partial_dependency() instead
|
2019-03-29 14:35:15 +03:00
|
|
|
# of this, but a Meson bug makes it not work. It will be fixed with
|
|
|
|
# https://github.com/mesonbuild/meson/pull/5167
|
|
|
|
# in hopefully Meson 0.51.
|
2019-10-17 16:32:34 +03:00
|
|
|
dep_libweston_private_h_deps = []
|
|
|
|
foreach d : deps_for_libweston_users
|
|
|
|
dep_libweston_private_h_deps += d.partial_dependency(compile_args: true)
|
|
|
|
endforeach
|
2019-04-18 16:43:55 +03:00
|
|
|
dep_libweston_private_h = declare_dependency(
|
2019-03-28 17:35:56 +03:00
|
|
|
include_directories: [ include_directories('.'), public_inc ],
|
2019-10-17 16:32:34 +03:00
|
|
|
dependencies: dep_libweston_private_h_deps
|
2019-03-29 14:35:15 +03:00
|
|
|
)
|
|
|
|
|
2016-11-24 18:54:51 +03:00
|
|
|
pkgconfig.generate(
|
2019-02-01 02:11:31 +03:00
|
|
|
lib_weston,
|
2016-11-24 18:54:51 +03:00
|
|
|
filebase: 'libweston-@0@'.format(libweston_major),
|
|
|
|
name: 'libweston API',
|
|
|
|
version: version_weston,
|
|
|
|
description: 'Header files for libweston compositors development',
|
2019-10-17 16:32:34 +03:00
|
|
|
requires_private: deps_for_libweston_users,
|
2016-11-24 18:54:51 +03:00
|
|
|
subdirs: dir_include_libweston
|
|
|
|
)
|
|
|
|
|
|
|
|
pkgconfig.generate(
|
|
|
|
filebase: 'libweston-@0@-protocols'.format(libweston_major),
|
|
|
|
name: 'libWeston Protocols',
|
|
|
|
version: version_weston,
|
|
|
|
description: 'libWeston protocol files',
|
|
|
|
variables: [
|
2023-06-22 16:28:52 +03:00
|
|
|
'datarootdir=' + '${prefix}' / get_option('datadir'),
|
|
|
|
'pkgdatadir=' + '${pc_sysrootdir}${datarootdir}' / dir_protocol_libweston
|
2016-11-24 18:54:51 +03:00
|
|
|
],
|
|
|
|
install_dir: dir_data_pc
|
|
|
|
)
|
|
|
|
|
2023-09-29 16:36:57 +03:00
|
|
|
if get_option('backend-drm')
|
2023-09-29 17:25:16 +03:00
|
|
|
dep_libseat = dependency('libseat', version: '>= 0.4')
|
2023-09-29 16:36:57 +03:00
|
|
|
srcs_session_helper = [
|
2023-09-28 16:02:13 +03:00
|
|
|
'launcher-libseat.c',
|
2023-09-29 16:36:57 +03:00
|
|
|
'launcher-util.c',
|
2023-09-28 16:02:13 +03:00
|
|
|
]
|
2023-09-29 16:36:57 +03:00
|
|
|
deps_session_helper = [
|
2023-09-29 17:25:16 +03:00
|
|
|
dep_libseat,
|
2023-09-29 16:36:57 +03:00
|
|
|
dep_libweston_private_h,
|
2023-09-28 16:02:13 +03:00
|
|
|
]
|
2016-11-24 18:54:51 +03:00
|
|
|
|
2023-09-29 16:36:57 +03:00
|
|
|
lib_session_helper = static_library(
|
|
|
|
'session-helper',
|
|
|
|
srcs_session_helper,
|
|
|
|
include_directories: common_inc,
|
|
|
|
dependencies: deps_session_helper,
|
|
|
|
install: false
|
|
|
|
)
|
|
|
|
dep_session_helper = declare_dependency(link_with: lib_session_helper)
|
|
|
|
endif
|
2016-11-24 18:54:51 +03:00
|
|
|
|
2019-04-05 12:04:58 +03:00
|
|
|
lib_libinput_backend = static_library(
|
|
|
|
'libinput-backend',
|
|
|
|
[
|
|
|
|
'libinput-device.c',
|
2021-01-20 11:21:29 +03:00
|
|
|
'libinput-seat.c',
|
|
|
|
tablet_unstable_v2_server_protocol_h
|
2019-04-05 12:04:58 +03:00
|
|
|
],
|
|
|
|
dependencies: [
|
2019-04-18 16:43:55 +03:00
|
|
|
dep_libweston_private,
|
2019-04-05 12:04:58 +03:00
|
|
|
dep_libinput,
|
|
|
|
dependency('libudev', version: '>= 136')
|
|
|
|
],
|
2019-04-05 17:09:28 +03:00
|
|
|
include_directories: common_inc,
|
2019-04-05 12:04:58 +03:00
|
|
|
install: false
|
|
|
|
)
|
|
|
|
dep_libinput_backend = declare_dependency(
|
|
|
|
link_with: lib_libinput_backend,
|
|
|
|
include_directories: include_directories('.')
|
|
|
|
)
|
|
|
|
|
2019-04-04 16:53:11 +03:00
|
|
|
dep_vertex_clipping = declare_dependency(
|
|
|
|
sources: 'vertex-clipping.c',
|
|
|
|
include_directories: include_directories('.')
|
|
|
|
)
|
2016-11-24 18:54:51 +03:00
|
|
|
|
2022-12-08 18:15:21 +03:00
|
|
|
lib_gl_borders = static_library(
|
|
|
|
'gl-borders',
|
|
|
|
'gl-borders.c',
|
|
|
|
include_directories: common_inc,
|
|
|
|
dependencies: [
|
|
|
|
dep_lib_cairo_shared,
|
|
|
|
dep_egl, # for gl-renderer.h
|
2023-05-18 10:17:17 +03:00
|
|
|
deps_for_libweston_users,
|
2022-12-08 18:15:21 +03:00
|
|
|
],
|
|
|
|
build_by_default: false,
|
|
|
|
install: false
|
|
|
|
)
|
|
|
|
dep_lib_gl_borders = declare_dependency(
|
|
|
|
link_with: lib_gl_borders,
|
|
|
|
dependencies: dep_lib_cairo_shared
|
|
|
|
)
|
|
|
|
|
2021-03-29 14:11:49 +03:00
|
|
|
subdir('color-lcms')
|
2019-04-04 17:29:27 +03:00
|
|
|
subdir('renderer-gl')
|
2019-04-05 12:58:27 +03:00
|
|
|
subdir('backend-drm')
|
2019-04-05 13:11:01 +03:00
|
|
|
subdir('backend-headless')
|
2021-05-09 17:52:36 +03:00
|
|
|
subdir('backend-pipewire')
|
2019-04-05 13:14:15 +03:00
|
|
|
subdir('backend-rdp')
|
2019-09-22 20:40:04 +03:00
|
|
|
subdir('backend-vnc')
|
2019-04-05 13:17:22 +03:00
|
|
|
subdir('backend-wayland')
|
2019-04-05 13:20:53 +03:00
|
|
|
subdir('backend-x11')
|