To accommodate some future CI bump to Trixie (doxygen/breathe issue)
move out the anonymous enum out of weston_output object.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
With the addition of the weston_output_set_ready() call, the shell fade
animation is now started during the very first repaint. The first repaint
doesn't have an accurate frame_time for the previous repaint, as none has
occurred yet.
Since we set the time base for an animation based on the output's frame
time the second time the animation is run, we end up setting the shell fade
start time to 0, and the first real repaint advances the timer to the real
time, generating a warning and truncating the animation.
Instead of tracking the number of animation frames, let's just continue to
reset the time base until we finally get a non-zero time.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This de-couples the compositor view build list from the paint node
ordered list to allow a more finer grain over what lists we need to
rebuild upon repaints.
As a consequence to that this avoids a trip over from the compositor
when paint nodes are destroyed and no longer re-created upon rebuilding
the view list.
Fixes: #1070
Fixes: abfe874a ("core: Don't rebuild view list on surface-local changes")
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
We've added a curtain to the shells so at startup we have something to
render, but this causes a flicker if someone is trying to have a seamless
transition from boot to weston.
Add a ready flag that allows the shell to indicate repaints are safe, so
we can remove the curtains and have no wasted frames at startup.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This already existed for surface, so it is trivial to add.
This will let the upcoming plane state reuse code notice a format change.
This is handy because a client might respond to dmabuf feedback by changing
formats, with the expectation that doing so would land content on a plane.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Future development will need to evaluate pipelines with curves and
matrices. Such pipelines naturally operate on vec3, as matrices cannot
be operated one channel at a time. Make weston_color_curve_sample()
operate on arrays of vec3.
Its currently only caller, weston_color_curve_to_3x1D_LUT(), is modified
to employ a temporary array for the API impedance mismatch. This
workaround will be removed later as weston_color_curve_to_3x1D_LUT()
itself will be converted to operate on vec3 arrays.
weston_v3f_array_to_planar() documentation was generated with AI.
weston_color_curve_sample() is restructured a little bit, attempting to
make it simpler to read.
color-operations.h gets the #includes needed to make it self-standing.
Assisted-by: Github Copilot (Claude Sonnet 3.5)
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
For some cases such as remote control, need to disable the interaction
between input device and the weston. It will not affect the use of input
device by other modules or applications.
Signed-off-by: Elliot Chen <elliot.chen@nxp.com>
Allow dictating which color format we'd like to use. This introduces the
front-end side and the core parts, leaving the EDID parsing and DRM
connector property for later patches.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
When we're going through assign_planes and repaint, give the backend an
opportunity to see what's changed during this repaint.
Signed-off-by: Daniel Stone <daniels@collabora.com>
The protocol does not carry target primaries by enumeration, but in
weston.ini I want to be able to use a name rather than raw values.
Adding this API makes that possible.
main.c cannot look up the enumeration itself, because color-properties.h
is private. As it should be.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This will be useful for parsing config file entries that have several
items on key, like x,y coordinates or a list of flags. Code reading
custom color profiles from weston.ini will use this.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
It is nice to see the numbers of a parametric color profile when created
from CTA or EDID or just to cross-check with weston.ini.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Output color effects are applied to the whole output scenegraph. It
depends on color-management being disabled, as the color effects are
applied in sRGB content.
For now we added only a few accessibility options: color inversion,
deuteranopia, protanopia and tritanopia CVD correction.
Note that surfaces presented on outputs that contains a color effect
can't be used for direct scanout (i.e. bypass composition and offloading
to KMS overlay planes). The color effect is applied in our GL-renderer.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This is not what any sensible person would expect it to be. It was updated
by a walk of all the paint nodes on the output most recently repainted,
so if a view spanned outputs the visible region would only make sense
within the most recently painted output's region.
It's basically a scratchpad for a mid-repaint operation. Instead of making
it a view member, put it in the paint node, which are always per-output.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Use a buffer_ref here to allow us to remove the subsurface
cached_buffer_ref and keep it in the surface state struct instead.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
We don't use it anymore, we just casually commit and expect that
applying clean state is harmless.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Keep track of subsurface effective sync status when it changes instead of
figuring it out when we need to know it.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
In this patch we allow offloading the post-blend color transformation
to KMS.
As KMS currently only supports to offload the transformation in a LUT,
this may result in precision issues. So this introduces the config
option "offload-blend-to-output", which is disabled by default.
This option requires "color-management" to be enabled, otherwise it is
ignored.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
The plugins cms-static and cms-colord have been deprecated and removed
from our code. They were the only thing holding set_gamma() from being
removed. So remove set_gamma() from the code.
Users can have the same results tweaking the output color profile that
they use.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Our window decor uses cairo-xcb. cairo-xcb stores xcb_connection_t
internally and uses them as kind of a hash key for internal bookkeeping.
This needs to be torn down with a cairo_device_finish, when the last
cairo surface is destroyed, and we are not properly handling that.
Because of this weston bug, if the Xwayland server dies, is restarted,
and the weston X window manager gets the same xcb_connection_t pointer
value for a new connection that it had for a previous connection,
cairo-xcb will use stale state and crash.
Weston is used in some places (like Mesa CI) where Xwayland crashes are
more common than one might usually expect, and weston needs to be robust
against these failures. It's ok to have no window frames in xwl in these
cases, because nobody is interacting with the windows.
The '--no-xwm-decorations' command line option will now remove
cairo-xcb from use entirely, so this crash can no longer happen.
We should still fix the bugs in our cairo usage, but I think long term
it's still ok to have a way to disable this and reduce complexity.
Ref #1042
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This implements the basic color transformation from parametric to
parametric image description. The colorimetric rendering intents are
implemented. The perceptual and saturation rendering intents are
equivalent to media-relative + BPC rendering intent, subject to be
implemented better later.
Things missing:
- handling target color volumes
- perceptual dynamic range mapping
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This function is required for producing color transformations from
parametric image descriptions.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This is a trivial change to allow passing a user-defined color to
specify the color for the placeholder.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This introduces a new list that is being checked up when advertising
or when the client attempts to bind a debug scope.
This would allow for a way in which the frontend can determine which
debug scopes the weston-debug protocol can advertise or the client
using the protocol can bind to.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Add a function to move a view in front of a layer entry, so we can easily
add this functionality to lua-shell in a future commit.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
It has no more callers, and hasn't done what its name implies for a very
long time.
Remove it.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
There is no valid reason for anyone to call this.
True surface damage is already handled when surfaces are committed. View
damage is already handled through any per-view manipulation which would
generate damage. There is thus no reason for anyone to ever call this.
Signed-off-by: Daniel Stone <daniels@collabora.com>
When we change the subsurface order, the surface itself has not received
any damage: what's been damaged is the views. Place the damage where it
should be, as the act of moving the view within the view list is where
the damage originates from.
Signed-off-by: Daniel Stone <daniels@collabora.com>
A Vulkan renderer for weston, based on the GL renderer.
The goal is to impose the least requirements as possible on Vulkan
implementations, as to allow even Vulkan 1.0 (or early development)
drivers to run a Wayland compositor. Any additional features or
extensions are made optional if possible.
Currently supports drm, wayland, x11 and headless backends.
As of this implementation, this is still considered an experimental
renderer.
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Forcing the fallback paths for YUV formats. This will allow us
to test these paths on CI now that llvmpipe supports all tested
formats natively.
Signed-off-by: Robert Mader <robert.mader@collabora.com>
Add a new header for colorimetry stuff. Adding more things in
libweston.h doesn't feel good, they drown in the sea of everything.
Pure refactoring, no changes.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This converts weston_matrix and weston_vector to use linalg-types
internally. All direct accesses to members had to be converted
everywhere, mostly in the simplest form possible which leaves some
trivially reducable code around.
The intention is that we can now gradually migrate away from
weston_matrix in the future.
Look like one trailing space got accidentally annihilated in
compositor.c.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
3x3 matrices, a straight-forward copy of libalg-4.h.
Useful for color computations and 2-D geometry.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
linalg-types.h can be used from e.g. libweston.h so that structures can
embed linalg types but without forcing every user of libweston.h to
compile all the inline functions.
weston_mat4f implements most of weston_matrix, and some more. This is
just for starters. Implementing weston_mat3fwill be essentially a copy
of all this.
The matrix inversion is a copy from weston_matrix with a little bit of
clean-up.
The goal is to create a more intuitive libear algebra API, that is easy
to extend to 3x3 matrices and 3-vectors, eventually superseding all
existing matrix code: weston_matrix, calls to LittleCMS matrix
routines (plugin API), and ad hoc matrix code in tests/.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This is required to avoid a namespace collision for LED_COMPOSE key
code and was introduced with c112760368, "input: Add support for
LED_COMPOSE and LED_KANA".
If not already done this requires a libweston major version bump.
Fixes: #997
Fixes: c112760368, "input: Add support for LED_COMPOSE and LED_KANA
USB HID LEDs"
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Rather than having this timer always fire up & running, do it when we actually
enable debug, with the `--debug` cmd line argument.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Rather than using wl_surface::commit to count the frame rate, use the
painted frames for each paint node, and implictly the surface.
This happens in the output repaint paint node list parsing, and includes
also a perfetto counter to display it.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This is a continuation of work from
https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/24
This patch adds a surface callback frame rate counter to the scene-graph
debug scope.
The timer interval is set by default to 1 second. This use a timer to
periodically compute the current frame callback commits in that interval
as the surface frame rate per timer interval. Note that is solely based on
wl_surface::commit call.
Together with this, this patch also adds perfetto counter that stores
the same computed frame rate. This means the counter will be updated on
the next interval timer when the timer is armed/fired such that that
perfetto drawings will show up in a window period of time (interval).
Helpful to identify what frame rates clients achieve to debug
performance issues as to provide an objective common group. Using the
debug-scope aggregates all surfaces at the same place. This is not based
on the GPU whatsoever so it can also work on SHM type of buffers.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Signed-off-by: Changwoo Cho <changwoo.cho@lge.com>
This way we can use the same ID when for perfetto counters to allow
to identify clients much easier.
Also, renamed "surface" with "unlabelled surface" when get_label function
is not set.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Shells need to find their own internal structures for weston_outputs.
Let's make that process trivial instead of a list walk.
Add a getter and setter for this private data and use it from the kiosk
shell.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>