Now that connectors can be configured as for lease, rename the function
to meta_kms_connector_is_non_desktop() to make clear that it returns
the hardware configuration rather than the user configuration.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4112>
Add a flag to MetaMonitor indicating if the monitor is available for
lease and store/update it from the monitor configuration.
Also, add unit tests validating that the configuration is applied and
that invalid configurations fail.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4112>
Move components without dependencies to the top and try to move
components with dependencies close to the component they depend on.
While this is an improvement, we really should start tracking and
documenting the actual dependencies between our components so that the
order here becomes comprehensible.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4018>
In acbb14f34bc8fee14e77db3c100e5d116d8e3d60, we have dropped the
is_client_decorated except it was still being used by gnome-shell
to adjust the window coordinates in case it is using server side
decoration.
Instead of re-adding the same function, expose a new function that
takes care of getting the whole client area while taking into account
SSD for X11 clients.
Helps https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7984
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4087>
The constructor already copies the pipeline which means we can add a
snippet safely without affecting the parent pipeline, without creating
another copy.
Fixes: 6b07141f1a ("clutter/paint-nodes: Make paint nodes handle color transformations")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4037>
Instead of just adding the cogl header boilerplate, we'll redirect the
main function with #define and #undef to cogl_main(). The real main
calls the hooks-generated cogl_hooks() which chains up to the users
main() which is now called cogl_main().
<boilerplate>
#define main cogl_main
<user shader>
<hook functions>
void
cogl_hooks () {
cogl_main ();
<hook code>
}
#undef main
void main () { cogl_hooks(); }
This allows the user shader to continue using shaders which seem like
they define the main function and output to the framebuffer but also
gives the CoglPipeline a chance to add hooks.
This in particular makes our ClutterColorState transform hooks work on
user programs which are used by ClutterShaderEffects.
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7804
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7805
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3662
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4037>
To avoid mostly going through struct fields in macros as we might soon
move those first to a WindowConfiguration & maybe even make the window
struct private with time.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4111>
As it ends up using the global default context. So just call that
directly to easily spot the remaining usages of get_default_context.
Note that the helper will probably be removed later this cycle once the
remaining usages in meta & libst have been replaced with passing around
the context
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4077>
As they are not used anywhere, in the next commit
we will just remove the whole thing and use glib helpers directly as
there is nothing specific about ClutterThread anymore
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4077>
cogl_framebuffer_finish can result in a CPU-side stall because it waits for
the primary GPU to flush and execute all commands that were queued before
that. By using a GPU-side EGLSync we can let the primary GPU inform us when
it is done with the queued commands instead. We then create another EGLSync
on the secondary GPU using the same fd so the primary GPU effectively
signals the secondary GPU when it is done rendering, causing the latter
to wait for the former before copying part of the frames it needs for
monitors attached to it directly.
This solves the corruption that cogl_framebuffer_finish also solved, but
without needing a CPU-side stall.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4015>
This adds meta_egl_create_sync and meta_egl_destroy_sync to be able to
create and dispose EGLSync objects, respectively, as well as
meta_egl_wait_sync to be able to wait for an EGLSync on the GPU.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4015>
The hook would be optional if anything called `meta_plugin_get_info()`,
except that since commit 4fdbb466e1c ten years ago, nothing has done so.
It seems a bit pointless to export information that is completely
unused, so stop doing that.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4104>
The hook would be optional if anything called `meta_plugin_get_info()`,
except that since commit 4fdbb466e1c ten years ago, nothing has done so.
It seems a bit pointless to export information that is completely
unused, so stop doing that.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4104>
While in double buffering we only care about one previous presentation,
triple buffering will sometimes need to refer to the presentation from
two dispatches prior. So it might help to separate those frame stats
more clearly. This way each frame's dispatch and presentation times are
stored more cohesively such as to not be overwritten during overlapping
frame lifetimes.
Having two types of frame reference (dispatch and presentation) moving
at difference speeds meant that they could not be stored in a ring. Not
all dispatches become presentations and so storing them in a ring would
necessitate very complex conflict avoidance. Instead, a simple reference
counting model was used.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3961>
So that we maintain a perfectly balanced number of callbacks:
dispatch == notify_ready + notify_presented
Otherwise you can't put any useful logic inside notify_ready and be sure
you're handling all the empty frames.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3961>
e994fbf02 moved warping the pointer to before the destruction of the
resource to prevent dereferencing the constraint after destruction.
This however meant that the constraint was still active when the motion
event caused by the warp is handled, which would constrain the pointer
back again to its original position.
This moves the warping of the pointer back to after the destruction of
the resource and instead just retrieves the seat earlier while the
constraint is still valid.
Fixes: e994fbf02 ("wayland/pointer-constraints: Warp pointer before destroying resource")
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3696
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4098>
The sync_fd represents only the primary GPU work.
Fixes: c2621eca151d ("onscreen/native: Set latest cogl sync_fd on KMS update")
v2:
* Use g_steal_fd. (Georges Basile Stavracas Neto, Sebastian Wick)
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4060>