X11 is the only backend that still used the input event loop.
This patch is an identical rewrite of
6deb09ef8a which was then reverted in
3bebe6461a for reasons unrecorded. This
patch is also the revert of 22ba60e514.
Originally input devices were moved into their own event loop in
7ea10864c2 and the reason for that is
explained in 7dbf5e2ea7.
The idea behind the input event loop was that it would be beneficial to
process and relay input events to clients just once during an output
repaint cycle, because clients cannot update the image on screen any
faster anyway. All input events also carry a timestamp, so we didn't
lose any timing information. This was supposed to save power by reducing
the process wake-ups and context switches. There was also a mention of
reducing lag.
However, the concept of an output repaint loop does not really work out
when you have several outputs, but the input devices are not exclusive
to a certain output.
The logic for driving the input event loop in Weston core was written to
assume a single output. When you have multiple outputs with independent
repaint cycles, the input event loop handling becomes fairly random, one
output freezes input while another output thaws it, etc.
The DRM backend stopped using the input event loop when it started using
the libinput input backend, which became the default in
3f5e906268, and the old code was finally
ripped out in 823ad33ef3.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Add more sanity checks to get_ivi_shell_surface() just in case.
If the configure hook is set, we must always have non-NULL
configure_private.
Check the ivi_shell_surface matches the surface.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Eugen Friedrich <friedrix@gmail.com>
This should not get called unless there is an ivi_shell_surface.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Eugen Friedrich <friedrix@gmail.com>
Copied from desktop-shell/input-panel.c, add a label function for the
input panel.
This patch strictly reduces the difference between input-panel.c and
input-panel-ivi.c.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Eugen Friedrich <friedrix@gmail.com>
To be used by the Weston timeline feature for identifying surfaces in a
trace. The 'get_label' functionality can also be used by any debugging
code, too.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Eugen Friedrich <friedrix@gmail.com>
The controller plugins use IVI Layout API with weston outputs.
Therefore, this API is not required.
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
The controller plugins does not use ivi screens for IVI layout APIs.
They use weston outputs directly. Therefore, this API is unnecessary.
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
It is an internal API, which returns ivi_layout_screen
for a pregiven weston_output.
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
IVI layout APIs now are called with weston_output pointers,
instead of ivi_layout_screen pointers.
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
The compositor data struct already has a list of weston outputs.
Therefore, this API is not required.
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
The controller plugins can get the screen resolution directly from
weston output. Therefore, this API is not required.
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
ivi-screen does not have an id. IVI layout implementation is using
id of weston output. Therefore, this API is unnecessary.
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
This patch is a further step in the wl_fixed_t internal sanitization.
It changes the notify_* functions to take doubles instead of wl_fixed_t
but does not change how these are stored in the various input structs
yet, except for weston_pointer_axis_event.
However this already allows to remove all wl_fixed_t usage in places
like the libinput or the x11 backend.
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
In preparation for follow-on changes to support frame presentation
through EGLDevice+EGLOutput, this change includes the following:
- Rename drm_backend::format to gbm_format
- Rename drm_output::format to gbm_format
- Rename drm_output::surface to gbm_surface
- Rename drm_output::cursor_bo to gbm_cursor_bo
Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com>
Reviewed-by: Andy Ritger <aritger@nvidia.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
[Pekka: trivial rebase out of the series]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Using strstr(3) for checking for extensions is an error-prone mechanism
as extension names can be prefixes of other extension names (see
https://www.opengl.org/registry/doc/rules.html#using).
This change implements the check_extension() function to properly check
for an extension and replaces all usages of strstr(3).
Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com>
Reviewed-by: Andy Ritger <aritger@nvidia.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
[Pekka: move 'bool' to the same line with 'static']
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
The width of the first base layer is used for all panels.
Every display has a base layer which is as big as the
display. Therefore, it is wrong to use the width of the
first base layer for all panels, because every display
could have a different resolution.
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
In current implementation, the size of the first application
layer is used for the background image of a display.
This is wrong because:
1. The background surface should be fullscreen.
2. Each display could have different resolution.
We should use the size of the base layer of each display
for the background image.
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Avoid a crash because listener is NULL.
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-By: David Fort <contact@hardening-consulting.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
current_mode is already the pointer, taking the address of it is wrong.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94562
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
[Pekka: rewrote the patch]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Switches from inline to pre-processor definitions in order to utilize
__FILE__ and __LINE__ from the .c file in order to display the location
of memory allocation failures when failing.
Now xmalloc, et al calls will produce:
[weston-info] clients/weston-info.c:714: out of memory (1024)
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Direct fail_on_null calls now produce output like:
[weston-info] clients/weston-info.c:714: out of memory
xmalloc, et al produce output on failure like:
[weston-info] out of memory (-1)
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
It is not necessary check the ivi-id of pregiven objects (layer or
surface). Traversing the list of all objects is sure to find the exact
same pointer we start with, bugs aside.
The controller modules are responsible for providing valid pointers. We
cannot protect from invalid pointers anyway.
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
[Pekka: fix subject, add commit message]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
It is not necessary check the ivi-id of pregiven objects (layer or
surface). Traversing the list of all objects is sure to find the exact
same pointer we start with, bugs aside.
The controller modules are responsible for providing valid pointers. We
cannot protect from invalid pointers anyway.
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
[Pekka: commit message]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
It is not necessary check the ivi-id of pregiven objects (layer or
surface). Traversing the list of all objects is sure to find the exact
same pointer we start with, bugs aside.
The controller modules are responsible for providing valid pointers. We
cannot protect from invalid pointers anyway.
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
[Pekka: commit message]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
It is not necessary check the ivi-id of pregiven objects (layer or
surface). Traversing the list of all objects is sure to find the exact
same pointer we start with, bugs aside.
The controller modules are responsible for providing valid pointers. We
cannot protect from invalid pointers anyway.
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
[Pekka: commit message]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
It is not necessary check the ivi-id of pregiven objects (layer or
surface). Traversing the list of all objects is sure to find the exact
same pointer we start with, bugs aside.
The controller modules are responsible for providing valid pointers. We
cannot protect from invalid pointers anyway.
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
[Pekka: commit message]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
In all my rebases, this got accidentally left behind. The implementation
was removed in 4a7503976b but
32ca791df8 reintroduced it.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This new header encapsulates the API that ivi-layout offers to
ivi-shell.c to call.
ivi-shell.c no longer uses ivi-layout-private.h. This limits the
ivi-layout internal structures to just ivi-layout code.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Emre Ucan <eucan@de.adit-jv.com>
Now that ivi-layout calls directly into ivi-shell.c, this signal is no
longer used. Remove it.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Emre Ucan <eucan@de.adit-jv.com>
For some reason, it seems that ivi-layout.c has tried hard to avoid
calling directly into ivi-shell.c. This means there is a jump through
hoops just to get the configure event sent to the clients. Ivi-shell
registers a listener for a ivi-layout signal for sending the event.
Instead, let ivi-layout.c call directly into ivi-shell.c, and expose a
function to send out the configure events. This reduces some confusion
on who calls what.
The main idea though is that this makes ivi-shell.c not depend on struct
ivi_layout_surface fields directly anymore. In following patches,
ivi_layout_surface can be made opaque for ivi-shell.c.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Emre Ucan <eucan@de.adit-jv.com>
the `shm_format` function seems to assume the `wl_shm_format`
enum has bit-exclusive enumerations which is not true.
Signed-off-by: Murray Calavera <murray.calavera@gmail.com>
[Pekka: fix whitespace with an 'if'.]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
It's our standard practice. This file will get used a bit more in the
future.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Every .c file must include config.h as the first thing.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Sometimes weston-simple-egl aborts in create_surface
under some conditions. It is because wl_display_dispatch()
may not be enough to make sure we have all requried objects.
Can be modeled by wldbg:
$ wldbg -i weston-simple-egl
(wldbg) b re get_registry
(wldbg) c
(wldbg) c
After these steps the weston-simple-egl aborts, because
it has not got shell neither ivi-shell objects
Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
The content observer notification struct and its
set API (ivi_layout_surface_set_content_observer)
are removed. Because they are unused.
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
If surface transitions are not removed when surface is being removed, it
can lead to crash later when transition will finish, as it will try to
reference already freed memory.
This change exposes function that can remove all existing transitions
for given surface and it is being called during surface cleanup.
Signed-off-by: Mateusz Polrola <mateuszx.potrola@intel.com>
Reviewed-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This patch enhances the panel clock by adding a config file
option which can be used to either disable the clock or make
it also show seconds in the current clock format.
v2: Implement suggestions from Pekka:
- Include Signed-off-by
- Coding style fixes
- Implement clock widget allocation by using
width from cairo_text_extents
- Highlight config option values in man page
v3: Implement suggestions from Pekka and Bryce:
- Use CLOCK_FORMAT_* instead of FORMAT_* in the enum
- Switch to using fixed clock widget size instead
of one returned from cairo_text_extents
- Fixes to config option highlighting in the man page
v4: Implement more suggestions from Pekka and Bryce:
- Improve patch changelog
- Move the check for CLOCK_FORMAT_NONE into the
caller function
- Fix a memory leak in panel_create introduced by
previous revision of this patch
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57583
Signed-off-by: Armin Krezović <armin.krezovic@fet.ba>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This allows the header to be consumed by C++ compilers, because C++ does
away with C's implicit cast from (void*).
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
weston allows both short and long style options to take arguments. In
the case of short options, allow an optional space between the option
name and value. E.g., previously you could launch weston this way:
weston -i2 -cmyconfig.ini
now you can also launch it like this:
weston -i 2 -c myconfig.ini
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
It doesn’t make sense to fail the entire build when jpeglib isn’t
present, so this commit makes it optional just like libwebp in the
previous one, disabled with --without-jpeg and forced with --with-jpeg.
Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Remove the unstable presentation_timing.xml file, and use
presentation-time.xml from wayland-protocols instead to generate all the
Presentation extension bindings.
The following renames are done according to the XML changes:
- generated header includes
- enum constants and macros prefixed with WP_
- interface symbol names prefixed with wp_
- protocol API calls prefixed with wp_
Clients use wp_presentation_interface.name rather than hardcoding the
global interface name: presentation-shm, weston-info, presentation-test.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
[Pekka: updated wayland-protocols dependency to 1.2]