Rather than fail the tests that require fb-fetch GL ES feature and it's
missing, mark them as skipped instead. This helps people who run the
test suite manually.
In CI, a skip is marked as failure anyway.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
If the compositor fails to initialise in such a way that we want to
skip, don't leak the idle source.
This fixes the ASan failure, but still results in a TAP-parsing failure.
Signed-off-by: Daniel Stone <daniels@collabora.com>
If some initialization code somewhere calls
weston_compositor_exit_with_code() to set an error, don't bother running
at all.
This is useful for alpha-blending test when it tries to force different
blending implementations on the GL-renderer.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This ensures that both blending implementations will be tested. The AUTO
mode, which was the only mode before this patch, would not test the
fixed-function blending a.k.a GL-renderer shadow framebuffer.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Assertions are the usual way of failing tests in the compositor code,
but it means the test program cannot continue further. It would be
better to save an error exit code and run the compositor to the finish,
and then continue with the next test fixture.
I want to force some paths in GL-renderer output initialization for a
test, and fail otherwise. Calling weston_compositor_exit_with_code()
crashes there though, because the frontend has not installed the exit
handler yet.
Skip the exit handler if it's not there. The error exit code is still
saved, and will eventually bubble out of the compositor.
While at it, let's document these.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This creates the fragment shader state needed for in-shader blending.
In-shader blending is always enabled if supported:
- GL supports the necessary features, and
- the blend-to-output color curve is exactly invertible.
The exact inverse is required, because the compositor will do repeated
decode-encode cycles per destination pixel, one for each non-opaque
source. Roundtrip errors through decode-encode might accumulate
otherwise. For now, identity, enumerated, and parametric curves are
deemed invertible while LUT is rejected without inspection.
Therefore to make use of this feature, outputs need to be configured with
a non-LUT type EOTF/TRC.
In-shader blending is always enabled, because it should be universally
more efficient than the use of a shadow buffer.
This feature was originally drafted for Weston by Sebastian Wick.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This will be needed for framebuffer decoder and encoder for in-shader
blending.
Pure refactoring in gl_renderer_color_transform_create_steps().
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Discriminate between renderbuffer discard and shadow allocation
failures. While at it, let's pring the shadow pixel format rather than
hardcoding it in a string.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Make the shader description strings easier to read. Before they looked
like this:
Compiling shader program for: SHADER_TEXCOORD_INPUT_ATTRIB
SHADER_VARIANT_SOLID SHADER_COLOR_EFFECT_NONE SHADER_COLOR_CURVE_LINPOW
SHADER_COLOR_MAPPING_IDENTITY SHADER_COLOR_CURVE_IDENTITY
+input_is_premult -tint -shader_blending (SHADER_COLOR_CURVE_IDENTITY,
SHADER_COLOR_CURVE_IDENTITY)
Now they look like this:
Compiling shader program for: attr tc, solid tex, no effect, CP{
linpow, I, I }, +premult_in -tint -shader_blending (I, I)
Turn the switches into arrays for easier handling.
This is different from weston_enum_map, because we need two different
strings for each value: a symbol for the shader code, and a description
for the debug logs.
Unknown enum values will abort(), but they should be asserted anyway.
Unfortunately getting a weston_compositor here would be inconvenient for
using weston-assert macros.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This prepares the fragment shader for blending in-shader instead of
using the fixed-function blending.
This is not yet used, but it will allow avoiding the 16F shadow
framebuffer in the future.
TEX_UNIT_LAST is actually a count rather than the index of the last
unit. Fix the off-by-one in the check.
The FB fetch/store curves push our potential texture count beyond 8, so
implement a runtime check.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
We shouldn't need to test state, because the state that worked previously
should work again. However, to be completely safe against unpredictable
edge cases, we've kept a state check.
Remove that check and instead force a state rebuild in the case of an
application failure.
Keep track of how often this happens so we can fall back to checking
instead of consistently failing state application.
fixes#1081
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
If we're in a steady state, doing nothing but flipping buffers, we can
try to avoid going through our full routine of brute-forcing an
acceptable plane state, by instead just reusing the old state and
changing only the FB it refers to.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This makes replacing an invalid/deleted buffer distinguishable from
a regular buffer update. This will be important when we try to reuse
plane states in a later commit.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
We have to walk it once for the dirty buffer, but we can accumulate our
changes along the way and walk it only once.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
When running inside a Hyper-V vm, a special mode needs to be enabled
so that the RDP server is accessible through vmconnect.exe from the
host.
For instance:
```
weston --backend rdp --vmconnect --address=vsock://1
```
Signed-off-by: gpotter2 <10530980+gpotter2@users.noreply.github.com>
Rather than passing a NULL use sizeloc to pass the size. Otherwise
fflush(3) and fclose(3) would die out crashing in libc.
Use size also when printing out to a subscriber.
Fixes: e9665ef36
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Fix the following error:
Generating doc/sphinx/weston-doc-breathe with a custom command
FAILED: [code=1] doc/sphinx/weston
doc/sphinx/run_doxygen_sphinx.sh
/home/pq/git/weston/libweston/compositor.c:10001: error:
Found non-existing group 'client' for the command '@ingroup',
ignoring command (warning treated as error, aborting now)
Fixes: df622cbb20
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This tests our dma-buf buffer support for GL screenshots. We use two
backends that have outputs with different y origin in order to exercise
the implementation.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This ensures that output capture implementation is behaving accordingly,
but not that the screenshot result is correct. In the next commit we
add tests for checking that.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
In the last commit we've added support for dma-buf screenshots in our
GL-renderer. So let's enable the screenshot client to use it.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This adds support for dma-buf screenshots in our GL-renderer.
For now it only supports GLES >= 3.0, as it depends on
glBlitFramebuffer(). In the future we'll add support for older GLES
versions as well, using a shader to do the blit.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
For now this doesn't bring any benefits besides making
gl_renderer_do_read_pixels_async() easier to read. But in the next
commits this will be important.
This allows callers to decide if they want to use a timer when they fail
to get a sync fence for a capture task. For SHM tasks we always fallback
to a timer, but for dma-buf we will not allow the fallback path.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
For now we support creating gl_capture_task only for SHM buffers. This
is used when the GL renderer pulls an output capture task from the
queue and its buffer type is SHM.
In the next commits we'll add support to allow output capture tasks to
be created with dma-buf buffers, so we need to extend gl_capture_task to
support that as well.
Differently from the SHM case, for dma-buf we don't have to do any copy.
The gl_capture_task is created just to wait for the blit to finish, and
then retire the output capture task.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This will be helpful in the next commits, in which we pass the buffer
type as parameter to a few functions. Adding the enum alow us to avoid
passing as unsigned int.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
All of these precede calls to weston_coord functions that now
do the transform update implicitly.
Some of them precede it immediately, and others through
functions like weston_pointer_set_focus and weston_pointer_send_motion
which use weston_coord_global_to_surface.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
I added these assert()s and have regretted it ever since. I'm sorry.
They've led to a bunch of places that just cargo-cult call
weston_view_update_transform() immediately after dirtying the transform,
as well as a lot of very carefully chosen places that took far too long to
sort out.
weston_view_update_transform() is an immediate return if the transform
isn't dirty, so let's just update them here instead of making everyone
think really hard about when to call weston_view_update_transform().
This should let us remove a few transform updates, and should
make the weston_coord functions a little easier to use.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
We were missing using the build-and-test.sh script for cases
where we don't actually use it. Split it to call it appopriately,
including without setting ASAN's sanitize option for no-test jobs.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Now that only overlay planes are on the handle list, we can simplify this
code a little bit.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Some drivers allow a planes-only state as long as something covers
the entire CRTC, and some allow planes-only state even with only
partial coverage.
If we have an fb that we'd like to put on the primary plane, but can't,
we might as well try it on an overlay anyway and see if we can build a
planes-only state without a primary.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
While not as weird as the cursor plane, the primary plane's case is
pretty weird. Pull it out of the loop and handle it early.
This is really intended to be a step torwards building a planes-only
output state without a primary plane in it at all.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
There's no need to evaluate these in any particular order, but I'm
going to refactor all the check unrelated to underlays into a single
place shortly.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Trying to use an underlay will always fail if the output doesn't support
them, so add a quick check here.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
There's only one mode where we can skip the renderer, let's base the check
on that instead of checking for an existing scanout fb.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
When a paint node is drawing rotated content, it's treated like its axis
aligned bounding box. Even if it only contains fully opaque content,
the parts of the axis aligned bounding box outside of that content
are not opaque.
We need to ensure we don't claim a paint node that isn't axis aligned
is fully opaque, or we'll improperly update regions outside of the
really opaque content.
Fixes 485e1796af
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
It makes more sense to update the transform than to bail.
These functions are sort of hints - they have to be correct when true, so
the previous code isn't really buggy. But they make more sense at a glance
this way.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
The client-buffer test was setting the desired output refresh rate to
the highest possible, posting a new buffer to the screen, waiting for
the frame callback, then requesting a screenshot be taken.
This was not necessary (we already have a mode for tests which only want
screenshots and not a free-running refresh), and also harmful in that it
setting up a potential race.
When gl-renderer gets asked to repaint with nothing to show, it tries to
read back the GL fence status after the dmabuf has signalled. On drivers
with the threaded context enabled, the GL fence would not be readable,
even if the attached dmabuf was.
The easy fix to this is to just not free-run refresh.
Signed-off-by: Daniel Stone <daniels@collabora.com>
As weston_surface_attach_solid() can change quite a lot about a surface,
we need to mark it as dirty.
Signed-off-by: Daniel Stone <daniels@collabora.com>
transform_damage() returns an allocated set of quads; if a surface had
both opaque and blended regions, we were overwriting the
previously-allocated set of quads for the blended region.
Luckily, transform_damage() doesn't need to be called twice anyway, so
we can fix this by only calling it once in the first case.
Signed-off-by: Daniel Stone <daniels@collabora.com>
No behavior changes; this is a follow-up of "drm: handle client buffer
destroyed while writeback scheduled".
That commit protects against clients disconnecting while a writeback job
is scheduled, which could otherwise lead to crashes if the buffer is
destroyed before the wb job completes. However, output capture provides
the same functionality: it listens to the client buffer destroy event to
retire the capture task.
Instead of listening to the wl_buffer destroy event, simply listen to
the capture task destroy event. GL renderer already follows this
pattern, and now DRM aligns with it.
See also:
weston_capture_task_buffer_destroy_handler()
weston_capture_task_add_destroy_listener()
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
No behavior change, just a refactor to make it more clear that the state
is freed after the capture task is retired.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>