Marius Vlad [Sun, 25 Aug 2019 19:33:41 +0000 (22:33 +0300)]
clients/fullscreen: Refuse to resize the surface size when fullscreen'ed
This would be causing a protocol error in which the buffer size needs to
match the one provided in the configure event.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Marius Vlad [Fri, 19 Jul 2019 08:29:53 +0000 (11:29 +0300)]
doc/scripts/gdb: Added gdb script to dump contents of the flight recorder
Mimics the C version that displays the contents of the flight recorder.
With a core-dump in place source the python file then call
'display_flight_rec' to dump the data.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Marius Vlad [Wed, 7 Aug 2019 14:21:49 +0000 (17:21 +0300)]
weston-log-flight-rec: Fix useless comparison when displaying the
contents of the flight recorder
The overlap variable is sufficient to determine from where to start
displaying the contents of the ring buffer. Also redundant to verify
if the position in the buffer went over the maximum size.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Reported-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Marius Vlad [Wed, 7 Aug 2019 14:18:37 +0000 (17:18 +0300)]
weston-log-flight-rec: Don't allow more than one flight recorder to be
created
Having a (single) global variable which others depend on it implies
having a single flight recorder present. Until we have a reason to
support multiple flight recorders limit the amount to a maximum of one.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Reported-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Marius Vlad [Thu, 18 Jul 2019 14:04:37 +0000 (17:04 +0300)]
weston-log-flight-rec: Add a global variable to access the ring buffer
With it add also a function which can be used in an assert()-like
situation to display the contents of the ring buffer. Within gdb
this call also be called if the program is loaded/still loaded into
memory.
The global variable will be used in a later patch to be accessed from a
python gdb script.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Veeresh Kadasani [Fri, 15 Nov 2019 05:37:16 +0000 (14:37 +0900)]
simple-dmabuf-egl: make application generic
Don't exit if EGL_KHR_no_config_context extension
is not supported
Signed-off-by: Veeresh Kadasani <external.vkadasani@jp.adit-jv.com>
Daniel Stone [Mon, 25 Nov 2019 10:30:11 +0000 (10:30 +0000)]
config-parser: Export get_full_path and destroy
Make sure we export the get_full_path() accessor (declared in the
header, used by Weston itself) and the parser's destroy function.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Pekka Paalanen [Mon, 25 Nov 2019 11:11:56 +0000 (13:11 +0200)]
libweston: do not include weston.h
Libweston is not allowed to depend on Weston. Fortunately this include is
unnecessary and can be simply removed.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Leandro Ribeiro [Sat, 23 Nov 2019 16:15:52 +0000 (13:15 -0300)]
backend-drm: remove unnecessary ifdefs
Remove unnecessary ifdefs for DRM_MODE_CONNECTOR_DSI, DRM_MODE_CONNECTOR_DPI.
They are both provided by libdrm and were introduced long before 2.4.83 (the
lowest version we currently support).
Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
Leandro Ribeiro [Fri, 22 Nov 2019 19:55:56 +0000 (16:55 -0300)]
backend-drm: remove unecessary ifdef checks
Since commit
28d26483 ("build: bump libdrm requirement to newer version
(2.4.83)"), all supported libdrm versions provide modifier formats,
atomic API and blob formats. Remove ifdef checks (HAVE_DRM_ADDFB2_MODIFIERS,
HAVE_DRM_ATOMIC, HAVE_DRM_FORMATS_BLOB) to improve the code and make it
simpler.
Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
Leandro Ribeiro [Fri, 22 Nov 2019 17:45:33 +0000 (14:45 -0300)]
build: bump libdrm requirement to newer version (2.4.83)
There are some features that are available only if the user's libdrm version is
not too old: format modifiers require at least libdrm 2.4.71, atomic API at
least 2.4.78 and blob formats at least 2.4.83.
Bump libdrm to 2.4.83 (the oldest version that support these features) in order
to be able to remove ifdef checks and simplify the code. Major distributions
already support libdrm 2.4.91, so it's safe to apply this commit.
Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
Marius Vlad [Fri, 15 Nov 2019 12:11:49 +0000 (14:11 +0200)]
backend-drm: Further checks to skip plane assignment to HW planes
Mode change from mixed-mode to renderer-only means we should no longer
try to place views in HW planes (as we composite everything into the
primary plane) thus we should avoid that whenever that happens.
In the same time we need to be able to place in mixed-mode/renderer-only
mode the cursor view into the cursor plane (if one is available).
This patch adds a further check to skip plane assignment when disabling
overlay support (when we switch to renderer-only mode), when drivers do
not have atomic-modeset or it has been disabled intentionally.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Marius Vlad [Fri, 15 Nov 2019 12:32:08 +0000 (14:32 +0200)]
backend-drm: Turn zpos duplicate check into an hard assert
This way we make sure we find out (if we have assigned invalid zpos
values) much faster.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Marius Vlad [Thu, 14 Nov 2019 22:25:11 +0000 (00:25 +0200)]
backend-drm: Skip testing plane state if plane is not enabled
Adds a further assert() to make sure we're not checking against invalid
values. This was seen in the wild when the kernel rejects the commit for
overlay resulting in a check for invalid zpos values.
Fixes: #304
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Marius Vlad [Fri, 15 Nov 2019 11:33:38 +0000 (13:33 +0200)]
backend-drm: Assign the primary plane the lowest zpos value
when switching to mixed-mode of compositing
This way we avoid an (incorrect) duplicate check of zpos values. Also,
this would be needed because the renderer needs have the lowest zpos value
available as we don't (yet) properly support underlays, the primary
plane serves as our renderer.
Adds also a check to see if we try to assign a view to a plane with
a lower zpos value than the one assigned to the primary when switching
to mixed-mode of compositing.
Fixes: #304
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Pekka Paalanen [Mon, 18 Nov 2019 14:47:45 +0000 (16:47 +0200)]
tests: drop FAIL_TEST
Nothing is using FAIL_TEST or FAIL_TEST_P and that is good. Remove them to not
encourage using them.
If we need a test that should fail, it always needs to fail in a very specific
way which needs to be checked. For this we have e.g. expect_protocol_error().
We never want a fail-test to pass because it failed in a way we did not expect.
Therefore these macros are useless.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Pekka Paalanen [Mon, 11 Nov 2019 13:18:51 +0000 (15:18 +0200)]
tests/ivi: rename test_section
Use a different section name to make sure that if this plugin is loaded into
the same process as where weston-test-runner.h is used, the two different
sections cannot get mixed up. This is just a precaution, but it removes a bit
of reader confusion as well.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Pekka Paalanen [Thu, 7 Nov 2019 11:34:59 +0000 (13:34 +0200)]
tests: rename struct weston_test to weston_test_entry
This avoids confusing it with the opaque struct weston_test from
protocol/weston-test.xml.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Pekka Paalanen [Wed, 6 Nov 2019 14:09:00 +0000 (16:09 +0200)]
tests/xwayland: do not call exit(SUCCESS)
Successful tests should just return, not call exit() which breaks the new test
harness when it uses TAP.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Pekka Paalanen [Wed, 6 Nov 2019 13:59:33 +0000 (15:59 +0200)]
tests: replace fprintf() with testlog()
When we move on to TAP, stdout will be reserved for TAP and stderr is for free
chatter. Set up an example that tests should use testlog() instead of fprintf
or printf to chat in the right place.
Most statements were already printing to stderr, so this just makes then a
little shorter. There are also some statements that printed to stdout and are
now corrected.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Pekka Paalanen [Fri, 15 Nov 2019 13:48:08 +0000 (15:48 +0200)]
tests/subsurface-shot: hardcode reference image names
Using the test name for the reference images will stop working when the new
test harness starts using fixtures. Fixtures allow running the same tests in
varying environments, so the test results file names will include fixture
index. However the reference images will remain the same for all fixtures.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Pekka Paalanen [Fri, 1 Nov 2019 14:27:07 +0000 (16:27 +0200)]
tests: write image to current directory by default
This reverts
50b7b708352dbf0d6670d9ae5668e3c215e28662.
We didn't make Meson create a logs directory, so writing the images fails
because the directory does not exist. If you run a test without Meson, there is
even less expectation that it would write somewhere else than CWD by default.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Jeffy Chen [Mon, 2 Sep 2019 02:26:09 +0000 (10:26 +0800)]
clients: Add more sanity checks to catch destroyed window
Add a sanity check to touch_handle_down() and data_device_enter() as
what we did for pointer and keyboard.
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Jeffy Chen [Mon, 2 Sep 2019 02:15:26 +0000 (10:15 +0800)]
clients: Drop corresponding touch points when destroying windows
This is to avoid memory leaking of these touch points.
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Olivier Fourdan [Fri, 8 Nov 2019 17:31:13 +0000 (18:31 +0100)]
xwm: Use Xwayland allow commits for repaint
Initially, `_XWAYLAND_ALLOW_COMMITS` was introduced in commit
7ace831ca
to avoid drawing the window content before it's ready to be shown.
But a repaint might also be triggered by the client damages before the
XWM has finished drawing its window decorations and drop shadows, which
previously was not too much of an issue since the XWM could still
finish updating the X11 window after the buffer was submitted.
However, with the addition of multiple window buffers in Xwayland [1]
which are aimed at preventing the X11 clients from updating the buffer
after it's been committed, this is no longer possible.
As a result, the use of multiple window buffers in Xwayland can cause
ugly repainting effects of the decorations if the buffer is submitted
before the XWM has finished painting its decorations.
Use the X11 property `_XWAYLAND_ALLOW_COMMITS` can be used to avoid
this, by controlling when Xwayland should commit changes to the Wayland
surface.
[1] https://gitlab.freedesktop.org/xorg/xserver/merge_requests/316
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Pekka Paalanen [Mon, 4 Nov 2019 12:07:51 +0000 (14:07 +0200)]
compositor: allow double-loading modules
This is necessary for the test harness to be able to execute the compositor
multiple times in the same process. As we never unload opened modules, the
first compositor iteration will leave them all loaded and following compositor
iterations will then have them already loaded.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Pekka Paalanen [Mon, 4 Nov 2019 12:07:51 +0000 (14:07 +0200)]
libweston: allow double-loading modules
This is necessary for the test harness to be able to execute the compositor
multiple times in the same process. As we never unload opened modules, the
first compositor iteration will leave them all loaded and following compositor
iterations will then have them already loaded.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Pekka Paalanen [Wed, 6 Nov 2019 10:59:32 +0000 (12:59 +0200)]
Use weston_compositor_add_destroy_listener_once() in plugins
This introduces a new convention of checking through the compositor destroy
listener if the plugin is already initialized. If the plugin is already
initialized, then the plugin entry function succeeds as a no-op. This makes it
safe to load the same plugin multiple times in a running compositor.
Currently module loading functions return failure if a plugin is already
loaded, but that will change in the future. Therefore we need this other method
of ensuring we do not double-initialize a plugin which would lead to list
corruptions the very least.
All plugins are converted to use the new helper, except:
- those that do not have a destroy listener already, and
- hmi-controller which does the same open-coded as the common code pattern
did not fit there.
Plugins should always have a compositor destroy listener registered since they
very least allocate a struct to hold their data. Hence omissions are
highlighted in code.
Backends do not need this because weston_compositor_load_backend() already
protects against double-init. GL-renderer does not export a standard module
init function so cannot be initialized the usual way and therefore is not
vulnerable to double-init.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Pekka Paalanen [Wed, 6 Nov 2019 10:07:23 +0000 (12:07 +0200)]
colord: remove destroy listener on clean-up
This was forgetting to remove the compositor destroy listener, which would lead
to use-after-free on compositor tear-down especially on cms-colord init failure
paths. Found by inspection.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Pekka Paalanen [Wed, 6 Nov 2019 10:07:23 +0000 (12:07 +0200)]
ivi-shell: fix init error path
This was forgetting to remove the compositor destroy listener if init failed,
which would lead to use-after-free on compositor tear-down. Found by
inspection.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Pekka Paalanen [Wed, 6 Nov 2019 10:07:23 +0000 (12:07 +0200)]
tests: fix test-shell init error path
This was forgetting to remove the compositor destroy listener if init failed,
which would lead to use-after-free on compositor tear-down. Found by
inspection.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Pekka Paalanen [Wed, 13 Nov 2019 13:50:51 +0000 (15:50 +0200)]
tests: remove static data from presentation
While get_presentation() will only ever be called once (making the caching of
the return value moot), it is good to stop using the static variable as it
would cause surprising problems if anyone adds more tests here and runs it
under the new test harness.
It was leaked before and continues to be so.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Pekka Paalanen [Tue, 5 Nov 2019 15:03:34 +0000 (17:03 +0200)]
tests: remove static data from ivi-layout-test-client
Using static data will mess things up when the test harness no longer fork()'s
each sub-test. Hence it needs to be converted to "normal" data.
Unfortunately here the cached value was actually used, so keeping that
behaviour is a handful. Yes, it was all leaked also before.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Pekka Paalanen [Tue, 5 Nov 2019 14:47:10 +0000 (16:47 +0200)]
tests: remove static data from ivi-shell-app-test
Just one test call this only once, so the cached value will never be useful.
Stop using static data, it sets a bad example. If more tests were added, things
would start failing when forking is removed from the test harness.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Pekka Paalanen [Tue, 5 Nov 2019 14:32:18 +0000 (16:32 +0200)]
tests: remove static data from ivi-layout-test-plugin
I cannot see any reason why this should be static data. But if it is static
data, it will prevent re-entering wet_main() to run tests with this plugin, so
replace it with "normal" data.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Pekka Paalanen [Tue, 5 Nov 2019 13:40:25 +0000 (15:40 +0200)]
tests: remove static data from viewporter
This caching is actually never hit. I tested by making the early return abort()
instead and all works just fine.
Remove the caching. The static variable will cause problems when we stop
fork()'ing for each test case.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Marius Vlad [Sun, 17 Nov 2019 14:21:14 +0000 (16:21 +0200)]
clients/simple-dmabuf-drm: Make use of direct-display
Uses weston-direct-display extension.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Marius Vlad [Sat, 16 Nov 2019 18:40:13 +0000 (20:40 +0200)]
clients/simple-dmabuf-egl: Make use of direct-display
Uses weston-direct-display extension.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Marius Vlad [Tue, 12 Nov 2019 13:44:43 +0000 (15:44 +0200)]
renderer-gl: Display a solid shader color when direct-display is in use
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Marius Vlad [Tue, 12 Nov 2019 10:18:20 +0000 (12:18 +0200)]
renderer-gl: Avoid retrieving the EGL image it direct_display flag was set
As we avoid importing the buffer in the GPU, when attaching the buffer
we'll not have a valid image to retrieve it from, and as such we'll
avoid touching and setting the surface state shader.
This adds also 'direct_display' to the surface state and with it, sets the
surface state 'direct_display' member whenever the imported buffer will
have the direct-display member set.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Marius Vlad [Sun, 10 Nov 2019 22:27:17 +0000 (00:27 +0200)]
backend-drm: Add dmabuf scan-out check for DRM-backend
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Marius Vlad [Sat, 16 Nov 2019 18:26:52 +0000 (20:26 +0200)]
libweston: Add the ability to determine if a dmabuf is scanout-capable
Adds a new callback 'can_scanout_dmabuf' in weston_backend, which
can be set by the back-end do determine if the buffer supplied can be
imported directly by KMS.
This patch adds a wrapper over it, 'weston_compositor_dmabuf_can_scanout'
which is called before importing the dmabuf in the GPU if the
direct_display dmabuf is being set. If that's true and the check
failed, we refuse to create a wl_buffer.
This patch avoids importing in the GPU.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Marius Vlad [Sat, 16 Nov 2019 17:22:48 +0000 (19:22 +0200)]
libweston: Add weston-direct-display server side implementation
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Marius Vlad [Sat, 16 Nov 2019 16:55:17 +0000 (18:55 +0200)]
protocol: Add weston-direct-display extension
Weston extension to assure clients that the dmabuf buffer will be
forwarded directly to the display controller.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Pekka Paalanen [Thu, 14 Nov 2019 13:23:42 +0000 (15:23 +0200)]
libweston: drop a misleading dmabuf comment
This comment was added in
230f3b1bf896fcf3fa76b4d7093122b3361f7e36 with the
intent that if we had an information table about pixel formats (which we do
have today), we could implement more sanity checks like ensuring that width
pixels fit into stride.
Daniel Vetter said on #dri-devel IRC recently:
< danvet> since userspace shouldn't look at stride for buffers with
modifiers, only pass it around unchanged
I asked for clarification. It was expected that userspace would not do any kind
of sanity checks as modifiers could change everything.
Let's remove the misleading code comment so that people don't get the idea of
adding more well-intended but ill-advised sanity checks. If more checks are
added, they must take the modifier into account, which the existing checks do
not do.
After 5 years, it is far too late to remove our existing sanity checks, but we
can attempt to not cause any more damage that would restrict what people can do
in the kernel.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Marius Vlad [Wed, 13 Nov 2019 09:40:26 +0000 (11:40 +0200)]
compositor: Fix some warning when passing debugoptimized to meson
Increase the buf size such it can accomodate sufficiently large local
buffers. Spotted whilst looking for something else.
../compositor/main.c:157:22: warning: ‘%s’ directive output may be
truncated writing up to 511 bytes into a region of size 128
[-Wformat-truncation=]
157 | snprintf(buf, len, "%s[%s.%03li]", datestr,
| ^~ ~~~~~~~
../compositor/main.c:157:21: note: directive argument in the range
[-
9223372036854775,
9223372036854775]
157 | snprintf(buf, len, "%s[%s.%03li]", datestr,
| ^~~~~~~~~~~~~~
../compositor/main.c:157:2: note: ‘snprintf’ output between 7 and 659
bytes into a destination of size 128
157 | snprintf(buf, len, "%s[%s.%03li]", datestr,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
158 | timestr, (tv.tv_usec / 1000));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Eero Tamminen [Wed, 13 Nov 2019 11:34:30 +0000 (11:34 +0000)]
Add include for missing symbols
Fixes: https://gitlab.freedesktop.org/wayland/weston/issues/303
Nicholas Niro [Wed, 30 Oct 2019 02:13:09 +0000 (22:13 -0400)]
backend-drm: Added support for legacy fd_import
This patch reenables the function drm_fb_get_from_dmabuf but with legacy
fd_import support for gbm/mesa < 17.1.
Nicholas Niro [Wed, 30 Oct 2019 01:50:54 +0000 (21:50 -0400)]
backend-drm: Fix for gbm modifiers when they are not available.
When the HAVE_GBM_MODIFIERS is unset, make the code drop back
to a single plane version like other places in the code.
Drew DeVault [Tue, 12 Nov 2019 16:22:17 +0000 (11:22 -0500)]
simple-dmabuf-egl: update to xdg-shell stable
Marius Vlad [Sat, 19 Oct 2019 15:18:38 +0000 (18:18 +0300)]
backend-drm: Print whenever a view could not placed on the primary due to
invalid size
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Marius Vlad [Mon, 14 Oct 2019 20:15:49 +0000 (23:15 +0300)]
backend-drm: Print whenever a view will reach the renderer region
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Marius Vlad [Fri, 1 Nov 2019 21:49:21 +0000 (23:49 +0200)]
backend-drm: Move plane's availability in drm_output_try_view_on_plane()
It makes much more sense to be there. It adds some additional drm_debug()
statements to provide reason for failing to place the view in the HW
plane. Makes the reason for failing more accurate.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Suggested-by: Daniel Stone <daniel.stone@collabora.com>
Marius Vlad [Thu, 31 Oct 2019 10:48:35 +0000 (12:48 +0200)]
backend-drm: Pass the drm_fb to each prepare_overlay/scanout_view functions
Avoids the need to retrieve the DRM framebuffer in each function and
re-uses the one got before constructing the zpos candidate list.
Takes another reference for the scanout as to live the state, like
there's one for the overlay bit.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Marius Vlad [Thu, 24 Oct 2019 21:07:37 +0000 (00:07 +0300)]
backend-drm: Pass the plane to prepare_overlay_view
As we already have a potential plane available to use, pass it
over the _prepare_overlay_view instead of trying to find one
from the backend plane list.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Suggested-by: Daniel Stone <daniel.stone@collabora.com>
Marius Vlad [Wed, 11 Sep 2019 15:21:59 +0000 (18:21 +0300)]
backend-drm: Allow for views to reach overlays/underlays planes
In this manner we will allow views to reach the overlay (or underlays)
even if the damage tracking will detect that the new view will
occlude the view underneath it.
Renames occluded_region to planes_region, and uses occluded_region
to represent the region where we add each view's visible-and-opaque region.
Sprinkle some comments about each region.
Re-uses the view's clipped region to determine visible-and-opaque region
which is accumulated (for both renderer and HW planes cases) into
occluded_region. The current view's clipped_region is then checked against
occluded_region.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Suggested-by: Daniel Stone <daniel.stone@collabora.com>
Marius Vlad [Thu, 24 Oct 2019 11:49:33 +0000 (14:49 +0300)]
backend-drm: Check pixel format before constructing the zpos candidate list
We can determine if the pixel format used by the clients buffer is
scan-out capable much sooner, so do it when constructing the zpos
candidate list. It also removes the checks in their respective
prepare_ functions.
Avoids the situation where we'd need to retrieve the DRM framebuffer each time
when checking the pixel format.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Marius Vlad [Sun, 13 Oct 2019 21:29:18 +0000 (00:29 +0300)]
backend-drm: Place pixel format checks for the cursor plane in its own
function
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Marius Vlad [Sun, 13 Oct 2019 21:27:05 +0000 (00:27 +0300)]
backend-drm: Place pixel format checks for the overlay plane in its own
function
The idea is to place pixel the format checks in a common part and until
then, to make it available as a function so we can re-use easily.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Marius Vlad [Mon, 14 Oct 2019 08:05:30 +0000 (11:05 +0300)]
backend-drm: Construct a zpos candidate list of planes
In order to better optimize view assignment to HW planes, we construct
an intermediary zpos candidate list which is used aggregate all suitable
planes for handling scan-out capable client buffers.
We go over it twice: once to construct it and once to pick-and-choose a
suitable plane based its highest zpos position.
In order to maintain the view order correctly we track current zpos
value being applied to the plane state and use it when trying to place
a view into a plane.
Pass the computed zpos value to be applied to the plane state.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Suggested-by: Daniel Stone <daniel.stone@collabora.com>
Marius Vlad [Wed, 11 Sep 2019 13:53:08 +0000 (16:53 +0300)]
libweston: Add a new helper to check if the view spawns the entire
output
Helpful to determine if the view can go through the scanout or not.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Marius Vlad [Wed, 11 Sep 2019 13:41:04 +0000 (16:41 +0300)]
libweston: Add a new helper weston_view_has_valid_buffer
Helper to determine if the buffer attached to the view is valid.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Marius Vlad [Tue, 29 Oct 2019 15:29:37 +0000 (17:29 +0200)]
backend-drm: Hard-code zpos values if HW doesn't exposes them
This is based on the assumption that overlays are in between cursor and
primary plane and it is required to be able to assign views to planes,
even if the driver doesn't not expose such property.
As we hard-code them as immutable the commit part would not need any
further modifications.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Suggested-by: Daniel Stone <daniel.stone@collabora.com>
Marius Vlad [Fri, 27 Sep 2019 17:45:41 +0000 (20:45 +0300)]
backend-drm: Add a helper to display plane type as a 'string'
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Marius Vlad [Thu, 29 Aug 2019 17:42:00 +0000 (20:42 +0300)]
backend-drm: Add zpos DRM-property
Functional no change, as nobody makes use of it. Only apply the zpos
value if the zpos property is mutable (that is, zpos_max and zpos_min
are not the same).
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Marius Vlad [Fri, 1 Nov 2019 10:00:09 +0000 (12:00 +0200)]
backend-drm: Teach drm_property_info_populate() to retrieve range values
Useful for zpos range values.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Suggested-by: Daniel Stone <daniel.stone@collabora.com>
Daniel Stone [Mon, 11 Nov 2019 16:48:54 +0000 (16:48 +0000)]
Revert "backend-drm: Teach drm_property_info_populate() to retrieve range values"
Due to an error in driving GitLab, this commit erroneously contained the
entirety of !267 (zpos support in the KMS backend) squashed into one
single commit, pushed into master.
In order to keep the history clean, this is being reverted; a rebased
version of !267 with the clear individual commits which were already
present will be applied in its place.
This reverts commit
95e3b0deae85a9c5b96097da843ce3c254cfcee1.
Marius Vlad [Mon, 11 Nov 2019 15:24:25 +0000 (15:24 +0000)]
backend-drm: Teach drm_property_info_populate() to retrieve range values
Useful for zpos range values.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Suggested-by: Daniel Stone <daniel.stone@collabora.com>
Daniel Stone [Mon, 11 Nov 2019 09:40:27 +0000 (09:40 +0000)]
remoting: Use DRM FourCC formats instead of GBM formats
The remoting plugin currently has a set_gbm_format() hook, which accepts
GBM_FORMAT_* tokens from the host to set as a supported format.
GBM_FORMAT_* values are strictly aliased with DRM_FORMAT_*.
In order to avoid an extra unnecessary dependency from the remoting
plugin on GBM, switch to using the formats from libdrm instead.
This fixes a compile error seen when the remoting plugin is enabled:
../remoting/remoting-plugin.c:39:10: fatal error: gbm.h: No such file or directory
39 | #include <gbm.h>
| ^~~~~~~
compilation terminated.
The error was caused by not having any dependency at all on GBM from
the remoting backend, which is fixed here by adding a new dependency on
the libdrm headers for drm_fourcc.h.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Stefan Agner [Fri, 8 Nov 2019 23:51:29 +0000 (00:51 +0100)]
weston-launch: use exec to ensure signal delivery
Use exec to make sure the direct child process of weston-launch is
weston. This makes sure that signal delivery (SIGINT/SIGTERM) is
properly forwarded to weston.
Fixes
ff3230952a68 ("weston-launch: Run weston in the user login shell")
Signed-off-by: Stefan Agner <stefan@agner.ch>
Stefan Agner [Fri, 8 Nov 2019 23:50:10 +0000 (00:50 +0100)]
weston-launch: show when a signal is sent to a child
In verbose mode, print when a signal is sent to the child process.
Signed-off-by: Stefan Agner <stefan@agner.ch>
Marius Vlad [Tue, 5 Nov 2019 15:08:17 +0000 (17:08 +0200)]
weston-log: Avoid prefix-matching the scope name when checking for a
pending subscription
It limits to scope name to an exact match.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Reported-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Marius Vlad [Fri, 1 Nov 2019 12:28:22 +0000 (14:28 +0200)]
compositor: Pass the entire string in one-shot when writting logger data
This fixes the situation where the same logger scope is passed multiple
times and the timestamp is being sent before the log mesasge.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Reported-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Marius Vlad [Mon, 4 Nov 2019 15:53:46 +0000 (17:53 +0200)]
libweston: Init weston_output's 'destroy_signal' before timeline has a chance to emit a
timeline subscription
When subscribing over the command line to the 'timeline' scope we hit
the situation where we could emit a timeline message but without the
weston_output object being (fully) enabled. The timeline subscription
object requires to install its own callback on the 'destroy_signal' but
at that time, the 'destroy_signal' is not initialized.
This moves 'destroy_signal' initialization before timeline has a chance
to emit a timeline subscription message for that weston_output.
While at it, move also 'frame_signal' initialization before any function
call to keep them nicely organized.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Marius Vlad [Fri, 1 Nov 2019 11:45:55 +0000 (13:45 +0200)]
compositor: Allow protocol to be displayed when asked for, even if we're not supplying debug argument
This wasn't intentional it just kept the way it was done before.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Reported-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Sebastian Wick [Fri, 1 Nov 2019 01:38:45 +0000 (02:38 +0100)]
input: use ro_anonymous_file to minimize duplication of keymap files
Since version 7 clients must use MAP_PRIVATE to map the keymap fd so we
can use memfd_create in os_ro_anonymous_file_get_ref using
RO_ANONYMOUS_FILE_MAPMODE_PRIVATE, for older version we use
RO_ANONYMOUS_FILE_MAPMODE_SHARED to be compatibile with MAP_SHARED.
Signed-off-by: Sebastian Wick <sebastian@sebastianwick.net>
Sebastian Wick [Fri, 1 Nov 2019 01:27:55 +0000 (02:27 +0100)]
clients/window: bump wl_seat version to 7
Since version 7 clients must use MAP_PRIVATE to map the keymap fd.
Signed-off-by: Sebastian Wick <sebastian@sebastianwick.net>
Sebastian Wick [Fri, 1 Nov 2019 01:23:15 +0000 (02:23 +0100)]
input: bump wl_seat version to 7
Version 7 only restricts how the client can mmap the keymap fd so
bumping this is safe.
Signed-off-by: Sebastian Wick <sebastian@sebastianwick.net>
Sebastian Wick [Fri, 1 Nov 2019 01:15:10 +0000 (02:15 +0100)]
clients/window: bump wl_seat version to 6
Hook up listeners for touch shape and touch orientation.
Signed-off-by: Sebastian Wick <sebastian@sebastianwick.net>
Sebastian Wick [Fri, 1 Nov 2019 01:09:28 +0000 (02:09 +0100)]
input: bump wl_seat version to 6
New in version 6 are touch shape, touch orientation and axis source
wheel tilt. Weston doesn't support any of them yet but simply not
sending the new events and new enum value is sufficient to claim to
support this version.
Also bump the Wayland requirement to 1.17 to ensure both version 6 and 7
definitions are in the XML.
The reason for bumping to v6 without implementing the new features is
that we must support v7 to make use of struct ro_anonymous_file
introduced in the previous commit.
Signed-off-by: Sebastian Wick <sebastian@sebastianwick.net>
Sebastian Wick [Fri, 1 Nov 2019 16:00:40 +0000 (17:00 +0100)]
CI: build wayland from source
The next commit bumps the required Wayland version beyond what the repo
version supports.
Build wayland 1.17 into the docker image.
Signed-off-by: Sebastian Wick <sebastian@sebastianwick.net>
Sebastian Wick [Tue, 23 Jul 2019 17:15:59 +0000 (19:15 +0200)]
shared: add read-only anonymous file abstraction
The ro_anonymous_file is an abstraction around anonymous read-only files.
os_ro_anonymous_file_create creates such a file with the contents passed
in data. Subsequent calls to os_ro_anonymous_file_get_fd return a fd
that's ready to be send over the socket.
When mapmode is RO_ANONYMOUS_FILE_MAPMODE_PRIVATE the fd is only
guaranteed to be mmap-able readonly with MAP_PRIVATE but does not
require duplicating the file for each resource when memfd_create is
available. RO_ANONYMOUS_FILE_MAPMODE_SHARED may be used when the client
must be able to map the file with MAP_SHARED but it also means that the
file has to be duplicated even when memfd_create is available.
See also:
weston commit
76829fc4eaea329d2a525c3978271e13bd76c078
wayland commit
905c0a341ddf0a885811d19e2b79c65a3f1d210c
Signed-off-by: Sebastian Wick <sebastian@sebastianwick.net>
Stefan Agner [Tue, 9 Jul 2019 20:02:00 +0000 (22:02 +0200)]
backend-drm: make GBM optional
Make GBM optional in case GL renderer is disabled. This allows to
build Weston with DRM backend without Mesa dependencies.
Signed-off-by: Stefan Agner <stefan@agner.ch>
Stefan Agner [Mon, 8 Jul 2019 22:50:30 +0000 (00:50 +0200)]
backend-drm: separate out DRM virtual support
Move DRM virtual support into a separate file. Use the remoting
compile time option to disable DRM virtual support since this is the
only user of DRM virtual support currently. This will make it easier
to build the DRM backend without GBM support.
Signed-off-by: Stefan Agner <stefan@agner.ch>
Stefan Agner [Sun, 21 Jul 2019 20:38:08 +0000 (22:38 +0200)]
remoting: make sure GL renderer is enabled
The remoting plug-in requires DRM virtual support which depends on
the GL renderer. Make sure the option is enabled.
Signed-off-by: Stefan Agner <stefan@agner.ch>
Stefan Agner [Sun, 20 Oct 2019 16:25:42 +0000 (18:25 +0200)]
backend-drm: use DRM_ constants everywhere
Use DRM_ constants for pixel formats in all cases.
Signed-off-by: Stefan Agner <stefan@agner.ch>
Pekka Paalanen [Tue, 9 Jul 2019 09:06:42 +0000 (12:06 +0300)]
build: do not allow unresolved symbols
Now that all cases of unresolved symbols have been either fixed or worked
around pending for a proper fix, we can switch the project to disallow
unresolved symbols during build. This will help catch programming mistakes
earlier.
Note, that existing Meson build directories will not automatically apply this
change. If you have an existing build directory, you must issue
meson configure -Db_lundef=true
in it.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Pekka Paalanen [Tue, 9 Jul 2019 09:02:34 +0000 (12:02 +0300)]
tests: surface-screenshot needs libshared
surface-screenshot-test.c uses file_create_dated() provided by libshared, so it
needs to link libshared.
This was not a problem when unresolved symbols during build were allowed and
the symbols was provided by the weston executable which accidentally exported
all libshared symbols. This would become a problem when we disallow unresolved
symbols project-wide, so fix it.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Pekka Paalanen [Tue, 9 Jul 2019 09:00:41 +0000 (12:00 +0300)]
Link Weston plugins to libexec-weston.so
All these plugins use symbols that were exported by the weston executable and
are now exported by libexec-weston.so. Linking these to libexec-weston.so fixes
unresolved symbols.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Pekka Paalanen [Tue, 9 Jul 2019 08:56:05 +0000 (11:56 +0300)]
backend-rdp: work around unresolved symbols
This is preparation for disallowing unresolved symbols project-wide.
This is a temporary fix that should be reverted and fixed properly later.
/usr/bin/ld: libweston/backend-rdp/13a5658@@rdp-backend@sha/rdp.c.o: in function `rdp_peer_context_new':
/home/pq/build/weston-meson/../../git/weston/libweston/backend-rdp/rdp.c:748: undefined reference to `Stream_New'
/usr/bin/ld: libweston/backend-rdp/13a5658@@rdp-backend@sha/rdp.c.o: in function `rdp_peer_context_free':
/home/pq/build/weston-meson/../../git/weston/libweston/backend-rdp/rdp.c:781: undefined reference to `Stream_Free'
/usr/bin/ld: libweston/backend-rdp/13a5658@@rdp-backend@sha/rdp.c.o: in function `xf_input_keyboard_event':
/home/pq/build/weston-meson/../../git/weston/libweston/backend-rdp/rdp.c:1220: undefined reference to `GetVirtualKeyCodeFromVirtualScanCode'
/usr/bin/ld: /home/pq/build/weston-meson/../../git/weston/libweston/backend-rdp/rdp.c:1224: undefined reference to `GetKeycodeFromVirtualKeyCode'
/usr/bin/ld: libweston/backend-rdp/13a5658@@rdp-backend@sha/rdp.c.o: in function `weston_backend_init':
/home/pq/build/weston-meson/../../git/weston/libweston/backend-rdp/rdp.c:1469: undefined reference to `winpr_InitializeSSL'
See also #262
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Pekka Paalanen [Tue, 9 Jul 2019 08:53:14 +0000 (11:53 +0300)]
cms-colord: work around unresolved symbols
This is preparation for disallowing unresolved symbols project-wide.
This is a temporary fix that should be reverted and fixed properly later.
/usr/bin/ld: compositor/fb12c4d@@cms-colord@sha/cms-helper.c.o: in function `weston_cms_set_color_profile':
/home/pq/build/weston-meson/../../git/weston/compositor/cms-helper.c:79: undefined reference to `cmsReadTag'
/usr/bin/ld: /home/pq/build/weston-meson/../../git/weston/compositor/cms-helper.c:91: undefined reference to `cmsEvalToneCurveFloat'
/usr/bin/ld: /home/pq/build/weston-meson/../../git/weston/compositor/cms-helper.c:92: undefined reference to `cmsEvalToneCurveFloat'
/usr/bin/ld: /home/pq/build/weston-meson/../../git/weston/compositor/cms-helper.c:93: undefined reference to `cmsEvalToneCurveFloat'
/usr/bin/ld: compositor/fb12c4d@@cms-colord@sha/cms-helper.c.o: in function `weston_cms_destroy_profile':
/home/pq/build/weston-meson/../../git/weston/compositor/cms-helper.c:108: undefined reference to `cmsCloseProfile'
/usr/bin/ld: compositor/fb12c4d@@cms-colord@sha/cms-helper.c.o: in function `weston_cms_load_profile':
/home/pq/build/weston-meson/../../git/weston/compositor/cms-helper.c:131: undefined reference to `cmsOpenProfileFromFile'
See also #263
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Pekka Paalanen [Mon, 8 Jul 2019 14:12:41 +0000 (17:12 +0300)]
compositor: turn weston main() into a lib
This takes everything that was in 'weston' the executable a turns it into
library. A new trivial 'weston' executable is written.
Creating the library will allow future improvements:
- we can link weston plugins against the library, meaning that they no longer
need unresolved symbols to be allowed during linking
- tests do not have to fork() and exec() 'weston', they can just link to the
library and call wet_main() after setting things up; this will help with
using a debugger
install_rpath is set so that we can install the library into weston's module
directory, away from the normal libraries in a system. This is one library we
do not intend for others to use.
The library has no stable ABI and is not versioned.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Pekka Paalanen [Thu, 17 Oct 2019 13:32:34 +0000 (16:32 +0300)]
build: reduce sub-dependencies of libweston
Make the libweston dependency objects pull in only those secondary dependencies
that are actually used in the API. This way in-tree users of libweston link to
fewer libraries needlessly, and it matches better what external users get via
pkg-config.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Pekka Paalanen [Thu, 24 Oct 2019 10:25:13 +0000 (13:25 +0300)]
backend-x11: need libdrm headers in build
9ddb3bc315adbc0c3951f00458fe05973fd13ef6 started using drm_fourcc.h but forgot
to add libdrm headers to the dependencies.
This fixes the build for build-native-meson-no-gl-renderer when a future patch
reduces the dependencies pulled in by the libweston dependency object.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Pekka Paalanen [Thu, 17 Oct 2019 13:20:57 +0000 (16:20 +0300)]
build: link libdl explicitly to DRM backend
In the future libweston will stop providing it for its users, since it's not
part of libweston API.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Pekka Paalanen [Thu, 17 Oct 2019 13:17:57 +0000 (16:17 +0300)]
build: link libm explicitly
In the future libweston will stop providing it for its users, since it's not
part of libweston API.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Pekka Paalanen [Thu, 18 Apr 2019 13:43:55 +0000 (16:43 +0300)]
build: separate deps for int and ext libweston users
We have two kinds of libweston users: internal and external. Weston, the
frontend, counts as an external user, and should not have access to libweston
private headers. The shell plugins are external users as well, because we
intend people to be able to write them. Renderers, backends, and some plugins
are internal users who will need access to private headers.
Create two different Meson dependency objects, one for each kind.
This makes it less likely to accidentally use a private header.
Screen-share is a Weston plugin and therefore counts as an external user, but
it needs the backend API to deliver input. Until we are comfortable exposing
public API for that purpose, let it use internal headers.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Pekka Paalanen [Thu, 24 Oct 2019 09:48:43 +0000 (12:48 +0300)]
gitlab-ci: fix pages
This hopefully fixes a failure introduced in
5a0706b238987bf3dcf7dde54556850ee88ccdba:
cp: cannot stat '/builds/wayland/weston/prefix-weston-build-native-meson/share/doc/weston/*': No such file or directory
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Stefan Agner [Sun, 20 Oct 2019 15:19:03 +0000 (17:19 +0200)]
gitlab-ci: add build configuration without gl-renderer
Building without gl-renderer seems to fail rather often. Introduce a
specific build job which tests this configuration.
Make use of the Folded Block Scalar in YAML to concatenate the build
option string with spaces. This will make diffing build option
changes very readable.
Signed-off-by: Stefan Agner <stefan@agner.ch>
Stefan Agner [Sun, 20 Oct 2019 15:17:20 +0000 (17:17 +0200)]
clients: avoid build error without gl-renderer
Make sure gl-renderer is enabled when building the EGL and EGL
dmabuf clients. This avoids missing declaration warnings and
linking errors such as:
../clients/simple-dmabuf-egl.c:1142: undefined reference to `weston_check_egl_extension
...
../clients/simple-egl.c:206: undefined reference to `weston_check_egl_extension'
Signed-off-by: Stefan Agner <stefan@agner.ch>