The majority of KMS devices support pre-multiplied encoded framebuffers.
But a few of them don't. This adds support for such devices.
In-shader blending is required for this, and it shouldn't work on
devices that don't support it. For now this works only with the
GL-renderer.
Note: this should never work with test quirks
gl_force_full_redraw_of_shadow_fb and blending_impl ==
WESTON_BLENDING_IMPL_FF.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Let's follow the code design of the other properties: init them with
_DEFAULT. In the setter function we ensure they are >= 0 and < COUNT,
just like we do with other properties.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Continuing my quest to remove weston_view from backends and renderers,
drop gl-renderer's last use of weston_view.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
The paint_node life cycle should match the output's, so we should be able
to store it in the state instead of a view.
This gets us closer to having the backends stop caring about views.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
We already validate the paint node list in weston_output_repaint,
immediately after we conditionally rebuild the z_order_list.
These asserts are thus completely redundant, as we've already
performed them in the front end.
My reason for removing this now is to drop weston_view usage
from the backend.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
The paint node early update has already checked this value for us, we
should use that instead of interacting with the view.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Backends work on paint nodes, not views - and the paint node internal
name is a superset of the view internal name anyway, so it's not hard to
figure out which view a paint node belongs to when reading debug text.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
The failure reason is already part of the paint node, so passing the view
here just makes things a little bit more complicated.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Backends should be relying on paint nodes for their information, not
views.
Since we always have a paint node when we want to pass a buffer, we can
pass that instead of a view.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Now that ICC<->parametric image description interoperability is
implemented, and the stock sRGB profile is parametric, we can change the
default to what it should be.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
TF_SRGB will be deprecated, best to never advertise it. The test can
simply use gamma22 instead.
TF_EXT_LINEAR has an implementation and should be usable nowadays.
TF_ST2084_PQ, GAMMA22 and GAMMA28 likewise.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Weston does not support the saturation rendering intent for parametric
image descriptions yet. Not really, Weston would just do the same as
media-relative with BPC does.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This avoids ICC paths when no ICC profiles are explicitly used.
We can simplify the profile information sending and use the generic path
for the stock profile as well, no longer hard-coding the stock profile
in two places.
Since the stock profile creation cannot fail, we can streamline
cmlcms_init() a little, too.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
The icc<->parametric color transformation code uses "optical ICC
profiles" as part of the ICC pipeline. These profiles use a linear TRC
to encode the black point. When such TRC survives all optimizations, it
will cause the 3D LUT fallback path to be taken.
Detect such curve sets on the ICC pipeline optimizer, and convert them
to matrix stages. The matrix stages will then be optimized as usual,
often eliminating the stage completely.
The results can be seen in color-icc-output test after the stock sRGB
profile has been changed into a parametric one, causing all cases in the
test to hit the parametric-to-icc path. Some tests fail when they
suddenly start using the 3D LUT path which causes the errors to rise.
This patch fixes those (future) cases, and the errors remain the same as
before changing the stock profile.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
I don't have a specific use case in my mind for this, but it is
something we can easily handle.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
I need the new function for another purpose later, and this makes
get_parametric_curveset_params() easier to read.
Pure refactoring: no change in behavior.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Implementation of sending the protocol info events for an arbitrary
parametric image description.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
The power-law TF uses a different protocol event than others. Adding
support for it requires passing in the parameters.
Now we have a single send function that handles all protocol TFs, not
just those without parameters.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Pure refactoring to clean up cmlcms_send_image_desc_info() ahead of
implementing generic parametric information sending.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
If we don't receive a surface_leave before an output_destroy, the window
output lists can hold a stale reference to the destroyed output.
Call surface_leave for the output on all windows to make sure it's not on
any lists.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
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>