Rename wayland_output_init_from_config to weston_wayland_output_config_init
to prepare the following patch :
"compositor-wayland: move configuration parsing to weston"
Signed-off-by: Benoit Gschwind <gschwind@gnu-log.net>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
[Pekka: drop a useless comment]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Benoit Gschwind <gschwind@gnu-log.net>
[Pekka: squashed with "compositor-wayland: fix too long lines".]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Preparing for libweston and for the separation of the code base into
libweston vs. weston the compositor, we must remove all uses
weston_config structures from the backends. We have decided that all
option and config input happens in the compositor (main.c), and
configuration is passed in for the backends as structs.
Most other backends have already converted, and this patch converts the
DRM-backend to the libweston-style init API.
The libweston-style init API includes a header for each backend (here
compositor-drm.h) defining the configuration interface. The compositor
(main.c) prepares a configuration struct to be passed through libweston
core to the backend during initialization.
A complication with the DRM-backend is that outputs can be hotplugged,
and their configuration needs to be fetched from the compositor
(main.c). For this, the config struct contains a callback member. The
output configuration API is subject to change later, this is just a
temporary API to get libweston forward.
As weston_compositor's user_data was not previously used for anything,
and the output configuration callback needs data, the user_data is set
to the 'config' pointer. This pointer is only used in
drm_configure_output() in main.c.
[Bryce: lots of stuff and rebasing]
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Tested-by: Benoit Gschwind <gschwind@gnu-log.net>
[Pekka: write commit message]
[Pekka: squash in "drm: Don't hang onto the backend config object
post-backend_init" from Bryce Harrington]
[Pekka: drop the compositor.h hunk]
[Pekka: do not #include inside extern "C"]
[Pekka: remove incorrect comment about weston_drm_backend_config
ownership.]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
There were two copies of code applying transform and scale to size.
Refactor the code to use just one copy in a new function.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Makes it easier to see that it does not change weston_surface state
implicitly.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Signed-off-by: Benoit Gschwind <gschwind@gnu-log.net>
[Pekka: moved #include out of extern "C".]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Extract configuration parsing from init_backend function. The new
init_backend start by generating the configuration structure from
configuration file with separated function and then use this structure
to load the backend.
Signed-off-by: Benoit Gschwind <gschwind@gnu-log.net>
[Pekka: rebased]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
The splitting intend to separate configuration parsing from output
setup.
Introduces struct weston_wayland_backend_output_config.
Signed-off-by: Benoit Gschwind <gschwind@gnu-log.net>
[Pekka: squashed "wayland-backend: define output configuration
structure" into this.]
[Pekka: fix fullscreen output scale back to 1.]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Move configuration parsing from create_cursor to backend_init. Use newer
configuration structure to initialize the cursor in create_cursor.
Signed-off-by: Benoit Gschwind <gschwind@gnu-log.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
default_seat and default_seat_name are not used anywhere in this file.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
We include wayland-server.h, pixman.h and xkbcommon.h in compositor.h,
but they are not required for linking if the plugin doesn’t use them.
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Daniel Stone <daniels@collabora.com>
This will allow plugins to be aware of e.g. panels, to avoid covering
them with other surfaces.
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Use a "well" defined structure to configure x11-backend and move configuration
file parsing inside the weston compositor code.
Enforce destruction of all backend config objects after initialization.
Since the backend config struct versioning implies that there we expect
potential future descrepancy between main's definition of the config
object and the backend's, don't allow the backend to hang onto the
config object outside the initialization scope.
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Benoit Gschwind <gschwind@gnu-log.net>
Tested-by: Benoit Gschwind <gschwind@gnu-log.net>
Implement a "well" defined API to configure the fbdev backend.
Following and according to discussion about libweston API
The output transform configuration is moved into weston and added to the
fbdev configuration structure.
Signed-off-by: Benoit Gschwind <gschwind@gnu-log.net>
[Pekka: squashed two patches and rebased.]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Ensuring that the pointer to the device path stays valid gets harder and
harder with migrating to the libweston-style config handling. Therefore,
make a copy of the string, private to struct fbdev_output.
Now the pointer passed in to fbdev_output_create() could be freed right
after the call returns.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Benoit Gschwind <gschwind@gnu-log.net>
If we break; when lseek fails we can fail to do some legitimate tests
on remaining planes in a multi-plane buffer.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Add explanations of scaling that are a bit more approachable for users.
Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=94824
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Implement a "well" defined API to configure the rdp backend.
Following according to discution about libweston API.
Signed-off-by: Benoit Gschwind <gschwind@gnu-log.net>
Reviewed-by: David FORT <rdp.effort@gmail.com>
[Pekka: added missing headers to Makefile.am]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Include shared/xalloc.h in clients/nested.c to fix
compilation error: undefined reference to `xzalloc'
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
AC_SEARCH_LIBS is the recommended macro for these checks, unfortunately,
we use AC_CHECK_LIB instead, and even AC_CHECK_FUNC, when only one
AC_SEARCH_LIBS would be enough.
This wrapper macro is used much like PKG_CHECK_MODULES, as it defines
(and AC_SUBST) the PREFIX_LIBS variable itself.
It also avoids adding unnecessary stuff to LIBS.
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Tested-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
The fix/check in 34d59859 is incomplete.
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
zuctest is another clock_gettime() user that fails to link against librt when
necessary.
Instead of adding another -lrt LDADD entry i've opted for the saner way and
converted the check to a configure test that will set CLOCK_GETTIME_LIBS
appropiately and replaced all instances of -lrt with it.
Built-tested against old and new glibc.
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
When a test destroys a wl_surface, it is still possible to get events
referring to the destroyed surface. The surface in such cases will be
NULL.
Handle NULL surface gracefully in keyboard and pointer enter/leave
handlers. Touch-down handler is already NULL-safe.
This fixes a SEGV in a test I am writing for wp_viewport.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Patch b00c79b587 forgot to update the
global interface name to look for. Fix it.
This makes weston-info report the presentation clock again.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
The focus_client pointer may be NULL here if the focused client has no
pointer resources. To avoid a crash, NULL check focus client before
proceeding to send the events.
https://bugs.freedesktop.org/show_bug.cgi?id=94899
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Mike Blumenkrantz <zmike@osg.samsung.com>
If the version of the source object is old enough to not have
wl_data_source.set_actions() the current action would never be updated
since source->set_actions would never be set.
To fix this, instead of checking whether source->set_actions before
proceeding with updating the current action, just always update the
action when we know all parts are valid dnd data device objects.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Mike Blumenkrantz <zmike@osg.samsung.com>
Reviewed-by: Carlos Garnacho <carlosg@gnome.org>
On client destruction, the shell object may be destroyed before the
shell surface objects. If this happens to two surfaces of the same
client, and one surface being destroyed results in the focus being
switched to the other, this would trigger a ping event.
The ping event sending function relies on having a valid owner, and if
the shell would be destoryed prior to the shell surface, we'd crash in
this function.
Solve this by unsetting the owner pointer when the shell client goes
away and early out in the ping event sending function if the owner is
gone.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Mike Blumenkrantz <zmike@osg.samsung.com>
refactor configuration API of headless-backend
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
v6:
- Define version number in the header
- Don't use leading underscores in header guards
- Add stub config_init_to_defaults()
- Allocate config on stack
- Drop unused display_name parameter
- Add error message when config is invalid
- Install compositor-headless.h and list it in headless-backend sources
v5:
- Update to current trunk
- Fixed typo 'struct weston_wayland_backend_config'
- Dropped unused variables
- Dropped weston_headless_backend_config_create() in favor of
directly zalloc'ing the object
- Dropped weston_headless_backend_load() in favor of the more
generalized load_backend_new().
- Dropped typedef from header
- Restored use of 'backend_init' entry point
- Backend_init() takes a base weston_backend_config object
- Renamed 'param' to 'config' in a few places for consistency
- Renamed 'headless_options' variable to 'options for consistency
- Version the base struct
- Free config on error
- Don't free config during backend_init normal operations
- Adjust header ordering
- Make header guard naming consistent with other headers
- Light reformatting for code style and consistency with other
backend config patches
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
[Pekka: rebased to apply before drm and x11 backends]
[Pekka: squashed in the headless part of "Enforce destruction of all
backend config objects after initialization"]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Split from the patch "Enforce destruction of all backend config objects
after initialization".
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This reverts commit 5ffbfffaf7.
Restore load_backend_new() for use with libweston backend configuration.
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
With this struct versioning, it is possible to add new options without
breaking the ABI, as long as all additions are made to the end of a
struct and nothing existing is modified or removed. When things are
added, the structure's size will increase, and we'll use this size as
our minor version number. If existing things need to be changed, then
the major version, struct_version, is incremented to indicate the ABI
break.
From our call sites in main these major and minor version will be
recorded as struct_version and struct_size. Each backend will then
verify these against its own assumptions. So long as the backend's
struct is equal or larger than what was passed in and the major versions
are equal, we're good; but if it is larger, then this is a fatal error.
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
v6:
- Document refs for alternatives/assumptions for backend configs
v5:
- Move the header changes to a pre-requisite patch from the drm backend
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
[Pekka: bring back the archive links Bryce looked up.]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
SYSTEMD_DAEMON_LIBS does not belong in CFLAGS, but SYSTEMD_DAEMON_CFLAGS
does. Fix that.
Add the missing COMPOSITOR_CFLAGS. Otherwise compiling the plugin will
use the system wayland-server.h when it should be using the one pointed
to by pkg-config.
The latter fixes the build for me, as my system libwayland-server is
older than what Weston and this plugin require, and the correct version
is only found in my install $prefix.
Cc: Egor Starkov <egor.starkov@ge.com>
Cc: Eugen Friedrich <efriedrich@de.adit-jv.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
On_layer of ivi_layout_surface should be NULL in the layer_destroy.
Previous code might access to removed ivilayer and cause SEGV.
Signed-off-by: Wataru Natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Weston-info was accidentally rounding refresh rates to integer Hz.
Fix it to print 3 decimals, as the protocol carries exactly that.
Reported-by: Michel Dänzer <michel@daenzer.net>
Cc: John Galt <johngaltfirstrun@gmail.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Systemd provides a feature of socket-based activation, details in [1]
This commit adds an implementation to check if sockets were provided by
systemd and adds this as an additional socket to wayland display.
before adding sockets are checked for the correctness:
only AF_UNIX of type SOCK_STREAM are accepted
This is usefull for early rendering use-cases where weston and
early-rendering-application can be started parallel.
[1] https://www.freedesktop.org/software/systemd/man/systemd.socket.html
Signed-off-by: Eugen Friedrich <efriedrich@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>