Commit Graph

7069 Commits

Author SHA1 Message Date
Leandro Ribeiro 2a6cfef07e screen-share: define variable type before using as function argument
Define the void pointer as pixman_region32_t instead of using it
directly.

Void pointers are used by generic API's so each user can define
a data type as needed. Not doing this is dangerous, since void
pointers implicitly cast from/to any pointer without giving
warnings. So we must define its type instead of using it directly
in a function call.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2019-12-11 19:36:57 +00:00
Emmanuel Gil Peyrot 1b3ad0993b backend-drm: Make boolean fields actually bool
Continues what dd8219b3fb started, also in
the DRM backend.
2019-12-11 19:33:20 +00:00
Emmanuel Gil Peyrot b2f54d9f17 backend-drm: Remove unused variable
Its last usage was removed in 31838bf17e.
2019-12-11 19:33:20 +00:00
Leandro Ribeiro f0cd00a855 clients/window: drop support for rgb565
Remove member preferred_format from struct window and hardcode
ARGB32 pixel format for clients/window.

The member preferred_format was first added to allow hinting
of a preference for RGB565 when creating a window. But it is
not being used for a long time now. So it's safe to remove it
from the code, dropping support for RGB565 in clients/window.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2019-12-11 19:28:30 +00:00
Daniel Stone 90eee632ca CI: Bump ci-templates dependency for working pip
wayland/ci-templates!18 allows the $HOME environment variable to
propagate into the execution of creating our build container. Without
that, buildah would leave us with an empty $HOME, which would have pip
install into /.local/bin.

As $HOME is preserved during our actual native builds, we would try to
find meson in /root/.local/bin and fail, since it had been stored to a
different path.

Bump the ci-templates dependency to one with the fix so we can build new
images again.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2019-12-11 15:22:24 +00:00
Stefan Agner 723c6a1266 backend-drm: Define potentially missing aspect-ratio bit definitions
The aspect ratio definitions for 64:27 and 256:135 have been added with
libdrm 2.4.95. However, Weston currently depends on libdrm 2.4.89 or
higher. Define the definitions in Weston to support libdrm older than
2.4.95.

