Commit Graph

23645 Commits

Author SHA1 Message Date
Niels De Graef
ca7c5c1223 meta/plugin: Use G_DECLARE_DERIVABLE_TYPE
It cuts out some of the GObject boilerplate, and gives us g_autoptr()
support for free.

Since this changes the ABI, we also need to bump the libmutter API
version.
2018-11-23 14:28:37 +00:00
Carlos Garnacho
e11ee44236 core: Refactor/simplify display startup sequence handling
Makes the caller function easier to read.
2018-11-23 12:27:13 +00:00
Carlos Garnacho
6b7bd91610 x11: Complete X11 startup sequence on SN_MONITOR_EVENT_COMPLETED 2018-11-23 12:27:13 +00:00
Carlos Garnacho
92349a4668 wayland: Complete the startup sequence as given from gtk-shell 2018-11-23 12:27:13 +00:00
Carlos Garnacho
7635d0631b core: Drop MetaDisplay startup sequence API
We now have MetaStartupNotification/Sequence in place
2018-11-23 12:27:13 +00:00
Carlos Garnacho
ec6a536d36 core: Use MetaStartupSequence internally
Replace code in MetaDisplay so it uses MetaStartupSequence
2018-11-23 12:27:13 +00:00
Carlos Garnacho
4d92979b43 core: Make MetaStartupSequence/Notification public
This will be preferred over SnStartupNotification, as exposed
through MetaDisplay.
2018-11-23 12:27:13 +00:00
Carlos Garnacho
4a69a0d7f7 core: Shuffle startup notification object creation
Hook properly to MetaDisplay, instead of having it be a singleton.
2018-11-23 12:27:13 +00:00
Carlos Garnacho
8a10196382 x11: Set all MetaStartupSequence properties for libsn sequences 2018-11-23 12:27:13 +00:00
Carlos Garnacho
91ce24d4b4 core: Add extra properties to MetaStartupSequence
Those that we use from SnStartupSequence over the place...
2018-11-23 12:27:13 +00:00
Carlos Garnacho
26fbd56a95 x11: Refactor the X11 startup notification bits into src/x11
Only one little bit left in MetaDisplay, because SnStartupSequence
is exposed in API there. These bits will be removed in future
commits.
2018-11-23 12:27:13 +00:00
Carlos Garnacho
576cd08088 core: Rename MetaStartupNotificationSequence to MetaStartupSequence
The name was excruciatingly long and not that much more descriptive.
2018-11-23 12:27:13 +00:00
Daniel van Vugt
e8c27603dd renderer-native: Advertise _FEATURE_SWAP_THROTTLE
Because it is implemented and always on. By advertising this fact
the master clock is able to sync to the native refresh rate instead
of always using the fallback of 60.00Hz.

https://bugzilla.gnome.org/show_bug.cgi?id=781296
2018-11-23 11:01:30 +00:00
Daniel van Vugt
e9e4b2b72e renderer-native: Add hardware presentation timing
Add support for getting hardware presentation times from KMS (Wayland
sessions). Also implement cogl_get_clock_time which is required to compare
and judge the age of presentation timestamps.

For single monitor systems this is straightforward. For multi-monitor
systems though we have to choose a display to sync to. The compositor
already partially solves this for us in the case of only one display
updating because it will only use the subset of monitors that are
changing. In the case of multiple monitors consuming the same frame
concurrently however, we choose the fastest one (in use at the time).
Note however that we also need !73 to land in order to fully realize
multiple monitors running at full speed.
2018-11-23 11:01:30 +00:00
Niels De Graef
6834bedb95 cogl: remove COGL_GNUC_NULL_TERMINATED
This is already defined for us in GLib, so prefer that instead.
2018-11-23 08:55:43 +01:00
Niels De Graef
bf8a3b1c1c cogl: Remove unused macro COGL_GNUC_DEPRECATED
This is also already defined in GLib as G_GNUC_DEPRECATED.

