Instead of having the drm backend calculate these per frame, let's store
them in the paint node when they change.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This was confusing, because it seemed to magically imply that we could
transform points by invalid transformations.
Rename and better define the variable.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Do the math on floats before the conversion to fixed point. Later, we'll
move this math to the front end where we'd like to store these values
clamped, but not in the backend specific fixed point format.
Signed-off-by: Derek Foreman <derek.foreman@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>
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>
We can't rely on Vulkan implementations placing an implicit fence on our
dmabuf, so let's do it ourselves.
Signed-off-by: Daniel Stone <daniels@collabora.com>
We've been keeping these poorly tested paths around long enough, it's time
to deprecate them, to be dropped after the next major release.
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 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>
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>
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>