Before checking if our LittleCMS curve matches any of our known tf, we
need to map it to one of our well-known LINPOW or POWLIN.
We were doing that, but setting only the g param of the curve. a, b, c,
and d were not being set, resulting in a mismatch when comparing the
curve parameters with the ones in our tf's. As we were not finding any
match, we were always mapping the LittleCMS power-law to the parametric
power-law tf, even if the exponent was 2.2 or 2.4 (which have their own
tf's).
Now we properly set all the parameters before doing the check.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Up to now, we'd not try to offload WESTON_TF_ST2084_PQ through a colorop
of type curve. The kernel supports only PQ 125 EOTF, which is the PQ
EOTF scaled by 125. Same goes for the inverse of the EOTF.
In order to support that, use multiplier colorops to scale things up or
down (depending if we have EOTF or its inverse).
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
When the pipelines do not support our color xform or when the color
manager is unable to convert the color xform into operations that Weston
understands (currently: pre-curve, color mapping and post-curve), we
were simply not trying to offload the transformation.
But we have an alternative: trying to decompose the xform into shaper +
3D cLUT and check if there's a compatible pipeline. This commits adds
the support for that.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This name is quite long and awkward to use in certain functions. On ICC
nomenclature, cLUT is a multidimensional LUT with a shaper (1D LUT) in
front of it. So let's just call it to_clut() to simplify.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Use the per-plane color pipelines to offload pre-blend Weston color
transformations when possible.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
We may have DRM LUT's for u32 and u16. This allow us to create both
types. Should be useful in the next commit.
u16 is used for legacy GAMMA_LUT, and u32 will be used for the newer
colorops in the next commits.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Follow-up of "backend-drm: offload post-blend only if libdrm >=
2.4.130". This moves code related to offloading post-blend color xform
to colorops.c, which is built only if libdrm >= 2.4.130 is available.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
In commit "backend-drm: introduce color pipelines" we've started adding
support for KMS plane color pipelines, which require libdrm >= 2.4.130.
The final goal is using color pipelines to offload pre-blend color
transformations.
Currently we support offloading post-blend color transformations even
with older libdrm versions, but that is not very useful by itself.
This patch makes offloading post-blend color transformations dependent
on the libdrm version as well. This allows keeping the code to offload
pipelines in a single file (which is built only if libdrm >= 2.4.130),
avoiding lots of #ifdefs and making the code easier to follow.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This adds support to the kernel proposal that introduces per-plane color
pipelines. For now it only manages the lifetime of the kernel objects
related to that.
In the next commits we start using all that to offload Weston pre-blend
color transformations to KMS.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
We use this struct to cache and avoid creating multiple blobs for the
same 3x1D LUT. So let's rename to better reflect that.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Move struct to another part of the header, change a few variable/param
names and replace an useless u64 by u32.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
We usually use the variable name 'ec' for struct weston_compositor. We
currently use the same in our assert macros, bringing issues.
Rename 'ec' to 'wc_' in our assert macros, avoiding this kind of issue.
Also, this fixes a weston_assert_ macro call in which we forgot to
declare 'ec' before calling it.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
A few custom shells want to know when the compositor is going to sleep.
This adds a new sleep signal and emits it when DPMS is going off.
To showcase the feature, this adds a sleep signal listener to
desktop-shell whose handler logs a message.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
When we receive dmabuf feedback, we hit the VK_SUBOPTIMAL path and
recreate the swapchain, returning early without submitting work.
However, we've already reset the fence before we do this, so we'll
block forever waiting for work that never comes to signal it.
Instead, we should reset the fence right before we know we're submitting
work.
Fixes: 75c37afa ("clients/simple-vulkan: New Vulkan client example")
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
We currently leak resources and hit asserts if dmabuf is unavailable.
Move the check to before we initialize anything.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Since the commit "color-lcms: extract HDR static metadata from profile"
this was all dead code.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Extract the HDR static metadata type 1 from the output color profile
directly, instead of relying on a separate weston.ini section to provide
the metadata separately.
Weston should tell the monitor what target color volume it is rendering
for. I don't see a reason to be able to control the metadata separately,
and it would add complexity.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
We should just return 0 on success, not return some enum with
a value that happens to be initialized to something that resolves
to 0.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
We can use __VA_OPT__ to make a macro that automatically selects between
the puts and printf log scope variants.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
The point of buffer_transform_split is to ensure that committing only
transform and scale changes gets reflected on screen, without explicit
damage. There is no need to go through the big set of parameter
combinations, it only needs to test that changing each triggers the
damage.
Test setting only scale and only transform separately, so that one
cannot mask bugs with the other.
This brings the screenshot count for buffer_transform_split from 12 down
to 2, which is good for CI running time.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This test was originally written to ensure Weston does not repaint too
much, but it does also test that renderers transform the damage
correctly into the framebuffer.
Signed-off-by: Pekka Paalanen <pekka.paalanen@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>