(Note that it is also something different than COGL_DEPRECATED)
2018-11-23 08:55:43 +01:00
Niels De Graef
3a4a858ce3 cogl: use G_BEGIN_DECLS instead of COGL_BEGIN_DECLS
This macro was introduced so as to be able to be built without GLib.
However, this feature was long ago removed, and in Mutter we depend on
it anyway, so let's get rid of it in favor of more consistency.
2018-11-23 08:55:43 +01:00
Jonas Ådahl
0a178a01b3 xwayland: Invert running-as-gdm check
It was accidentally inverted previously. Lets change it back.
2018-11-22 17:37:32 +00:00
Jonas Ådahl
332360be7c gitlab-ci.yml: Increase test timeout multiplier further
Twice the time was not enough, so pass -t 10 instead.
2018-11-22 18:20:58 +01:00
Jonas Ådahl
718ddc9c96 gitlab-ci.yml: Stop creating meson-logs artifact
The logs were useless, as the complete test suite log was printed to
stdout.
2018-11-22 17:48:00 +01:00
Jonas Ådahl
f795725aaf gitlab-ci.yml: Allow for tests taking longer time
Test runners might be slow, so use the test time multiplier 2 to avoid
unnecessary pipeline failures.
2018-11-22 17:48:00 +01:00
Jonas Ådahl
70741a051b gitlab-ci.yml: Wrap tests with catchsegv
To be able to see why tests failed, if they crashed due to a SIGSEGV,
wrap the execution with catchsegv.
2018-11-22 17:48:00 +01:00
Emilio Pozuelo Monfort
ad7d6e4a37 backends/native: React to GPU hotplug
If a GPU is added at runtime, we should connect to it and manage
its outputs.
2018-11-21 14:33:00 +01:00
Emilio Pozuelo Monfort
a6178990cd monitor-manager/kms: Use non-pci secondary cards
We may have secondary non-PCI devices, and we should drive their
outputs.
2018-11-21 14:26:02 +01:00
Niels De Graef
081842bac6 cogl/object: add cogl_clear_object utility function
This is based on `g_clear_object`, so it will be a bit more consistent
to write (and prevents the headaches from accidentally forgetting a NULL
check).
2018-11-20 15:25:24 +01:00
Pekka Paalanen
63a6ead7d9 wayland-dma-buf: doc the odd format mapping
This format mapping looks wrong at first hand, so explain why it is like
it is.

See also https://gitlab.gnome.org/GNOME/mutter/issues/323
2018-11-19 22:53:13 +00:00
Pekka Paalanen
1c044a8fa0 renderer/native: remove meta_renderer_native_gles3_read_pixels
It is unused.
2018-11-19 22:53:13 +00:00
Pekka Paalanen
d4bea60e1a renderer/native: use cogl for CPU copy path
Use cogl_framebuffer_read_pixels_into_bitmap () instead of
glReadPixels () for the CPU copy path in multi-GPU support.

The cogl function employs several tricks to make the read-pixels as fast
as possible and does the y-flip as necessary. This should make the copy
more performant over all kinds of hardware.

This is expected to be used on virtual outputs (e.g. DisplayLink USB
docks and monitors) foremost, where the dumb buffer memory is just
regular system memory. If the dumb buffer memory is somehow slow, like
residing in discrete VRAM or having an unexpected caching mode, it may
be possible for the cogl function perform worse because it might do the
y-flip in-place in the dumb buffer. Hopefully that does not happen in
any practical scenario.

Calling meta_renderer_native_gles3_read_pixels () here was conceptually
wrong to begin with because it was done with the Cogl GL context of the
primary GPU, not on the GL ES 3 context of a secondary GPU. However,
due eglBindAPI being a no-op in Mesa and the glReadPixels () arguments
being compatible, it worked.

