Commit Graph

1008 Commits

Author SHA1 Message Date
Leandro Ribeiro 993920dd81 drm-backend: rename drm_backend_update_heads() to drm_backend_update_connectors()
To deal with appearing/disappearing connectors we have the
function drm_backend_update_heads(). Rename it to
drm_backend_update_connectors(), as it is more in line with
what it does.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2020-09-16 14:03:18 +00:00
Leandro Ribeiro 4a5b67a5db drm-backend: update description of drm_head_create() and drm_head_update_info()
In case of success, drm_head_create() and drm_head_update_info()
take ownership of a connector. As this is an important
information, update the description of these functions
to include this.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2020-09-16 14:03:18 +00:00
Leandro Ribeiro 6794164bd9 drm-backend: move drm_head management from drm_connector_assign_connector_info() to drm_head_update_info()
The function drm_connector_assign_connector_info() should
not be calling functions to handle drm_head, as connectors
and heads are not the same thing after patch "drm-backend:
move connector data from struct drm_head to struct drm_connector".

Move drm_head specific calls to drm_head_update_info(). This
is more in line with the hierarchy of the objects and also
allow us to drop drm_head pointer from drm_connector.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2020-09-16 14:03:18 +00:00
Leandro Ribeiro 7086396f75 drm-backend: reduce number of drmModeGetConnector() calls
Instead of calling drmModeGetConnector() in drm_head_create()
and drm_head_update_info(), it is better to call it in
drm_backend_create_heads() and drm_backend_update_heads().
Then we can pass the drmModeConnector object as parameter.
This does not change the behavior of the code, but help us
to avoid unnecessarily calling drmModeGetConnector().

Besides that, in the future we will have support for writeback
connectors. And so drm_backend_create_heads() will be reworked
to also populate a list of writeback connectors. To make this
work, we are going to need to know if a connector is of the
writeback type or not, to know if we should call drm_head_create()
or drm_writeback_create(). We can only tell the type of connector
if we have the drmModeConnector object.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2020-09-16 14:03:18 +00:00
Leandro Ribeiro 702fbf7282 drm-backend: cache drmModeObjectProperties for connectors
Instead of calling drmModeObjectGetProperties() each time that we need
the connector properties, it is better to keep a reference for it in
struct drm_connector. This reference is only updated when is necessary.
E.g. hotplug events.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2020-09-16 14:03:18 +00:00
Leandro Ribeiro e636990de3 drm-backend: move connector data from struct drm_head to struct drm_connector
This is the first step in order to add support for writeback
connector in Weston. We don't want writeback connectors data
to be stored in 'struct drm_head' objects, as these objects are
used to output content and we should not use writeback connectors
for this purpose.

The writeback connectors will be stored in a new 'struct
drm_writeback', but the connector data is common between
'struct drm_head' and 'struct drm_writeback'.

So move connector data from 'struct drm_head' to 'struct
drm_connector'. This helps to avoid code duplication and makes
the code clearer.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2020-09-16 14:03:18 +00:00
Leandro Ribeiro bb33f90658 drm-backend: free old connector props before replacing it with newer data
In commit c1e89ba2 "compositor-drm: move connector fields into
drm_head" the function drm_head_assign_connector_info() was
introduced. By that time it was being used only at drm_head
creation, and not to handle connector changes.

In d2e6242e "compositor-drm: create heads for all connectors"
it started to be used also to handle connector changes. In
this scenario we replace old connector props with newer data.
Before doing this, free the old connector data to avoid memory
leak.

Note that as drm_property_info_free() is safe to be called on
a zero-initialized struct, we can call it even in the case where
the head is being created and there are no props yet.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2020-09-16 14:03:18 +00:00
Pekka Paalanen 3d6721eb15 drm-backend: fix deinit_planes
Commit "drm-backend: move code to init/deinit planes to specific
functions" lost a chunk of drm_output_deinit() when moving code into
drm_output_deinit_planes(). Reinstate the missing chunk.

This fixes an endless loop over weston_compositor::plane_list when you
start with three monitors connected, unplug and re-plug one.

Fixes: 3be23eff99

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-09-16 15:04:04 +03:00
Leandro Ribeiro de1b77e7cd drm-backend: do not set output->crtc to NULL in drm_output_init_planes() failure
After commit "drm-backend: move code to init/deinit planes to specific
functions" we have a specific function to init planes. As this function
does not set output->crtc, it should not set it to NULL in case of
failure. This is caller's responsibility.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2020-09-08 10:05:26 -03:00
Leandro Ribeiro 05cecc8ef3 drm-backend: cosmetic changes to make the code easier to read
There are some places where we can make some cosmetic changes
to make code simpler and easier to read. Make these cosmetic
changes. Note that they do not change the code behavior.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2020-09-07 13:08:18 -03:00
Leandro Ribeiro 3be23eff99 drm-backend: move code to init/deinit planes to specific functions
The code to init/deinit scanout and cursor planes was in
drm_output_init() and drm_output_deinit(). Move this code
to specific functions drm_output_init_planes() and
drm_output_deinit_planes(), as it makes the code clearer
and easier to maintain.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2020-09-07 13:06:14 -03:00
Leandro Ribeiro 744c0cbb32 drm-backend: drop unused_crtcs from struct drm_backend
Now that we have a CRTC list in the DRM-backend, we can
iterate through it and look for the CRTCs that do not have
assigned outputs in order to find unused CRTCS.

So we can drop unused_crtcs from struct drm_backend and also
drop the functions drm_backend_update_unused_outputs() and
wl_array_remove_uint32().

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2020-09-07 13:04:06 -03:00
Leandro Ribeiro b00d1a2efb drm-backend: move CRTC data from struct drm_output to new struct drm_crtc
There are no 'struct drm_output' for CRTCs that are not active.
Also, CRTC data lives in 'struct drm_output'. This is causing
us some trouble, as the DRM-backend needs to program those
unnactive CRTCs to be off.

