Allow querying supported formats and modifiers.
We use version 3 as it is easier to implement and also works
if no main device is present - such as when using llvmpipe.
Signed-off-by: Robert Mader <robert.mader@collabora.com>
So we can test them on CI. For completeness and because they
are commonly used by SW decoders.
Signed-off-by: Robert Mader <robert.mader@collabora.com>
Add stride alignment support make various cleanups in
order to support both shm and dmabufs. No changes in
test results intended.
Signed-off-by: Robert Mader <robert.mader@collabora.com>
Similar to 0ff5ac0f7b, "desktop-shell: Add a placeholder curtain on
new outputs", to address the 68761d3f11, "compositor: Ensure the
scene graph isn't empty at repaint".
This is needed to allow ivi-shell to start-up otherwise we hit the
assertion introduced with 68761d3f11.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Fix a typo that caused test results to not be found. This adds them back
to the MR and pipeline Gitlab pages.
Fixes: 68fd41a719
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This consolidates the parameter unpacking for the two types of
parametric curves. The goal is code that reads better.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Using more structured types allows removing one of color_pre_curve() and
color_post_curve() completely, reducing code duplication.
Ideally I would have wanted to use a single type for a curve, having
both lut and par in it, but I am not sure the unused half would still be
eliminated during compilation.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Reduce pasta, reads better.
Shame that the string manipulation is so cumbersome. All strings are
hardcoded literals though, so the assert is good enough.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
The output resized signal sends a struct weston_output as the data, not
a struct weston_head.
Fixes 197c5e0084
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
If the view has become unmapped, the weston_desktop_surface should still
be unreferenced, otherwise it'll be leaked until the client disconnects.
Signed-off-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
In my haste to fix a crash in kiosk-shell, I made it potentially put
surfaces on wrong outputs instead.
Fixes e1ac6139ca
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Add asserts the same as what the color mapping 3D LUT uses, for
consistency since both implement a LUT with the same principles.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
The frequency of checking remaing the same, but we can use an already
needed switch statement and do not need one just for the asserts. This
makes gl_shader_config_set_color_transform() nice and short.
The MAPPING_MATRIX assert was useless, the variable is set right above.
Asserting the mapping type is valid happens already in
gl_shader_load_config_mapping().
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
The new function parameters acts as shorthands, making the moved code a
little more concise. It also gains an assert for an invalid mapping
type, which previously would have been awkward to code.
gl_shader_load_config() becomes easier to read.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This is both more consistent with other embedded unions, and it allows
to pull the union out into its own named type in the following patch.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This will help reducing the duplicate open-coding of pre- and
post-curves in the following commits. This is also a step towards
eliminating the duplication between struct gl_shader_config and
gl_renderer_color_transform.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Replace a plain array with a type-safe documented structure.
This will get more wide use later.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Rather than using a two-dimensional array, provide names to the fields.
The fields are primarily used by their names, but we also need the data
as a flat array of floats, so use unions to achieve that: two different
views into the same data.
This makes the code more self-explanatory. In color-operations.c it
removes a handful of temporaries. Comparison in color-properties.c is
simplified. ARRAY_COPY() turns into an assignment.
MAX_PARAMS_PARAM_CURVE is eliminated. Instead of having to maintain a
copy in fragment.glsl, the definition there is automated.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This helps me with VScode when clangd doesn't claim this header to be
full of unknown stuff.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
The output can be NULL, so that must be tested before looking up the
shell_output from the output.
Fixes 77dcbe381f
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
When weston tries to update drm head info, if the connector is disconnected, it cannot get the connector's property.
If get connector's property failed, drm_connector_assign_connector_info returns -1 and head->connector->conn, head->connector->props_drm remain to be nullptr, but they are used in update_head_from_connector, so the crash occurs.
So just return ret when drm_connector_assign_connector_info returns -1, and head->connector, head->connector will not be used later.
Signed-off-by: xufeng wang <550002860@gehealthcare.com>
Some external API's (e.g. DRM/KMS) are not capable of dealing with
enumerated color curves. In such cases, we may need to create LUT's that
correspond to such curves and give them to such API's
So add function weston_color_curve_to_3x1D_LUT() to craft 3x1D LUT from
a color curve.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
When we create a parametric color profile (we still do not fully
support, but plan to), a struct weston_color_tf_info is created.
So add a new function weston_color_curve_from_tf_info() to create a
color curve given a transfer function.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Since "color-lcms: recognize LCMS curves that matches transfer
functions", a few function names became slightly outdated. Rename them.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
LittleCMS curves contain curves that are parametric. They may be
well-known curves, and we are not checking that. If that's the case,
we should create enumerated color curves, instead of parametric.
This can be helpful for renderers and/or backends that want to implement
the curve, as they may have access to an API that accept enumerated
curves.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Not all color curves comes from parameters. For instance, with the
CM&HDR protocol users can set color curves from tf_info.
So let's add a new curve type to accommodate that.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This just makes the code more readable and should help us to avoid
mistakes in the future. No behavior changes.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Follow-up of "color: define max number of params for parametric curves
and tf's". Let's do the same for LittleCMS parametric curves.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Up to now we were using 10 as the max number of params for color curves
and transfer functions. But this came from LittleCMS, whose parametric
curves may contain up to 10 params.
But out color curves and tf's are not tied to LittleCMS, so let's define
constants to help avoid confusion.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
weston_global_destroy_save() can directly destroy a global if the
compositor state is WESTON_COMPOSITOR_OFFSCREEN.
Make sure we don't try to set_user_data after this has happened.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
With udmabuf we can write test for dmabuf paths in a similar
manner to shm. It's available by default in most recent distros
and thus works OOTB on developer setups.
Drop vgem as it isn't needed any more and makes the CI use
kms_swrast (instead swrast), which isn't compatible with the
llvmpipe dmabuf implementation yet.
Using swrast also streamlines CI with running tests locally,
making debugging easier.
Signed-off-by: Robert Mader <robert.mader@collabora.com>
llvmpipe now supports EGL_EXT_image_dma_buf_import, allowing
us to test zwp_linux_dmabuf_v1 on CI.
Signed-off-by: Robert Mader <robert.mader@collabora.com>
We have the following error message in parse_color_characteristics():
name=%s: reserved name. Do not use ':' character in the name.
It gets confusing when "name" ends with ':'. So rephrase it to clarify
the error message in such case.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
First of all, we make it work for NaN CIE xy values.
We also improve the error message a bit. It was only printing that the
color gamut was invalid, but it didn't explain why. This adds the
explanation (out of valid range).
And finally, we make the code a bit shorter.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
The internal API to create parametric color profiles should be available
not only to libweston, but also to frontend. WL_EXPORT was missing from
the functions, so add that.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Assert that the search param structure is well-formed, so that there
won't be cache misses due inconsistent fields.
Anything called from inside cmlcms_color_transform_get() can skip
asserting these.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This is a nice clean-up.
The parameter-based color profile is actually fully formed. The problem
of using it is dealt in the next patch.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Split the create function into two parts, allocation and finalization.
All ICC-specific code is moved into callers, so that the parameter-based
profile creation can start using alloc/register too.
cmlcms_color_profile 120 bytes, so it's unlikely we could ever deal with
that allocation failing - don't even try.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
While no-op does not support these, other color managers might. Change
the wording so that the user does not think that Weston does not support
these at all.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
drm_output_propose_state() is called during from drm_assign_planes(). At this
point, the output is enabled, but it may be disabled in the current state, that
is copied.
So explicitly enable the output by setting dpms to WESTON_DPMS_ON.
The same thing is already done in drm_output_repaint() but that's to late for
drm_output_propose_state(). Move that to the fallback path when planes are
disabled. It's no longer needed in general and changing the state between the
atomic test and commit is not a good idea anyways.
Without this, the atomic commit may fail, even though the corresponding test was
successful.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>