listen the signal and create new ivi screens.
this is required to handle hotplug events.
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
don't need to check the output in event, remove the typecast
Signed-off-by: Tran Ba Khang(MS/EMC31-XC) <Khang.TranBa@vn.bosch.com>
Some monitors expose a selector for the kind of content that will get
displayed, allowing them to optimise their settings for this particular
content type.
I got access to such a monitor, sadly even setting it to game mode
didn’t lower its atrocious latency, but drm_info[1] reports it to be set
correctly so hopefully it’ll work better with other monitors.
[1] https://github.com/ascent12/drm_info
Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
The controller sets the source and destination rectangles for any surface,
based on these parameters configure event is sent from the client application.
The controller commit the properties in the initial time, so
the view mask is capped to the current buffer dimensions of the
client. In runtime the client maybe sends some the bigger
configures of buffers. In this case view mask will be of smaller
dimension compared to the client buffer and it results in un-desired
clipping of client buffer.
To resolve this, use source rectangle as view mask. weston will take
care to clip the boundingbox of view to client buffer dimension if the
view mask is smaller.
Signed-off-by: Harsha M M <harsha.manjulamallikarjun@in.bosch.com>
Break this into internal and external parts so we don't have to pass
nonsense coordinates from fs_output_create()
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
We're just going to crash at weston_view_from_global_fixed() anyway if
this is untrue, but we have a similar assertion elsewhere already.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Whether these coordinates are "invalid" (set to an unlikely sentinel value)
or not is based purely on whether pointer->view is valid.
Check pointer->view before using these values every time, and stop
using an "invalid" value entirely.
The reason for this is that in the future we're reworking how 2D
coordinates are handled, and removing the dubious conecept of an invalid
coordinate simplifies things a little.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Sometimes callers don't want them, and sometimes (when view is NULL) the
coordinate is invalid.
Waste a tiny bit of time calculating them as needed in the callers
instead.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
sx and sy are meaningless (-1000000) when view is NULL. The case this
is meant to catch is when the surface coordinates change while the
global coordinate doesn't, (eg: max/unmax a window with a keyboard
shortcut) - in that case view will always be set.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
We're always passing pointer->x, y converted to surface coordinates, or
garbage if view is NULL. Let's just stop passing those coordinates
entirely and calculate them in the function.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Not all callers of weston_pointer_set_focus use weston_compositor_pick_view
to get their coordinate, so let's log something if the coordinate doesn't
make sense.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
The ivi-shell keeps track of its surfaces by adding them to the ivi_surface_list
to be able to remove them on shutdown. It also creates an ivi_layout_surface for
a desktop surface, but does not keep track of these surfaces.
During compositor shutdown, libweston prints the following message:
BUG: finalizing a layer with views still on it.
Fix it by adding the created ivi_layout_surface to the ivi_surface_list to
remove the surfaces from the layer during shutdown.
Furthermore, remove the ivi_layout_surface from the desktop surface and free it
when the desktop surface is destroyed.
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Removes the need to fabricate a fake coordinate pair when calling
weston_drag_set_focus to clear focus.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This lets us say what we really mean instead of passing a NULL output
and garbage co-ordinates.
This will help later when manufacturing garbage coordinates becomes much
harder to do.
The clear_pointer_focus() path continues to do nothing, and is just a FIXME
macro, as it has been for a very long time...
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
It's ok if the rectangle is too large: If the calculation fails, the
bounding rectangle is used anyways. However, a rectangle that is too small
will create incorrect results. So make sure to round all edges outwards.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
If a controller requests the layers under a surface that has no views attached,
Weston crashes since it tries to free the array that would be used to return the
found layers, but has not been allocated before.
Free the ppArray only if it was allocated in ivi_layout_get_layers_under_surface
before and no layers were found.
While at it, make it obvious that checking the length is an integer comparison
by comparing it to 0.
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Add a new weston-vnc man page, based on the weston-rdp man page.
Also add links in the main weston man page.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
This adds basic VNC protocol support using the Neat VNC library
(https://github.com/any1/neatvnc). Neat VNC depends on the AML main
loop library. The backend makes use of AML's integrated epoll backend
and connects AML via file descriptor with the Wayland event loop.
This implementation does not support authentication and hardcodes the
pixel format currently.
Co-authored-by: Philipp Zabel <p.zabel@pengutronix.de>
Co-authored-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Signed-off-by: Stefan Agner <stefan@agner.ch>
[r.czerwinski@pengutronix.de:
- use new (as of 0.5.0) Neat VNC buffer API, with a buffer pool]
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
[p.zabel@pengutronix.de:
- transform repaint damage to output coordinates
- transform pointer coordinates into global space
- check that outputs and heads are in fact ours, see aab722bb1785..060ef82d9360
- track damage across multiple frame buffers
- choose pixel format by drm_fourcc, see 8b6c3fe0ad
- enable ctrl and alt modifiers
- fix frame timing to achieve a constant repaint rate
- pass initial size explicitly, see f4559b0760
- use resize_output with pixman-renderer, see 55d08f9634e8..84b5d0eb4bee
- allow configuring the refresh rate]
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Since aml and neatvnc are not packaged yet, build them from source and
install them into the container image, to prepare for building the VNC
backend.
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
This reverts commit f6ff85b1b7.
This hack should not be needed anymore for Gitlab at freedesktop.org.
Mainly I worry that it might throw pycobertura off track in a
future patch.
See also: https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/1027
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
The activation of a view implies, among other things, a change in the
associated view layer which is initially unset. In order for this change
to be reflected in the corresponding surface's output mask, and hence
allow surface damage to trigger output repaints, we need to update the
view transform.
Fixes#674
Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Deprecate launcher-logind and disable it by default.
launcher-libseat supports logind, so this shouldn't cause any
regression.
Signed-off-by: Simon Ser <contact@emersion.fr>
References: https://gitlab.freedesktop.org/wayland/weston/-/issues/488
As a realistic scenario used by clients.
The motivation is to have an easy way to test correct fullscreen
behavior of compositors, as they have to compensate for the smaller
buffer size by adding black bars.
Signed-off-by: Robert Mader <robert.mader@collabora.com>
This adds a destroy listener on the SHM buffer provided by our client.
It will unregister the frame notify listener in case our buffer is
destroyed before the frame signal is emitted and thus avoid a memcpy
to invalid memory.
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
There is no need to call layer_add_surface() in mode_random_replace()
because the surface has already been added to the layer. Rather, calling
layer_add_surface() has the issue that the child surface is displayed
below the parent surface.
Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
Activate keyboard focus for surfaces created with xdg-shell protocol. If
the surface has child surface, the child surface is activated instead of
the parent surface.
Fixes: #630
Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
Not a functional change. The replacement of const
dump file to use suffix of appropriate sub tests
(sRGB->sRGB, sRGB->adobeRGB, etc).
Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
This patch adds the essential LittleCMS color pipeline optimizations and
analysis that is necessary for extracting matrices from pipelines
correctly. When we can extract a matrix and 1D curve sets, we can use
those with GL-renderer without needing an inherently heavy and imprecise
3D LUT. This should improve color transformation precision and
performance when a 3D LUT is not necessary.
The core of the optimization and analysis is a custom plugin for
LittleCMS. The optimization step comprises of repeatedly merging
sequential matrices and sequential curve sets into one and eliminating
identity elements which may allow for more merging. The analysis step
takes the optimized LittleCMS pipeline and attempts to fit all of its
elements into the weston_color_transform model. If it fits, we have an
optimized color transformation and do not need a 3D LUT. If it does not
fit, we use a 3D LUT as before.
Co-authored-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Restructing cmlcms_color_transform_create for readibility.
Also dropped zalloc() check in favor of xzalloc() as per the recent
Weston development policy.
Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Co-authored-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Right now this function only creates a CMM pipeline and produces a 3D
LUT from it, but in the future it can produce other types of
transformations. The function is renamed to xform_realize_chain()
because it creates a chain of profiles, forms a multi-profile-transform
from them, and fits that into weston_color_transform.
The further refactoring supports the future changes, and attempts to
make the code more readable.
There is provision for easily adding more profiles into the chain.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Relax the types of color transformations categories where this function
can be used. Yes, it is only useful for BLEND_TO_OUTPUT, but that is for
the user of this function to take care of. This function always works as
named regardless. The only condition is that output_inv_eotf_vcgt has
been populated, so fill_in_curves() may as well assert that.
While at it, make the code a little more concise. The 'len' assertion
belongs in fill_in_curves() because that is where the problem would
appear if the assertion failed.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Rename cmslcms_fill_in_pre_curve to cmlcms_fill_in_output_inv_eotf_vcgt
due to importance what the function is fetching:
profile->output_inv_eotf_vcgt.
Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Eotf is the transfer function whose inverse must be used for
converting from output light-linear space to sink electrical space.
Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Add matrix in color.h
Matrix is used as an optimized method for
color mapping vs 3DLUT.
Nothing sets color mapping to matrix yet.
Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Add post-curve support in color.h.
Pre-curve and post-curve describe color pipeline components
in a single GL shader invocation.The GL shader is supposed
to match struct weston_color_transform exactly.
We have the following color pipeline:
shader A -> blending -> shader B -> KMS. Both A and B shaders
using the same source file :fragment.glsl.
Each shader has pre and post curve.
The typical color pipeline with 3DLUT:
Shader A: pre-curve identity->3DLUT->blending->post-curve identity
Shader B: pre-curve->3DLUT identity->post-curve identity->KMS
The typical color pipeline with matrix (in next commits):
Shader A: pre-curve->matrix->blending->post-curve identity
Shader B: pre-curve->matrix identity->post-curve identity->KMS
The pre-curve plays role of EOTF (shader A) or INV_EOTF
(shader B) becouse we are stiching the shaders.
We assume that someone in the future may use both pre-curve
and post-curve, for example, when it is not possible to combine
these curves into 3DLUT and we will do mapping elements based on
their location in ICC profile.
Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
This is all a little confusing, so let's split up the variables and throw
around some comments that better explain what's going on.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Our shared buffer isn't actually in output co-ordinates, so
initializing with the output's width/height isn't correct.
While we're here, remove the misleading comment. In a future
patch I'll try to document this code more accurately.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
The region has already been intersected with the output's region before
it was passed to us.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Currently the frame event gets lost: The touch focus is removed in the 'up'
event. So the focus is gone when the frame event arrives so it is never sent to
the clients.
To avoid this, keep the touch focus until the frame is handled.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Replace all the remaining weston_output::current_mode and borders[] uses
with the fb_size and the compositing area. The result is the same, but
we stop depending on weston_output, and border texture sizes which may
not be the same as border sizes.
This is more correct, semantically.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Do not use border texture size when we have the area stored. This
decouples border texture size further.
We also have buffer_height available directly from fb_size, so do not
reverse-engineer it.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Pure refactoring to make the code easier to read.
Also drop the redundant all-clean check.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>