If the DRM-backend had the reference for every CRTC (being
active or not), it would make certain functions (e.g.
drm_pending_state_apply_atomic()) more simple and efficient.

Move CRTC data from 'struct drm_output' to 'struct drm_crtc',
as this is the first step to allow the DRM-backend to have
references for every CRTC.

Also, add list of CRTCs to DRM-backend object. Now the
DRM-backend is responsible for allocating/deallocating the CRTC
objects. The outputs will only reference, init and fini the CRTCs
in this list.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2020-09-07 12:39:10 -03:00
Daniel Stone ebcf4f35b4 drm/state-propose: Flatten and clarify control flow
Try to make drm_output_state_propose a little more clear by reducing
divergence between plane and renderer modes towards the end, removing
a possibly-surprising conditional continue.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2020-09-04 11:04:26 +00:00
Daniel Stone 71e6ba5c06 drm/state-propose: Fix fix typo typo
Signed-off-by: Daniel Stone <daniels@collabora.com>
2020-09-04 11:04:26 +00:00
Daniel Stone 8ca5d73355 drm/state-propose: Reduce variable scope
Reduce the scope of surface_overlap to where it's actually used, which
is only in the per-view loop, where it gets initialised and destroyed
every time.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2020-09-04 11:04:26 +00:00
Daniel Stone b625cdcf20 drm/state-propose: Remove special casing for cursor plane
Previously we assumed that cursor planes occluded nothing and would
always be blended, but overlay and scanout planes would always occlude
what's behind them. This is not actually true, as we can support alpha
blending on any kind of plane type now.

Remove the special case, which might hopefully fix some weird display
issues along the way. (Noticed by inspection.)

Signed-off-by: Daniel Stone <daniels@collabora.com>
2020-09-04 11:04:26 +00:00
Daniel Stone 9217ec9c6c drm/state-propose: Remove unused planes_region member
We used to use planes_region for the output regions which were being
displayed on hardware planes; before we grew zpos awareness, we couldn't
have any planes overlapping with each other, since the ordering would be
undefined.

Since the zpos awareness though, this region is unused, so we can just
remove it.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2020-09-04 11:04:26 +00:00
Michael Olbrich 0e4f097d08 compositor: clip the opaque region with the scissor area
The opaque region is used to determine where the views underneath the current
view must be drawn. If the opaque is not clipped, then the area that is part of
the opaque region but not part of the scissor area is not drawn at all.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2020-09-04 11:01:26 +00:00
Michael Olbrich cb04f9894f compositor: update scissor region before using it
Subsurfaces inherit the scissor region from the parent surface. Currently
the region is updated at the end of weston_view_update_transform(). As a
result, the old region is used to clip the transform.boundingbox of the
subsurface.