Fixes: #332
Fixes: 6093772f45 ("backend-drm: Use aspect-ratio bit definitions from libdrm")
Signed-off-by: Stefan Agner <stefan@agner.ch>
2019-12-09 13:08:24 +00:00
Stefan Agner 0bb9447653 renderer: change all frame_signal emission to pass previous_damage
Commit adaf8c7410 ("renderer: change frame_signal emission to pass
previous_damage as data argument") missed updating all frame_signal
emissions. Later commit 2619bfe420 ("move frame_signal emission to
weston_output_repaint()") fixed this deficency along with moving the
location of the emission. Due to an issue of the location change, this
commit had to be reverted again.

This makes sure that the pixman as well as the GL renderer now also
emits the damage region instead of the Weston output.

Fixes: adaf8c7410 ("renderer: change frame_signal emission to pass previous_damage as data argument")
Signed-off-by: Stefan Agner <stefan@agner.ch>
2019-12-09 13:32:07 +01:00
Simon Ser 404a84a03a
build: bump to version 7.0.91 for the alpha release 2019-12-06 20:30:51 +01:00
Leandro Ribeiro 2eee164f24 libweston: remove previous_damage from struct weston_output
The member previous_damage from struct weston_output is no longer necessary.
First, stop calling init, fini and copying output_damage to it. Then remove
it from struct weston_output.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2019-12-04 07:58:26 +00:00
Marius Vlad 0a9359d291 gitlab-ci: Update ci-templates to latest SHA commit
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-12-03 18:21:15 +02:00
Leandro Ribeiro 914c96c3d2 Revert "move frame_signal emission to weston_output_repaint()"
The emission of frame_signal has to happen before a flip, otherwise
glReadPixels() could read an old frame or even worse an uninitialized buffer.
So move frame_signal emission back to renderers.

This reverts commit 2619bfe420.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2019-12-03 12:31:53 -03:00
Simon Ser abdb0a29f2
clients: remove leftover from simple-dmabuf-drm
This header is not used anymore.

Signed-off-by: Simon Ser <contact@emersion.fr>
Fixes: 0a4f6e7d6d ("clients: drop simple-dmabuf-drm")
Reported-by: Marius Vlad <marius.vlad@collabora.com>
2019-12-02 10:44:27 +01:00
Link Mauve 2144ded579 xwayland: Remove unused variable 2019-12-01 22:17:14 +00:00
Daniel Stone dd8219b3fb option-parser: Make bools boolean
When option-parser is confronted with a boolean option, have it write a
bool rather than treating the value as a pointer to an int32.

(lib)weston already heavily uses bool types internally, so this has the
nice side effect of eliminating quite a few local variables which only
existed as integer shadows of internal boolean variables.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2019-11-28 19:24:13 +00:00
Daniel Stone b8c3926445 tests/config-parser: Remove useless duplicate test
test012 and test013 were exact duplicates of each other: asserting that
they could successfully look up a single boolean value.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2019-11-28 19:24:13 +00:00
Daniel Stone 51d995ad82 config-parser: Make get_bool be bool
Wayland innovated a lot of cool things, but non-binary boolean values is
the great advances of our time.

Make config_parser_get_bool() work on boolean values, and switch all its
users.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2019-11-28 19:24:13 +00:00
Simon Ser 0a4f6e7d6d
clients: drop simple-dmabuf-drm
This client contains driver-specific code to allocate buffers. However clients
shouldn't contain driver-specific code and should rely on e.g. mesa to allocate
buffers via standard interfaces.

Additionally, because the build system always tries to enable all features, some
experimental drivers and drivers that aren't included in amd64 distribution
packages were required. Users would need to manually disable some drivers.
Releasers would need to install libdrm from source (because the release process
forbids adding custom build flags). Dropping simple-dmabuf-drm simplifies both
building and releasing.

The functionality previously tested via simple-dmabuf-drm can now be tested with
simple-dmabuf-egl.

Signed-off-by: Simon Ser <contact@emersion.fr>
2019-11-28 15:20:13 +01:00
Daniel Stone 6093772f45 backend-drm: Use aspect-ratio bit definitions from libdrm
When the aspect-ratio-aware mode support was added to Weston, it was
done before the libdrm support was finalised and merged. Between it
being added to Weston and being merged, it changed to no longer provide
the offset for the bitmask.

Instead of using the mask and a compatible enum, if we update our
libdrm dependency, we can use the flag definitions directly from libdrm.

In 94e4068ba1, the libdrm dependency was bumped to 2.4.83, which
enabled us to remove a bunch of error-prone ifdefs by making atomic and
modifier support mandatory.

We determined in the discussion of !311 that it was safe to push the
dependency as high as 2.4.91, as that was what was available in major
distributions.

Bumping to 2.4.86 allows us to safely remove the ifdef and go with
upstream flags, as that was added in mesa/drm@0d889201d1.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2019-11-27 17:52:16 +00:00
Leandro Ribeiro 0f6bd69752 screen-share: get previous_damage from data argument instead of weston_output
Instead of getting previous_damage from the weston_output struct, get it from
the frame_signal data argument. This will make possible to remove
previous_damage from weston_output after we decide what to do with
output->previous_damage usage in DRM backend.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2019-11-27 13:47:14 -03:00
Leandro Ribeiro e28e831211 screenshooter: get previous_damage from data argument instead of weston_output
Instead of getting previous_damage from the weston_output struct, get it from
the frame_signal data argument. This will make possible to remove
previous_damage from weston_output after we decide what to do with
output->previous_damage usage in DRM backend.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2019-11-27 13:47:09 -03:00
Leandro Ribeiro adaf8c7410 renderer: change frame_signal emission to pass previous_damage as data argument
This will make possible to users that are listening to frame_signal to get
previous_damage from the data parameter instead of using
output->previous_damage.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2019-11-27 13:47:09 -03:00
Leandro Ribeiro 442ffcb755 tests: stop using frame_signal 'void *data' argument to get weston_output
Instead of getting weston_output from the frame_signal argument 'void *data',
add weston_output in the private data struct of the users that are listening
to frame_signal. With this change we are able to pass previous_damage as the
data argument.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2019-11-27 13:47:09 -03:00
Leandro Ribeiro dd0d0b0df1 screenshooter: stop using frame_signal void *data parameter to get weston_output
Instead of getting weston_output from the frame_signal argument 'void *data',
add weston_output in the private data struct of the users that are listening
to frame_signal. With this change we are able to pass previous_damage as the
data argument.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2019-11-27 13:46:51 -03:00
Leandro Ribeiro 2619bfe420 move frame_signal emission to weston_output_repaint()
In order to remove duplication and make the code easier to follow, move
frame_signal emission from renderers to weston_output_repaint(). This should
have no observable effect.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2019-11-27 13:18:42 -03:00
Vivek Kasireddy 9e7e7fac37 gl-renderer: Add support for XYUV format (v2)
Accept XYUV dmabuf buffers that a client application such as
weston-simple-dmabuf-v4l might submit.

v2 (Daniel):
Add XYUV to yuv_formats array to have the compositor color convert
with a shader if GL_TEXTURE_EXTERNAL_OES does not work.

Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
2019-11-25 17:19:33 -08:00
Vivek Kasireddy ae3175780e gl-renderer: Replace EGL_*_WL macros with locally defined enums
Instead of using the EGL_*_WL macros imported from EGL headers,
start using enums that would be defined locally. This is needed as
there are limited number of macros defined in EGL headers and
adding new ones is not practically feasible when adding a new
texture type. (suggested by Daniel Stone)

Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
2019-11-25 17:13:06 -08:00
Harish Krupo 3623e46dc5 desktop-shell: Set 1x1 buffers for solid-color backgrounds
When we are going to set a solid color for the background, use
a 1x1 buffer and set the viewport to the full size. This avoids
un-necessary allocation of buffer memory.

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
2019-11-25 21:54:40 +00:00
Harish Krupo 7bcbab1f2f clients/window: Add viewport destination support
Add support for setting the widget's destination wp viewport.
Setting it in the widget instead of being set directly by the client
ensure that the widget can be identified in widget_find_widget.

v2: Return -1 on error (Pekka)
    Scale allocated x and y when viewport is set (Pekka)
    Allow user to set -1 for viewport width and height (Pekka)

v3: Use NULL instead of 0 (Daniel)
    return 0 if width and height are -1 (Daniel)

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
2019-11-25 21:54:40 +00:00
Marius Vlad 7e0f20311f 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>
2019-11-25 20:40:24 +00:00
Marius Vlad 36453951fb 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>
2019-11-25 20:29:49 +00:00
Marius Vlad d2dbcd3d7e 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>
2019-11-25 20:29:49 +00:00
Marius Vlad 0ba0b8e86f 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>
2019-11-25 20:29:49 +00:00
Marius Vlad b1f5f8076a 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>
2019-11-25 20:29:49 +00:00
Veeresh Kadasani bdfc11cd1b 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>
2019-11-25 20:16:45 +00:00
Daniel Stone 3ef098fad1 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>
2019-11-25 12:27:08 +00:00
Pekka Paalanen 531b61c14a 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>
2019-11-25 13:11:56 +02:00
Leandro Ribeiro a2e80aca68 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>
2019-11-23 13:15:59 -03:00
Leandro Ribeiro 6196b201be 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>
2019-11-23 09:57:52 +00:00
Leandro Ribeiro 94e4068ba1 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>
2019-11-23 09:57:52 +00:00
Marius Vlad 18462e8924 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>
2019-11-22 20:25:20 +02:00
Marius Vlad 48bc5efa7c 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>
2019-11-22 17:11:36 +02:00
Marius Vlad 788e80db77 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>
2019-11-22 17:11:36 +02:00
Marius Vlad bd002b9884 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>
2019-11-22 17:11:28 +02:00
Pekka Paalanen b544ac3ab4 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>
2019-11-22 16:09:41 +02:00
Pekka Paalanen e4f6f8c6de 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>
2019-11-22 16:09:20 +02:00
Pekka Paalanen 48d2c15ad6 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>
2019-11-22 12:54:51 +02:00
Pekka Paalanen 54c03dfe51 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>
2019-11-22 12:54:32 +02:00
Pekka Paalanen 12a138d51e 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>
2019-11-22 12:54:10 +02:00
Pekka Paalanen dc9d3342a8 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>
2019-11-22 12:53:29 +02:00
Pekka Paalanen 2c73b673a7 tests: write image to current directory by default
This reverts 50b7b70835.

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>
2019-11-22 12:53:01 +02:00