This is a follow-up of commit "tests: start to use Weston's
default screenshooter in the test suite".
As we've started to use Weston's default screenshooter
implementation and protocol extension in the test suite,
we don't need what we've created specifically for the test
suite anymore.
Drop test suite screenshooter implementation and protocol
extension.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Until now we had two different protocol extensions: one for the
test suite screenshooter and other for the screenshooter client.
As they are identical and this won't change, make the test suite
use the same protocol that the screenshooter client uses.
Besides the cleanup, this change will also allow us to use the
DRM writeback screenshooter in the test suite, as the test suite
implementation is hardcoded to use a renderer based screenshooter.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
We have two functions with the name weston_screenshooter_shoot():
1. screenshot protocol function that the screenshooter
client uses to request screenshots to the compositor
2. libweston function used by the compositor to take
screenshots as requested by the screenshooter client
Until now we had no problem with that, but in the next commits
we are going to use the screenshot protocol in the test suite,
which is also user of libweston. So rename screenshot protocol
function to weston_screenshooter_take_shot() to avoid the conflict.
For consistency, also rename screenshooter_shoot() to
screenshooter_take_shot() in compositor/weston-screenshooter.c
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
The 'struct test' has a field 'int buffer_copy_done', but it
is in a fact a boolean. Change it to 'bool buffer_copy_done'.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
The wl_drm protocol is not being used by the test client. So
remove 'bool has_wl_drm' from 'struct client' and also the
branch that initializes this variable in handle_global().
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
When destroying the shell we need to remove the listeners
as well. The test-desktop-shell was forgetting to do this.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Commit 32a5acde5b
"tests: add mechanism to change Weston's behavior when running certain
tests"
added a new field to struct weston_compositor. Since that struct is
still in the public header, this breaks ABI. Bump the library version
accordingly.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Until now we had struct wet_testsuite_data as an opaque
struct that should be defined by the testsuite of libweston
users. Instead, keep the data as a void * and document that
users are responsible for defining the data type.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
There are some specific cases in which we need Weston to
behave differently when running in the test suite. This
adds a new API to allow the tests to select these behaviors.
For instance, in the DRM backend we plan to add a writeback
connector screenshooter. In case it fails for some
reason, it should fallback to the renderer screenshooter
that all other backends use. But if we add a test to
ensure the correctness of the writeback screenshooter,
we don't want it to fallback to the renderer one, we
want it to fail. With this new API we can choose to
disable the fallback behavior specifically for this test.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
gbm-drm.c includes gl-renderer.h. When EGL is enabled, that in turns
includes egl.h. As such, dependencies for drm should include EGL if
it is available.
This condition is modelled after a similar one in libweston/meson.build
Reported-by: Gary Bisson <gary.bisson@boundarydevices.com>
Reported-by: Heiko Thiery <heiko.thiery@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Refik Tuzakli <tuzakli.refik@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
Found mutable global variables with
$ grep -P '^static (?!const).*[=;]' -- compositor libweston shared
Mutable global or static variables make it harder to run several
compositor instances in the same process. That is what the test suite
would probably need to do to test wayland-backend.
This one variable does not need to be mutable.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This was forgotten in "weston: remove SEGV and ABRT handlers". It is
unused.
Fixes: bb707dc0fe
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Rework some functions in `drm.c` to reuse the `drmModeRes` and
reduce the usage of `drmModeGetResources` and `drmModeGetResources`.
Signed-off-by: Igor Matheus Andrade Torrente <igormtorrente@gmail.com>
If weston.ini is not setting background-image path,
then desktop-shell sets ${DATDIR}/weston/pattern.png
as background. However in this case width and height
is set to 1 during background config and is being
scaled to avoid allocation of buffer.
This behavior is not right. Along with background-image
path, we should also check if background-color is set.
If background color is set, then only scale 1x1 buffer.
This would allow to set pattern.png as default wallpaper
of weston correctly, if background-color is also not set
in weston.ini file.
Fixes: 3623e46dc5
Signed-off-by: Tanmay Shah <tanmay@codeaurora.org>
96bef0517e "drm-backend: add support for
writeback connectors" started using DRM_MODE_CONNECTOR_WRITEBACK and
DRM_CLIENT_CAP_WRITEBACK_CONNECTORS. These were introduced in libdrm
2.4.95.
According to
https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/311
Ubunut Xenial is the only mentioned distribution that does not provide a
libdrm new enough. I think that is fine to drop now, 2016 was a good
while ago.
Libdrm 2.4.95 also introduced DRM_CLIENT_CAP_ASPECT_RATIO,
DRM_MODE_PICTURE_ASPECT_64_27, DRM_MODE_PICTURE_ASPECT_256_135.
The fallback definitions for the above are dropped.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Properly release the seat on RDP disconnect. Using current master
branch which is commit d93c0f7059 ("backend-rdp: fix memory leak")
I was not able to reproduce the crash on reconnect as mentioned in the
current comment. Using Weston with rdp-backend directly as well as
using the screen-share plug-in allowed to reconnect just fine. Hence
release the Weston seat properly using weston_seat_release and free
the seat structure. This also avoids mouse pointers displayed for
every RDP connection.
Signed-off-by: Stefan Agner <stefan@agner.ch>
The stable FreeRDP 2.x branch has been released, so let's rely on that maintained
version and drop all the hacks for older versions. That makes the code and build
cleaner.
Signed-off-by: David Fort <contact@hardening-consulting.com>
Convert ivi-shell-app-test.c to use `weston_ini_setup`. It also removes
the pre-made weston.ini and all the related code in the meson files.
Signed-off-by: Igor Matheus Andrade Torrente <igormtorrente@gmail.com>
Recognize writeback connectors and add 'struct drm_writeback'
objects in order to store them.
These objects are created and stored in a list by the time
that DRM-backend is initialized. This list is updated if a
writeback connector dynamically appears or is disconnected.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Instead of directly creating heads for the connectors in functions
drm_backend_create_heads() and drm_backend_update_connectors(),
add drm_backend_add_connector() that will handle this.
This split makes the code look better and will also make our lives
easier when we introduce writeback connectors.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Add helper function resources_has_connector(), what makes
the function drm_backend_update_connectors() look better.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
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>
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>
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>
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>
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>
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>
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>
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>
This commit alters the way that Weston picks a Wayland display socket
name. Instead of using wl_display_add_socket_auto to look for the first
available name in wayland-0, wayland-1, .... to wayland-32, the code now
checks names wayland-1, wayland-2, .... up to wayland-32.
This change is a workaround for a suboptimal behavior of
libwayland-client. If a client program calls wl_display_connect(NULL) and
the WAYLAND_DISPLAY environment variable is not set, then the program will
by default try to connect to 'wayland-0'. This is a problem when a
computer has a running Wayland compositor but is being accessed in some
other fashion, such as through an X session on a different virtual
terminal, over ssh, etc. Client programs launched through those means may
attempt to connect to an unrelated compositor. Changing libwayland
behavior to remove the default would also work, but a) libraries have
stronger backward compatibility expectations b) that would likely break
more people's setups than just changing Weston would.
Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
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>
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>
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>
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>
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>
Currently doesn't exist a standard way to write a weston.ini inside a test.
Here, two new functions `weston_ini_setup` and `cfgln` are introduced to
help the test writer to write a weston.ini file and load it to the test.
And `internal-screenshot-test` is converted to use the new method of write
a weston.ini. This conversion serves as example and initial API test.
The tester needs to call `weston_test_harness_execute_as_client` or
`weston_test_harness_execute_as_plugin` in the same way as before.
The `weston_ini_setup` will fill the setup->config_file with the
correct path to the weston.ini file.
The main design goal is to avoid pre-made or build-made weston.ini(s)
and keep the test as self-contained as possible.
Closes:#410
Signed-off-by: Igor Matheus Andrade Torrente <igormtorrente@gmail.com>
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>
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>
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>
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>
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>
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>
directory
Weston is also a user of the plug-ins, so make use of it. With this
change we unconditionally install the plug-in headers even though
libweston might not be built with support for them.
Suggested-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>