Change the order to update the scissor region after the transform.matrix is
updated but before it is used.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2020-09-04 11:01:26 +00:00
Marius Vlad 67b382ccdc compositor: Avoid using weston_log() in weston_view_is_opaque()
As from commit b7e5f10bf4, weston_view_is_opaque() is called from
debug_scene_graph_cb(), which on its own represents a (different)
scope. By default, we already have a subscriber for the 'log' scope,
which will cause a harmless, yet spurious, message.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2020-08-24 14:19:02 +03:00
Michael Olbrich d70e712c2f drm: always check the repaint_status in update_complete
Initially finish_frame() was never called in drm_output_update_complete() for
'dpms_off_pending = true'. This is wrong for repaint_status ==
REPAINT_AWAITING_COMPLETION and that was fixed in
68d49d772c ("compositor-drm: run finish_frame when
dpms is turned off in update_complete").
However finish_frame() may now be called for repaint_status !=
REPAINT_AWAITING_COMPLETION, which is not allowed and results in a failed
assertion.

Fix this by checking dpms and repaint_status unconditionally.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2020-08-19 07:35:14 +02:00
Marius Vlad 5130a8c21a backend-drm: Correctly tear down the DRM backend
It seem that we skipped to put back in TEXT mode the tty, in case a DRM
device node wasn't present at that time, or it isn't present at all. This
orders the destroy part correctly as to handle that case as well.

As a side effect, as the tty will still be set to GRAPHICS mode we will
require a manual change of the tty number, which might be not possible
on all systems. Properly putting back the tty to TEXT mode should avoid
that, and allows to re-use the same tty no in case the DRM device has
been created at a later point in time.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2020-08-18 12:59:50 +03:00
Andreas Heynig 2592d6591e libweston/launcher-direct.c: do not fail if already in graphics mode
In case of a crash tty remains in graphic mode. This change allows to restart weston without
taking care of the actual tty mode.

Signed-off-by: ahe <Andreas.Heynig@meetwise.com>
2020-08-17 11:59:39 +00:00
Stefan Agner 465ab2cd92 backend-drm: allow to disable GBM modifiers
Allow to disable GBM modifiers at runtime using the environment variable
WESTON_DISABLE_GBM_MODIFIERS.

This can be useful for debugging or when modifiers cause issues, e.g. in
case modifiers use higher memory bandwidth and hence impose a lower
resolution limit as it is the case with Intel Kaby Lake graphics.

Related to: https://gitlab.freedesktop.org/wayland/weston/-/issues/404
Signed-off-by: Stefan Agner <stefan@agner.ch>
2020-08-17 10:17:30 +00:00
Michael Olbrich 43ebb7e25a backend-drm: the GL renderer is a hard requirement for DRM virtual outputs
Building fails without it. So don't just warn about it but fail immediately.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2020-08-17 10:12:54 +00:00
Michael Olbrich 27fb564a19 backend-drm: build DRM virtual support when the pipewire plugin is enabled
The pipewire plugin uses this API as well, not just the remoting plugin. So
enable it if either is enabled.

And disable pipewire in the no-gl-renderer CI build. The virtual outputs don't
work without it.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2020-08-17 10:12:54 +00:00
Michael Olbrich 3097acc702 backend-drm: reorder plane checks to avoid unnecessary rendering
If a surface is not visible, then is does not matter if the view is on multiple
outputs. It will be skipped anyways when the output is rendered.

So check first if the surface is acually visible on the output before doing any
checks that might force rendering. This avoids unnecessary rendering.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2020-08-17 09:53:38 +00:00
Alexandros Frantzis 53a71cb186 drm: Reset associated universal plane states when finalizing a crtc
When dissociating a universal plane from a crtc, we currently don't
reset the current state of the plane (plane->state_cur). When attempting
to use this plane in the future, we can run into invalid memory accesses
due to left over associations with potentially freed drm backend
objects. This commit resets the state of the scanout and cursor
universal planes associated with a crtc.

The following scenario exhibits the problem:

1. Start a (fullscreen) client that is suitable for and assigned to
   the scanout plane. The plane's state_cur->output value is set.
2. Unplug the monitor: the scanout plane is "released" but still
   maintains the state_cur->output association.
3. Replug the monitor: the plane is deemed unavailable due to an
   existing, albeit invalid, state_cur->output value. Note the memory
   errors trying to access the drm_output which was freed at step (2).

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
2020-08-17 09:44:45 +00:00
Alexandros Frantzis 9975134593 drm: Introduce drm_plane_reset_state() helper function
Introduce a helper function to reset the current state of a drm_plane.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
2020-08-17 09:44:45 +00:00
Michael Olbrich ad41ad968a gl-renderer: remove incorrect assertion
The refcount is not zero if the corresponding buffer is attached to multiple
surfaces.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2020-08-13 18:50:57 +00:00
Michael Olbrich c5ea495f7a compositor: ignore views on other outputs during compositor_accumulate_damage()
compositor_accumulate_damage() is called for each output during repaint.
The DRM backend will only set keep_buffer for the surfaces that are visible on
the current output. So a buffer_ref is released that may still be needed. When
the output that shows the surface is repainted, the buffer_ref is gone and the
surface cannot be put on a plane.

Ignore all surfaces that are not visible on the current output to avoid this.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2020-08-12 11:03:43 +00:00
Michael Olbrich b7e5f10bf4 compositor: use weston_view_is_opaque() to check for opacity in debug_scene_view_print()
Currently the debug output for 'drm-backend' can be confusing. In the output of
debug_scene_view_print() views may be listed as 'not opaque' but later, during
plane assignment, other views underneath such a view is reported as 'occluded on
our output'.
This happens because weston_view_is_opaque() has some extra checks to determine
if a view is fully opaque, such as 'is_opaque' provided by the renderer for
formats that have no alpha channel.

Use weston_view_is_opaque() in debug_scene_view_print() as well to get more
accurate results.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2020-08-11 16:41:14 +02:00
Michael Olbrich 3ac911f69b drm: remove duplicate function declarations
These functions are all declared twice in the same file. Remove on of the two
declarations.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2020-08-06 10:22:18 +02:00
Leandro Ribeiro ea4d13b3e3 drm-backend: remove log that advertises universal planes support
There's a log that advertises support for universal planes. That
can make users think there's something wrong with Weston or their
systems when universal planes are not supported, but that's not
the case. Remove this log from the code.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2020-07-28 11:13:53 -03:00
Kirill Chibisov c46c70dac8 libweston: Send wl_keyboard.modifiers after wl_keyboard.enter
The core Wayland protocol explicitly states that wl_keyboard.modifiers
must be send after wl_keyboard.enter.

This commit also changes the behavior of `seat_get_keyboard` to not
send `wl_keyboard.modifiers` in case where seat had pointer focus,
but not keyboard one.

Signed-off-by: Kirill Chibisov <contact@kchibisov.com>
2020-07-09 17:47:11 +03:00
Leandro Ribeiro 887a7e5717 launcher: do not touch VT/tty while using non-default seat
Launcher-direct does not allow us to run using a different
seat from the default seat0. This happens because VTs are
only exposed to the default seat, and users that are on
non-default seat should not touch VTs.

Add check in launcher-direct to skip VT/tty management if user
is running on a non-default seat.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2020-06-25 10:17:31 +00:00
James Hilliard c8feaae7d2 libweston: don't clean up surface role
Surface roles are permanent, so it should not be cleaned up.

Fixes: #409
weston: ../libweston/compositor.c:4094: weston_surface_set_role: Assertion `role_name' failed.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
2020-06-12 09:23:11 +00:00
Tomek Bury ba54831100 gl-renderer: fix pbuffer surface creation
When there's neither configless nor surfaceless EGL extension
(i.e. not a Mesa driver), Weston falls back to a dummy pbuffer surface.

Weston attempts to find for that surface an EGL config but uses a NULL
array of pixel formats. This fails with the following messages:

 EGL_KHR_surfaceless_context unavailable. Trying PbufferSurface
 Found an EGLConfig matching { pbf;  } but it is not usable because
    neither EGL_KHR_no_config_context nor EGL_MESA_configless_context
    are supported by EGL.
 failed to choose EGL config for PbufferSurface
 EGL error state: EGL_SUCCESS (0x3000)
 Failed to initialise the GL renderer;

Signed-off-by: Tomek Bury <tomek.bury@broadcom.com>
2020-06-11 10:52:22 +01:00
Scott Anderson 15c603caa6 drm: Fix leak of damage blob id
This moves the creation of the blob to be earlier, to when the damage is
calculated. It replaces the damage tracked inside of the plane state
with the blob id itself.

This should stop creating new blob ids for TEST_ONLY commits, and them
being leaked in general, as the blob ids are now freed with the plane
state.

The FB_DAMAGE_CLIPS property is now always set if it's supported, and
will be 0 in the case that we have no damage information, which
signifies full damage to the kernel.

Signed-off-by: Scott Anderson <scott.anderson@collabora.com>
2020-06-04 09:52:16 +00:00
Leandro Ribeiro e57d8ae818 drm-backend: add --continue-without-input command line option to DRM-backend
In the test suite we may want to run a DRM-backend test on a
non-default seat, which may not have a input device associated.
Weston's default behavior is to not open if input devices are
not found, as it may cause troubles. For instance, Weston can
open but if no input device is set than the user can not
interact or leave it.

Add flag --continue-without-input to DRM-backend so we can run
these types of tests with no input. Notice that this won't force
the compositor to skip opening a input device if it finds it on
the non-default seat.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2020-06-02 13:47:15 +00:00
Pekka Paalanen 50aa3a76c0 timeline: convert vblank timestamp to MONOTONIC
All timeline event timestamps are in CLOCK_MONOTONIC already. DRM KMS
timestamps are practically guaranteed to be CLOCK_MONOTONIC too, even though
presentation clock could theoretically be something else. For other backends,
the presentation clock is likely CLOCK_MONOTONIC_RAW due to
weston_compositor_set_presentation_clock_software().

This patch ensures that the recorded vblank timestamp is in CLOCK_MONOTONIC.
Otherwise interpreting the timeline traces might be difficult to do accurately,
since it would be hard to recover the relationship between the presentation
clock and timeline event timestamps.

The time conversion routine is the simplest possible, I don't think we need any
more accurate conversion for timeline purposes. Besides, DRM-backend is the
only backend where the timings actually matter, the other backends are
software-timed anyway.

Since the clock domain of the "vblank" attribute potentially changes, the
attribute is renamed. Wesgr never used this attribute.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-05-28 16:34:48 +03:00
Michael Olbrich 40c519a3e6 gl-renderer: query EGL to determine if GL_TEXTURE_EXTERNAL_OES should be used
Using the number of planes to determine if GL_TEXTURE_EXTERNAL_OES should be
used is incorrect with some modifiers: For example RGBA with a
I915_FORMAT_MOD_Y_TILED_CCS modifier has two planes.

Use eglQueryDmaBufModifiersEXT() to query if the current format/modifier only
supports GL_TEXTURE_EXTERNAL_OES.

Use the current code as fallback of modifiers are not supported.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2020-05-25 11:06:28 +00:00
Peter Hutterer a2086bba66 libweston: replace 0 with the enum value for the xkb init flags
No functional changes, this is cosmetics only.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-05-14 11:49:54 +10:00
Ken C 6b64d39ab7 set SURFACE_BITS_COMMAND cmdType explicitly 2020-05-12 07:30:20 +00:00
Michael Olbrich ef5f3233f9 compositor: fix endless recursion in scene-graph printing
If a surface has subsurfaces then the surface itself is in the subsurface
list. To avoid printing it again there is a check to skip the child view,
if it is the same as the current view.

However, this fails when a surface with subsurfaces has two (or more) views:
The check to skip the parent fails for the other view and the two views are
printed again and again until a stack overflow occurs.

So instead check if the parent view of the subsurface view is the current
view. This way, any view that does not belong to a real subsurface is
skipped.

As a side effect, this ensures that each view of the subsurfaces is only
printed once at the correct place in the hierarchy.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2020-04-29 09:17:19 +02:00
Tomohito Esaki 51048463da drm: change timing to set color format for primary plane without universal plane
Without universal plane, the weston crashes with null pointer access in
set_gbm_format function because that function called before output
enable function. By changing timing to set color format for primary
plane in this case, this issue fixes.

Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
2020-03-30 17:43:20 +09:00
Daniel Stone 61abf35ec4 pixman-renderer: Replace output-create flags with struct
pixman_renderer_output_create currently takes a flags enum bitmask for
its options. Switch this to using a structure, so we can introduce other
non-boolean options.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2020-03-20 15:25:24 +00:00
Daniel Stone 786490cb53 gl-renderer: Replace pbuffer-create args with struct
gl_rendererer's output_pbuffer_create has a lot of arguments now. Add a
structure for the options to make it more clear what is what.
This is in preparation for adding bare-integer arguments which are ripe
for confusion when passing positional arguments.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2020-03-20 15:25:24 +00:00
Daniel Stone db6e6e1ec5 gl-renderer: Replace window-create args with struct
gl_rendererer's output_window_create has a lot of arguments now. Add a
structure for the options to make it more clear what is what.
This is in preparation for adding bare-integer arguments which are ripe
for confusion when passing positional arguments.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2020-03-20 15:25:24 +00:00
Daniel Stone c890c384c8 gl-renderer: Replace display-create args with struct
gl_rendererer's output_create has a lot of arguments now. Add a
structure for the options to make it more clear what is what.
This is in preparation for adding bare-integer arguments which are ripe
for confusion when passing positional arguments.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2020-03-20 15:25:24 +00:00
Daniel Stone f9a6162595 drm: Get renderer buffer size from drm_fb
The renderer buffer size is usually the same size as the current mode,
so we were taking the dimensions from the currently-set mode. However,
using current_mode is quite confusing in places when it comes to scale,
and it also hampers our ability to do mode switches, as well as to
introduce a future option which will let the renderer use a smaller
buffer than the output and display scaled.

Simply take the dimensions of the renderer's output buffer from the
buffer itself.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2020-03-20 15:25:24 +00:00
Daniel Stone 98d75e1b23 drm: Remove unnecessary condition in drm_output_render reuse
This condition inside drm_output_render() checks if we can reuse the
existing renderer buffer for the primary plane; this occurs in
mixed-mode composition where a client buffer promoted to a plane has
changed, but the primary plane is unchanged.

We accomplish this by checking if there is no damage on the
primary/renderer plane, and then if there is already a renderer buffer
active on the primary plane: in that case, we can reuse the buffer we
already have.

There was a further condition checking if the width and height were
identical. This was designed to prevent against issues on mode changes.
However, runtime mode changes are already quite broken, and a mode
change will also cause damage on the full plane. We can simply remove
this condition.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2020-03-20 15:25:24 +00:00
Daniel Stone 7fa97e66eb drm: Remove trailing whitespace
Signed-off-by: Daniel Stone <daniels@collabora.com>
2020-03-20 15:25:24 +00:00
Daniel Stone 76932e6b0f x11: Remove unnecessary NULL checks
Output and mode can never be NULL.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2020-03-20 15:25:24 +00:00
Daniel Stone cb481a66cd wayland-backend: Fully damage initial SHM buffer
In order to start the repaint loop, the Wayland backend tries to damage
the full SHM buffer, but doesn't actually damage the full area if we
have a frame.

Store the buffer's width and height alongside the buffer itself, so we
can damage the full area when required.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2020-03-18 11:33:52 +00:00
Pekka Paalanen 9f53edd461 pixman-renderer: half-fix bilinear sampling on edges
When weston-desktop-shell uses a solid color for the wallpaper, it creates a
1x1 buffer and uses wp_viewport to scale that up to fullscreen. It's a very
nice memory saving optimization.

If you also have output scale != buffer scale, it means pixman-renderer chooses
bilinear filter. Arguably pixman-renderer should choose bilinear filter also
when wp_viewport implies scaling, but it does not. As w-d-s always sets buffer
scale from output scale, triggering the bilinear filter needs some effort.

What happens when you sample with bilinear filter from a 1x1 buffer, stretching
it to cover a big area? Depends on the repeat mode. The default repeat mode is
NONE, which means that samples outside of the buffer come out as (0,0,0,0).
Bilinear filter makes it so that every sampling point on the 1x1 buffer except
the very center is actually a mixture of the pixel value and (0,0,0,0). The
resulting color is no longer opaque, but the renderer and damage tracking
assume it is. This leads to the issue 373.

Fix half of the issue by using repeat mode PAD which corresponds to OpenGL
CLAMP_TO_EDGE. GL-renderer already uses CLAMP_TO_EDGE always.

This is only a half-fix, because composite_clipped() cannot actually be fixed.
It relies on repeat mode NONE to work. It would need a whole different approach
to rendering potentially non-axis-aligned regions exactly like GL-renderer.

Fixes: https://gitlab.freedesktop.org/wayland/weston/issues/373

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-03-11 15:57:45 +02:00
Lucas Stach 72e7a1ed48 backend-drm: Parse KMS panel orientation property, apply to weston_head
The KMS 'panel orientation' property allows the driver to statically
declare a fixed rotation of an output device. Now that weston_head has a
transform member, plumb the KMS property through to weston_head so the
compositor can make a smarter choice out of the box.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
[daniels: Extracted from one of Lucas's patches]
Signed-off-by: Daniel Stone <daniels@collabora.com>
2020-03-06 21:50:38 +00:00
Lucas Stach a69cb711cc libweston: Add transform to weston_head
Like physical size, subpixel arrangement, etc, transform advises of a
physical transform of a head, if present.

This commit adds the transform member and setter to weston_head, however
it is currently unused.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
[daniels: Extracted from one of Lucas's patches.]
Signed-off-by: Daniel Stone <daniels@collabora.com>
2020-03-06 21:50:38 +00:00
Guillaume Champagne 467e6b9883 backend-rdp: enable undefined functions errors.
b_lundef was overriden for the RDP backend since it triggered linking
errors due to functions that were defined in a missing dependency. This
issue was fixed, so the override is removed. The global project's
linker parameters are now applied to the RDP backend.

Signed-off-by: Guillaume Champagne <champagne.guillaume.c@gmail.com>
2020-03-05 14:43:58 +00:00
Guillaume Champagne 7f42b350de backend-rdp: fix unresolved symbols errors
The RDP backend uses functions defined by the Windows Portable Runtime
library (WinPR). The library's code is contained within FreeRDP
repository, but it is packaged as its own library (seperate pkg-config
file).

WinPR is added as a dependency to the RDP backend. The version 2.0 is
choosen as the version to on since the backend depends on FreeRDP 2.0.

Signed-off-by: Guillaume Champagne <champagne.guillaume.c@gmail.com>
2020-03-05 14:43:58 +00:00
Pekka Paalanen 8060d826b7 Redefine output rotations
It was discovered in issue #99 that the implementations of the 90 and 270
degree rotations were actually the inverse of what the Wayland specification
spelled out. This patch fixes the libweston implementation to follow the
specification.

As a result, the behaviour of the the weston.ini transform key also changes. To
force all users to re-think their configuration, the transform key values are
also changed. Since Weston and libweston change their behaviour, the handling
of clients' buffer transform changes too.

All the functions had their 90/270 cases simply swapped, probably due to
confusion of whether WL_OUTPUT_TRANSFORM_* refers to rotating the monitor or
the content.

Hint: a key to understanding weston_matrix_rotate_xy(m, c, s) is that the
rotation matrix is formed as

  c -s
  s  c

that is, it's column-major. This fooled me at first.

Fixing window.c fixes weston-terminal and weston-transformed.

In simple-damage, window_get_transformed_ball() is fixed to follow the proper
transform definitions, but the fix to the viewport path in redraw() is purely
mechanical.  The viewport path looks broken to me in the presence of any
transform, but it is not this patch's job to fix it.

Screen-share fix just repeats the general code fix pattern, I did not even try
to understand that bit.

https://gitlab.freedesktop.org/wayland/weston/issues/99

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-02-27 11:08:48 +00:00
Pekka Paalanen 0df4477924 libweston: document weston_transformed_*()
Clarifies which direction the transformation happens. All exported function
need documentation.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-02-27 11:08:48 +00:00
Scott Anderson 4ed62d47cc gl-renderer: Move EGL display creation to egl-glue.c
It makes more sense for it to be there instead.

Signed-off-by: Scott Anderson <scott.anderson@collabora.com>
2020-02-18 18:11:26 +13:00
Scott Anderson 4ed58b1d47 gl-renderer: Move platform extension checks to EGL client setup
This removes the duplicate checks for EGL_EXT_platform_base.

Signed-off-by: Scott Anderson <scott.anderson@collabora.com>
2020-02-18 18:06:52 +13:00
Scott Anderson 7725415478 gl-renderer: Move get_platform_display to EGL client setup
This is to put more of the EGL client extension handling in the same
place. This also adds a boolean to check if EGL_EXT_platform_base is
supported, similar to other extensions we check.

Signed-off-by: Scott Anderson <scott.anderson@collabora.com>
2020-02-18 17:41:06 +13:00
Scott Anderson dddb592cfb gl-renderer: Move EGL client extension handling earlier
EGL client extensions are not tied to the EGLDisplay we create, and have
an effect on how we create the EGLDisplay. Since we're using this to
look for EGL_EXT_platform_base, it makes more sense for this to be near
the start of the GL renderer initialization.

Signed-off-by: Scott Anderson <scott.anderson@collabora.com>
2020-02-18 17:38:27 +13:00
Leandro Ribeiro d65483ec75 weston-log-wayland: make stream_destroy() use weston_log_subscriber_release()
Make stream_destroy() use weston_log_subscriber_release().
This avoids code duplication and allow us to destroy
weston_log_subscriber_get_only_subscription(), since it's
being used only in this case and it's internal.

Calls for weson_log_subscriber_release() leads to
weston_log_debug_wayland_to_destroy(), which should not
send an error event when the stream has already been closed.

Also, stream_destroy() shouldn't lead to an event error, as
it is a wl_resource destroy handler. So close the stream before
calling weston_log_subscriber_release() in stream_destroy()

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-02-10 10:53:50 +00:00
Leandro Ribeiro 97d2d69909 weston-log: share code between weston_log_scope_destroy() and weston_log_subscriber_release()
Both weston_log_scope_destroy() and weston_log_subscriber_release()
have calls for destroy_subscription(). We can move this call to
weston_log_subscription_destroy() without losing anything and
avoiding repetition.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-02-10 10:53:50 +00:00
Leandro Ribeiro 23491cd931 weston-log: destroy subscriptions with destruction of subscribers
The subscription is directly related to both the log scope and
the subscriber. It makes no sense to destroy one of them and
keep the subscriptions living.

We only had code to destroy subscription with
the destruction of log scopes. Add code to destroy
subscriptions with destruction of subscribers.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-02-10 10:53:50 +00:00
Leandro Ribeiro 1ded661aac weston-log: merge functions that destroy different types of subscribers
Log subscriber API is not type-safe. File and flight recorder
subscribers are created with functions that return
weston_log_subscriber objects. But there's a problem: to destroy
these objects you have to call the right function for each type
of subscriber, and a user calling the wrong destroy function
wouldn't get a warning.

Merge functions that destroy different types of subscribers, making
the log subscriber API type-safe.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-02-10 10:53:50 +00:00
Leandro Ribeiro 8c02ea1069 weston-log: rename weston_log_subscriber::destroy to destroy_subscription
weston_log_subscriber has a member named destroy. There are
other structs (weston_output, for instance) that have this
member, and by convention it is a pointer to a function
that destroys the struct.

In weston_log_subscriber it is being used to destroy
subscriptions of the debug protocol, and not the subscriber,
so this name is misleading. Rename it to destroy_subscription.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-02-10 10:53:50 +00:00
Pekka Paalanen 8fc4b59bfd weston-log-flight-rec: allow re-running a compositor
weston_primary_flight_recorder_ring_buffer needs to be cleared on destruction
of the subscriber it was assigned from so that a compositor and be re-executed
in-process (static variables do not get re-initialized automatically).

This will be used by the test harness when it will execute wet_main() multiple
times in the same process. Otherwise it would hit the assert in
weston_log_subscriber_create_flight_rec().

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-02-05 11:13:51 +00:00
Daniel Stone d76947b666 gl-renderer: Avoid double-free on init failure
If gl-renderer fails its initialisation, we return to compositor
teardown, which will try to free the renderer if ec->renderer was set.
This is unfortunate when we've already torn it down whilst failing
gl-renderer init, so just clear the renderer member so we don't try to
tear down twice.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reported-by: Emil Velikov <emil.velikov@collabora.com>
2020-02-03 20:01:21 +00:00
Daniel Stone 6d2e73b314 gl-renderer: Fail earlier if shader compilation fails
If we can't compile our shaders, there's no point trying to link them.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2020-02-03 20:00:54 +00:00
Stefan Agner da0cd688d6 launcher-weston-launch: avoid race condition when switching VT merge
When using weston-launch launcher deactivating the VT is sometimes
racy and leads to Weston still being displayed. The launcher-direct.c
backend makes sure that the session signal is emitted first, then DRM
master is dropped and finally the VT switch is acknowledged via
VT_RELDISP.

However, in the weston-launch case the session signal is emitted via
a socket message to the weston process, which might get handled a bit
later. This leads to dropping DRM master and acknowledging the VT
switch prematurely.

Add a socket message which allows weston to notify weston-launch that
the signal has been emitted and deactivating can be proceeded.

Signed-off-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2020-01-30 12:11:37 +00:00
Stefan Agner 10356a247b launcher-weston-launch: move send loop into separate function
Create a separate function handling the send loop. This allows to reuse
the same code later on.

Signed-off-by: Stefan Agner <stefan@agner.ch>
2020-01-30 12:11:37 +00:00
Stefan Agner bd1e39a787 weston-launch: reset tty properly
On weston-launch exit we see errors such as:
  failed to restore keyboard mode: Invalid argument
  failed to set KD_TEXT mode on tty: Invalid argument

This has been resolved by making sure the tty file descriptor
does not get closed. However, the ioctrl's KDSKBMODE/KDSETMODE
and VT_SETMODE still fail with -EIO:
  failed to restore keyboard mode: Input/output error
  failed to set KD_TEXT mode on tty: Input/output error

It turns out the reason for this lies in some very particular
behavior of the kernel, the separation of weston-launch/weston
and the fact that we restore the tty only after the weston
process quits: When the controlling process for a TTY exits,
all open file descriptors for that TTY are put in a hung-up
state! For more details see this systemd-logind issue:
https://github.com/systemd/systemd/issues/989

We can work around by reopening the particular TTY. This allows
to properly restore the TTY settings such that a successive VT
switch will show text terminals fine again.

Signed-off-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2020-01-30 12:11:37 +00:00
Stefan Agner 247392a322 weston-launch: check string truncation
Since weston-launch is a setuid-root program we should be extra careful:
Check for a potential string trunction. Move the check in a separate
function and return with error in case trunction has happened.

Signed-off-by: Stefan Agner <stefan@agner.ch>
2020-01-30 12:11:37 +00:00
Stefan Agner c6f818a016 weston-launch: make sure weston-launch activates the VT
Currently weston-launch does not activate the VT when opening the
terminal directly (e.g. using --tty=/dev/tty7). Weston takes full
control over the terminal by switching it to graphical mode etc.
However, the old VT stays active as can be seen when looking at
sysfs:
  # cat /sys/class/tty/tty0/active
  tty1

Always switch to the new VT to make sure the correct VT is active.
This aligns with how TTY setup is implemented in launcher-direct.c.

Signed-off-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2020-01-30 12:11:37 +00:00
Stefan Agner cb24a7d1eb weston-launch: fix newline in error message
Add newline character at the end of the error message to make sure we
get a new line after this error has been printed.

Fixes: a1450a8a71 ("make error() portable")
Signed-off-by: Stefan Agner <stefan@agner.ch>
2020-01-30 12:11:37 +00:00
Stefan Agner 77e3b056d7 weston-launch: get ttynr also when no user is given
In case an user is given but no tty, the code opens tty0 to allocate a
new tty. With that ttynr is known.

In case a tty name is given the user must be given too. In this case
we later recover the ttynr by using stat on the file tty file descriptor
which allows as to find the ttynr by looking at the devices minor number.

However, the third case, when no user and no tty name is given, we do
not get the ttynr.

This hasn't been a problem in practise since ttynr has not been used.
However, it makes sense to get the ttynr always for consistency. Also
upcomming fixes will start to make use of ttynr.

Fixes: 636156d5f6 ("weston-launch: Don't start new session unless -u is given")
Signed-off-by: Stefan Agner <stefan@agner.ch>
2020-01-30 12:11:37 +00:00
Stefan Agner aaa5b82e61 weston-launch: do not close tty prematurely
The tty file descriptor is used in signal handling (when switching
VT via SIGUSR1/SIGUSR2 for the VT_RELDISP ioctrl) and in quit() when
weston-launch exits for the KDSKBMUTE/KDSKBMODE/KDSETMODE/VT_SETMODE
ioctrls.

This fixes VT switching when using weston-launch from a non-VT shell
(e.g. ssh or from within a container).

Signed-off-by: Stefan Agner <stefan@agner.ch>
2020-01-30 12:11:37 +00:00
Leandro Ribeiro ca640d5120 libweston: fold weston_compositor_tear_down() into weston_compositor_destroy()
The only reason why we have both weston_compositor_tear_down() and
weston_compositor_destroy() is that the only we had to destroy
the log context was keeping weston_compositor alive and calling
weston_log_ctx_compositor_destroy().

After commit "weston-log: replace weston_log_ctx_compositor_destroy()
by weston_log_ctx_destroy()", it's not necessary to keep a zombie
weston_compositor just to be able to call
weston_log_ctx_compositor_destroy().

Fold weston_compositor_tear_down() into weston_compositor_destroy(),
as this split is useless now.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-01-29 12:15:16 -03:00
Leandro Ribeiro 4ec38d18b3 weston-log: replace weston_log_ctx_compositor_destroy() by weston_log_ctx_destroy()
The function weston_log_ctx_compositor_destroy(), which destroys struct
weston_log_context, takes weston_compositor as argument. We may have a
weston_log_context unlinked from a weston_compositor and currently there
is no way to destroy it.

Add function weston_log_ctx_destroy(), what makes the destruction of
weston_log_context independent of weston_compositor.

With this change, one could destroy a weston_compositor and keep the
related weston_log_context (since now weston_log_context can be destroyed
without the need of a weston_compositor). But if weston_compositor gets
destroyed it's also necessary to destroy weston_log_context::global,
as the debug protocol depends on the compositor. So a listener has been
added to the destroy signal of weston_compositor.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-01-29 12:08:54 -03:00
Leandro Ribeiro 4f13595aa7 weston-log: rename weston_log_ctx_compositor_create() to weston_log_ctx_create()
Since weston_log_ctx_compositor_create() does not have any relation
with weston_compositor, rename it to weston_log_ctx_create().

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-01-29 12:08:54 -03:00
Leandro Ribeiro bd9c0a6ff5 weston-log: fold weston_log_ctx_compositor_setup() into weston_compositor_create()
The function weston_log_ctx_compositor_setup() is being called only inside
weston_compositor_create() and it is so tiny that the code gets easier to
follow if it gets folded in weston_compositor_create().

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-01-29 12:08:54 -03:00
Leandro Ribeiro fa505c588f content-protection: stop direct accessing core struct member
Commit "weston-log: add function to avoid direct
access to compositor members in non-core code" added the
function weston_compositor_add_log_scope mainly to allow
libweston users to avoid direct accessing core structs, as
weston_compositor.

Replace weston_log_context_add_log_scope usage by
weston_compositor_add_log_scope.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-01-29 09:55:24 +00:00
Leandro Ribeiro ce1001966e compositor: stop direct accessing core struct member
Commit "weston-log: add function to avoid direct
access to compositor members in non-core code" added the
function weston_compositor_add_log_scope mainly to allow
libweston users to avoid direct accessing core structs, as
weston_compositor.

Replace weston_log_context_add_log_scope usage by
weston_compositor_add_log_scope.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-01-29 09:55:24 +00:00
Leandro Ribeiro 172afc2178 backend-drm: stop direct accessing core struct member
Commit "weston-log: add function to avoid direct
access to compositor members in non-core code" added the
function weston_compositor_add_log_scope mainly to allow
libweston users to avoid direct accessing core structs, as
weston_compositor.

Replace weston_log_context_add_log_scope usage by
weston_compositor_add_log_scope.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-01-29 09:55:24 +00:00
Leandro Ribeiro f66685d9db weston-log: add function to avoid direct access to compositor members in non-core code
If we use the function weston_log_context_add_log_scope()
in non-core code, it's necessary to access
weston_compositor::weston_log_ctx.

This is not ideal, since the goal is to make core structs
(weston_compositor, weston_surface, weston_output, etc)
opaque.

Add function weston_compositor_add_log_scope(), so non-core
users are able to pass weston_compositor as argument instead
of weston_compositor::weston_log_ctx.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-01-29 09:55:24 +00:00
Leandro Ribeiro ac691a89cd weston-log: rename the confusing function name weston_compositor_add_log_scope()
There's a function named weston_compositor_add_log_scope()
but it doesn't take a struct weston_compositor argument.

Rename it to weston_log_ctx_add_log_scope(), as
the log_scope is being added to a log_context.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-01-29 09:55:24 +00:00
Guillaume Champagne f1e8fc9dbf libweston: add missing include
Fixes missing prototypes compilation warnings emitted when a function
is defined before its prototype is declared.

These warnings were introduced over time since the switch to meson
because the -Wmissing-protoypes was not included in the compilation
arguments.

Signed-off-by: Guillaume Champagne <champagne.guillaume.c@gmail.com>
2020-01-29 09:49:41 +00:00
Guillaume Champagne b4bd12b738 launcher: move weston_environment_get_fd
weston_environment_get_fd was declared in weston-launch and implemented
in compositor.c. Since the function is not used elsewhere in the code,
it is replaced by a static function in launcher-weston-launch.c

Signed-off-by: Guillaume Champagne <champagne.guillaume.c@gmail.com>
2020-01-29 09:49:41 +00:00
Scott Anderson 60b6572b35 Fix Wmaybe-uninitialized warnings
Just a couple of places which shouldn't be possible, so initialized and
added assertions to make sure.

Signed-off-by: Scott Anderson <scott.anderson@collabora.com>
2020-01-28 12:30:56 +00:00
Leandro Ribeiro f014964f6f weston-log: rename the confusing function name weston_compositor_log_scope_destroy()
There's a function named weston_compositor_log_scope_destroy()
but it doesn't take a struct weston_compositor argument.

Rename it to weston_log_scope_destroy(), as the argument is a
struct weston_log_scope.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-01-27 13:43:24 -03:00
Leandro Ribeiro 5976dbbbb5 weston-log: rename the confusing function name weston_compositor_add_log_scope()
There's a function named weston_compositor_add_log_scope()
but it doesn't take a struct weston_compositor argument.

Rename it to weston_log_ctx_add_log_scope(), as
the log_scope is being added to a log_context.

Also, bump libweston_major to 9.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-01-27 13:42:42 -03:00
Stefan Agner c3c0b247a0 backend-rdp: unref keymap after associating with seat
The function weston_seat_init_keyboard makes sure that it has its
own reference to keymap, hence we can safely drop our reference.
This is similarly done in the X11 backend. It avoids leaking a
struct xkb_keymap per connection.

Signed-off-by: Stefan Agner <stefan@agner.ch>
2020-01-13 14:22:30 +00:00
Stefan Agner 483cc63669 backend-rdp: use compositor wide struct xkb_context
Instead of allocating our own copy of struct xkb_context use the
compositor wide instance. This avoids leaking of a struct
xkb_context per connection as well.

Signed-off-by: Stefan Agner <stefan@agner.ch>
2020-01-13 14:22:30 +00:00
Stefan Agner c220a40a81 backend-rdp: constify keyboard layout information
Those information remain constant during execution, so mark them
as const.

Signed-off-by: Stefan Agner <stefan@agner.ch>
2020-01-13 14:22:30 +00:00