This patch adds a pixel format conversion table between DRM and Cogl
formats. It contains more formats than absolutely necessary and the
texture components field which is currently unused for completeness. See
Mutter issue #323. Making the table more complete documents better how
the pixel formats actually map so that posterity should be less likely
to be confused. This table could be shared with
shm_buffer_get_cogl_pixel_format () as well, but not with
meta_wayland_dma_buf_buffer_attach ().

On HP ProBook 4520s laptop (Mesa DRI Intel(R) Ironlake Mobile, Mesa
18.0.5), without this patch copy_shared_framebuffer_cpu () for a
DisplayLink output takes 5 seconds with a 1080p frame.  Obviously that
makes Mutter and gnome-shell completely unusable.  With this patch, that
function takes 13-18 ms which makes it usable if not fluent.

On Intel i7-4790 (Mesa DRI Intel(R) Haswell Desktop) machine, this patch
makes no significant difference (the copy takes 4-5 ms).
2018-11-19 22:53:13 +00:00
Pekka Paalanen
8c4743ee2a renderer/native: store dumb FB format
The format will be needed in a following commit in the CPU copy path
which stops hardcoding another format and starts using the format the
dumb FB was created with.
2018-11-19 22:53:13 +00:00
Pekka Paalanen
cbbd6d71bf renderer/native: use DRM formats for dumb buffers
Change the callers of init_dumb_fb () to use DRM format codes. DRM and
GBM format codes are identical, but since this is about dumb buffers,
DRM formats fit better.

The header /usr/include/gbm.h installed by Mesa says:

 * The FourCC format codes are taken from the drm_fourcc.h definition, and
 * re-namespaced. New GBM formats must not be added, unless they are
 * identical ports from drm_fourcc.

That refers to the GBM_FORMAT_* codes.
2018-11-19 22:53:13 +00:00
Olivier Fourdan
4aa1e221e4 remote-desktop: Do not leak the virtual touchscreen
Virtual keyboard and pointer are freed on session close, but the
virtual touchscreen isn't.

Avoid a leak by freeing the virtual touchscreen along with the rest of
virtual devices.
2018-11-19 15:41:43 +00:00
Olivier Fourdan
ac6039bd2a clutter: Keep a device reference with events
If a device (virtual or real) is removed while there are remaining
events queued for that device, the event loop may try to access the
event freed memory.

To avoid the issue, add a reference to the device when the event is
created or copied, and remove the reference once the device is freed.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/393
2018-11-19 15:41:43 +00:00
Olivier Fourdan
97230a2b64 clutter/evdev: Use clutter_event_set_device()
Use the relevant clutter device API `clutter_event_set_device()` instead
of setting the device directly in the event field.
2018-11-19 15:41:43 +00:00
Alan Coopersmith
791bec3cf7 display: Make lack of required X extensions a fatal error
https://gitlab.gnome.org/GNOME/mutter/issues/272  


Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-11-19 15:17:51 +00:00
Emilio Pozuelo Monfort
fb8dc91893 output/kms: Make winsys_id unique
We were using the connector_id for the winsys_id, but different
devices could have connectors with the same id. Since we use
winsys_id to uniquely identify outputs, use both the connector
id and the device id to avoid having outputs with the same id.
2018-11-19 14:58:48 +00:00
Emilio Pozuelo Monfort
5e005316ef output: Turn winsys_id into a uint64_t
We need a 64 bit field to combine the device id and connector
id into the output id (winsys_id).
2018-11-19 14:58:48 +00:00
Emilio Pozuelo Monfort
4bc6a64d47 backends/native: Use the connector_id rather than winsys_id
winsys_id needs to be a unique output identifier so it will have
to stop being the connector id.
2018-11-19 14:58:48 +00:00
Emilio Pozuelo Monfort
91d4f30ebd gpu/kms: Add identifier
We need a device unique id in order to uniquely identify an output,
which will use a (device, connector) pair.
2018-11-19 14:58:48 +00:00
Emilio Pozuelo Monfort
c585b214b8 gpu: Drop unused declaration 2018-11-19 14:58:48 +00:00
Georges Basile Stavracas Neto
0304433b20
clutter-rectangle: Remove cogl_rectangle()
A pretty regular removal.
2018-11-18 20:28:39 -02:00
Georges Basile Stavracas Neto
fcd1ff9c56
clutter-texture: Remove cogl_rectangle_with_texture_coords()
Mostly as expected, this port is also trivial. A small cleanup
accompanies this patch, making gen_texcoords_and_draw_cogl_rectangle()
receive the framebuffer that it should draw into.
2018-11-18 20:28:39 -02:00
Georges Basile Stavracas Neto
a227e4078b
clutter-wayland-surface: Remove cogl_rectangle()
This is a very straightforward port too: simply replacing
cogl_rectangle() by cogl_framebuffer_draw_rectangle().
2018-11-18 20:28:39 -02:00
Georges Basile Stavracas Neto
cabcad1856
clutter-text: Replace cogl_rectangle()
Because ClutterText has a somewhat convoluted drawing routine,
replacing cogl_rectangle() here isn't as straightfoward as the
effects were.

