This adds Perfetto debug annotations for printing optimizations, color
vision deficiencies, alpha.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Introduce a bunch of helper macros and flush function that allow in-situ
debug annotation of Perfetto tracks.
This introduces a STR, INT and FLOAT variants to stack debug annotations
into a temporary array and have COMMIT to push that to Perfetto.
There's a maximum imposed limit of 128 entries in the array. Users
shouldn't be concerned with allocating char string arrays as COMMIT will
basically flush all the data in the temporary array to Perfetto.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Rename 'timeline' to 'activity' and 'elapsed' to
'active'.
Feels like this it would more familiar to people when analysing
traces and uses the Perfetto naming for consistency. Otherwise I'd
rename 'activity' to 'timeline' for Perfetto track names.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This avoids truncation to zero, by using an explicit cast to float and
print out properly the last 2 digits.
43 / 1000 = 0.00
43 / 1000.0 = 0.04
Fixes: 2d70cbf037
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Since a paint node is a combination of surface, view, and output, using
the surface flow in paint node functions can make a confusing twisty mess.
Perfetto flows have in/out degree of one, so we can't properly express the
1 surface to multiple paint nodes relationship with flows.
So for now let's break up the surface and paint node flows, but in the
future we'll have better ways to map multiple flow starts to the same
function via INSTANT events, and we'll be able to better link surface
content update to paint node render.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
The Damaged event is the result of a content update application on a
surface. So it makes sense to put this in the flow for the surface.
The Clean event comes from a render completion that could be driven by any
surface, so it doesn't really make sense to consider it part of surface
flow.
Signed-off-by: Derek Foreman <derek.foreman@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>
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 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>
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>
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>