When using some features from LittleCMS in our CI, we are seeing some
crashes on the address sanitizer. Bumping the LittleCMS version fixes
that. So build and install a more recent version of LittleCMS on our CI.
We chose version 2.16 because it introduces the function
cmsGetToneCurveSegment(). We already make extensive use of that in our
codebase, so it is a good idea to have that on our CI as well.
Now color-curve-segments.c will start to get build on the CI, as
HAVE_CMS_GET_TONE_CURVE_SEGMENT will be true. So we also fix a minor
issue in which we were comparing int with uint in this file, what was
caught after experimenting bumping the LittleCMS version.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
In this patch we enable the color-management protocol support, as long
as the color-manager plugin in use supports it.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
In this MR we add support to the majority of the interfaces from the
color-management protocol.
That means that we are able to advertise output's images descriptions to
clients, preferred surface images descriptions, and so on. We also
support clients that wants to create ICC-based images descriptions and
set such descriptions for surfaces.
We still don't support the interface to allow clients to create
image descriptions from parameters, but that should be addressed
in the near future.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Similar to pixel-formats.c, but for color properties. This helper
aggregates the same color properties from different APIs into tables,
and introduce functions to use that.
The idea is that we only use that internally in our libweston struct's,
and pick the specific API value only when necessary.
Preparation for the CM&HDR protocol extension implementation.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This is preparation for the CM&HDR protocol implementation. It requires
us to give a unique id to each color-profile, so let's do that.
In this commit we introduce a generic id generator to libweston, and
its first user: the color-profile.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
The non-zero area check of clipper_quad_clip() is incorrect for quads
initialized with a polygon starting with a vertical edge. In order to
handle polygons starting with an horizontal edge and polygons starting
with a vertical one, it must check opposite vertices for equality.
The test previously described as "Box intersects entire smaller
aligned quad" is now described as "Clockwise winding and top/left
initial vertex". This test keeps the same values as before but all
combinations of winding order and first edge orientations are
also tested. The QUAD() macro isn't used anymore to do so.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Add quad clipping tests checking intersections at all edges and
corners of axis-aligned and unaligned quads with negative and positive
values.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
I want re-use this variable for printing the colorimetry mode list as
well in a future patch, so a generic name is less confusing.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Performance-wise this is moot, but since we are detecting if the raw
EDID data changed, might as well use it.
Now we have a path where the head's device_changed is almost guaranteed
since EDID changed, and that's useful for the next patch.
We can only do this, because the core initializes a head with values
that we would be setting anyway when EDID is missing, e.g. disconnected
head on compositor start-up.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Store the EDID data as-is, so that we can tell when the EDID blob has
changed. This is not too useful yet, because all the weston_head_set_*()
API raises the device_changed flag only if the information actually
changes. However, I want to expose the libdisplay-info di_info structure
through weston_head, and those cannot be (as) easily compared.
We need to know when the EDID blob changes, so we can call
weston_head_set_device_changed() appropriately when updating di_info.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
One of the three fixture setups of alpha-blending test requires
color-lcms.so. If color-lcms.so is not built, that fixture fails.
Make it skip as necessary, making the test suite pass with
color-management-lcms=false build option.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Just like we already do for planes with proper zpos. Otherwise we'll
often end up choosing the primary plane instead of an overlay one
in `drm_output_find_plane_for_view()`.
Signed-off-by: Robert Mader <robert.mader@collabora.com>
This seems to think formats needs to be NULL terminated, but it doesn't
and gl_renderer_get_egl_config asserts that all formats_count elements
are not NULL.
This happens when EGL_KHR_no_config_context is not supported.
Signed-off-by: Ray Smith <rsmith@brightsign.biz>
It adds the followig paragraph:
```
Starting from version 5, the invalid_format protocol error is sent if
all planes don't use the same modifier.
```
We already assumed this in some places and, most importantly, it's
required by the kernel. Thus alter `dmabuf_attributes.modifier` to make
it clear that different modifiers for multi-planar dmabufs were never
supported.
Signed-off-by: Robert Mader <robert.mader@collabora.com>
commit 79212ba9ad fixed a bug by
introducing a new one.
Before that point we could clip paint node damage to stale
visibility data. After that point we post damage for occluded
views, leading to large amounts of pointless drawing.
Add back the clip to visible region, in
weston_output_flush_damage_for_plane(), where we have up to date
visibility region information.
fixes 79212ba9ad
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
If client changes the buffer transform or size and re-commit the surface
before surface dirtys buffer (weston_surface_attach), the viewport
source validity check may fail. Because the width_from_buffer and
height_from_buffer cannot be updated based on new buffer transform.
Therefore, add the situation of size dirty (WESTON_SURFACE_DIRTY_SIZE) to
source validity check, width_from_buffer and height_from_buffer can be
updated in time when the buffer transform and scale change.
Signed-off-by: Chao Guo <chao.guo@nxp.com>
The `drm_output_deinit` should use the drm device passed by the
function, should not use the `b->drm` device.
Signed-off-by: Zhou Liang <174381115@qq.com>
If both the head and writeback are not found, then we should add
connectors to the drm device passed by the function, not the b->drm
device.
Signed-off-by: Zhou Liang <174381115@qq.com>
In a multi-GPU environment, different cards may contain connectors with the
same ID, and drm_head_find_by_connector just use the connector_id to find
the connector, it may find the wrong connector.
Fix this by find the connector based on the drm device and connector id.
Signed-off-by: Zhou Liang <174381115@qq.com>
If a view is non-opaque - such as an overlay over a video - we shouldn't
force it to be on the primary plane, as that's where the underlying
content should be placed, such as the video view.
dc0de9ee already mentioned: "This check should be changed in future to
only filter for opaque views, but that's for another time."
Adding "Fixes" at this is arguably a bug fix:
Fixes: dc0de9ee (backend-drm: Move overlay vs. primary plane check earlier)
Fixes: 2538aacc (backend-drm: Construct a zpos candidate list of planes)
Signed-off-by: Robert Mader <robert.mader@collabora.com>
Currently we flush damage for the "primary plane" every repaint, but this
is folly.
The drm backend may skip rendering entirely if using an all-planes
composition. This could leave the renderer plane in a messy state if a
surface on an overlay plane disappears.
Instead, let the backends flush the primary plane damage when they know
they need to render.
Fixes#864
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
And with it, bump libweston to next major version, 14. We seems like
we never used that argument so better just removed it.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
The idle_animation_destroy task should be removed when destroying
animations by the other callers such as handle_animation_view_destroy().
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Latest musl has removed the declaration from string.h [1] as it only
implements POSIX version alone and string.h in glibc implements GNU
version of basename. This now results in compile errors on musl.
This might be a warning with older compilers but it is error with
Clang-17+ as it treats -Wimplicit-function-declaration as error
Switch the use in backlight_init function to use POSIX version
[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This was added in 4def21c196.
0c1ab2ad76 removed all uses of NULL
weston_compositor, making the workaround unnecessary.
Drop the workaround, it's dead code.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Fix a crash when right-clicking on a weston-terminal, where
weston_desktop_seat_popup_grab_add_surface() is called with
seat->popup_grab.keyboard.keyboard == NULL in case there is
no keyboard connected.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Manually mark the surface as mapped exactly once - in the committed
handler where we have our content, and assert that it's correct when we
want to use the surface by instantiating a view.
The view handling can be made much more simple by simply using the new
view helpers.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Use the helpers to map a weston_surface and weston_view, rather than
manually manipulating the internals.
Signed-off-by: Daniel Stone <daniels@collabora.com>
When working on tablet tools, use the weston_surface and weston_view
helpers to manipulate their cursors, instead of manually setting various
members.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Extract quad bounding box initialization from the GL renderer and move
it to a dedicated initialization function in the clipper. It's used by
both the renderer and the clipping test client, which further reduces
code duplication.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Simplify clip_transformed() by replacing its context parameter with a
clipping box parameter. The context struct is still used internally to
pass data around.
Since clip_transformed() doesn't take a context anymore, the clipping
boxes are now declared per test and stored along with the other vertex
data. That prepares the ground to add new tests using different boxes.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Carry on the common vertex representation front by making boxes use
the clip_vertex struct.
A new function clip_quad_box32() is added to clearly separate the main
function taking a clip_vertex struct from the utility function taking
a pixman_box32 struct.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Pass a clip_vertex struct and a size to clip_transformed() instead of
a polygon8 struct to simplify the clipper API by sticking to a common
vertex representation.
Simmplify vertex-clip test since clip_transformed() now works on a
copy of the polygon (commit edd5d1cc09).
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
clip_simple() isn't used anymore outside of the clipper. This commit
removes it to simplify the clipper API. Its implementation is moved
straight to the axis-aligned quad clipping path of clip_transformed().
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
We can't use the surface damage to determine when to upload new cursor
images because when heads overlap the first repainted head will accumulate
that damage as plane damage.
We can't easily use plane damage either because the plane isn't really
assigned until after an atomic test, which requires the cursor fb to be
current.
Untangle this mess a little by always testing with the first cursor fb,
which is identical to the second in all ways, then replace with the correct
fb in repaint.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Now that overlapping outputs are a thing, we have a problem with vnc
cursors.
The surface->damage used to update the vnc cursor might actually be
flushed by a previous output's repaint cycle, leading to a missing cursor
update to the vnc client.
Instead we should use the damage accumulated on the cursor plane to choose
when to update the cursor. This damage is in output coordinates, so let's
be lazy and just use the presence of damage as an indicator that the
cursor needs an update.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
VISIBILITY_DIRTY is used to apply damage to the plane, but that doesn't
make sense for non-primary planes.
For example, we don't want moving the cursor to result in damage being
registered on the cursor plane.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
When an output repaints, it calculates visibility for its paint nodes,
accumulates damage for all paint nodes across all outputs, and then
paints.
This means that when it's accumulating damage for all paint nodes in
paint_node_add_damage(), it may be accumulating damage to nodes on other
outputs that haven't had their visible regions updates yet.
This leads to clipping with a stale visibility region, and losing damage.
Let's just drop the clip here for now - there are already other places
where paint nodes have to carry damage outside their visible regions.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This is a revert of 72e2da24
The VNC backend will place a single fullscreen surface on a virtual
scanout plane, and send the entire contents of this plane every repaint.
This saves a renderer pass, but moving the mouse over the fullscreen
client results in full screen damage for every mouse motion, similarly
client surfact damage is ignored and every repaint pushes the entire
window content down into Neat VNC.
Due to the way this is implemented, by pushing the scanout plane content
from assign_planes(), the primary plane could post damage and corrupt
the display.
Ideally we could fix this optimization to respect plane damage and do the
scanout plane push from the repaint callback, but since a release is
coming soon let's just strip it out for now.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>