A new CoglPipeline is now part of the ClutterText struct, and
is used to set the color of the  background or the selection.

Another change is paint_selection() now receives a framebuffer
to draw into. The check for NULL framebuffer does not make
sense here, since there is always a draw framebuffer set
when in the drawing function. Because of that, the check is
now gone.
2018-11-18 20:28:39 -02:00
Georges Basile Stavracas Neto
4c3d9fccc1
clutter-*-effect: Remove cogl_rectangle()
All those effects have the same basic pattern of setting a
color of a pipeline, then drawing a rect with cogl_rectangle().

Thus, replacing those was as easy as retrieving the draw
framebuffer and calling cogl_framebuffer_draw_rectangle() on it.
2018-11-18 20:28:38 -02:00
Georges Basile Stavracas Neto
203725bfd3
clutter-actor: Remove cogl_rectangle from pick()
The default implementation of ClutterActor.pick() uses
cogl_rectangle() to draw the rectangle with the color
for picking.

Replace that by cogl_framebuffer_draw_rectangle(). A
static color pipeline had to be created in order to
hold the pick color.
2018-11-18 20:28:38 -02:00
Georges Basile Stavracas Neto
c1b6184e0a
clutter-stage: Pass framebuffer to read pixels from
Instead of using cogl_read_pixels(), which is deprecated and
uses the implicit framebuffer, pass the current CoglFramebuffer
and use cogl_framebuffer_read_pixels().
2018-11-18 20:28:38 -02:00
Georges Basile Stavracas Neto
dd82fbebf6
clutter-stage: Replace cogl_clear by cogl_framebuffer_clear
Another case of a simple and direct API translation. Instead of
using the deprecated cogl_clear() function, replace it by the
non-deprecated cogl_framebuffer_clear().
2018-11-18 20:28:37 -02:00
Georges Basile Stavracas Neto
605f35dd25
shadow-factory: Receive CoglFramebuffer
Following up last commit, this commit adds a CoglFramebuffer
argument to meta_shadow_paint(), and stops using the draw
framebuffer internally.

The only consumer of this API, MetaWindowActor, still passes
the draw framebuffer though.
2018-11-18 20:28:37 -02:00
Georges Basile Stavracas Neto
aecf588d8d
shadow-factory: Replace implicit API by explicit counterparts
MetaShadow.paint() uses Cogl implicit APIs (cogl_rectangle* ones, in
this case) to paint shadows with the shadow pipeline.

Replace those calls by cogl_framebuffer_draw_textured_rectangle()
calls, that achieve the exact same result but with the non-deprecated
API.
2018-11-18 20:28:34 -02:00
Ting-Wei Lan
740c2298c6 build: Don't hardcode the path of python3
Python is not guaranteed to be installed in /usr/bin. This is especially
true for *BSD systems which don't consider Python as an integral part of
their systems.
2018-11-18 14:25:35 +08:00