- 20 Jun, 2019 21 commits
-
-
Jonas Ådahl authored
Move reading state into a struct for MetaCrtcKms to use instead of querying KMS itself. The state is fetched in the impl context, but consists of only simple data types, so is made accessible publicly. As of this, MetaCrtcKms construction does not involve any manual KMS interaction outside of the MetaKms abstraction. GNOME/mutter#548 GNOME/mutter!525
-
Jonas Ådahl authored
GNOME/mutter#548 GNOME/mutter!525
-
Jonas Ådahl authored
Represents drmModeConnector; both connected and disconnected. Currently only provides non-changing meta data. MetaOutputKms is changed to use MetaKmsConnector to get basic metadata, but variable metadata, those changing depending on what is connected (e.g. physical dimension, EDID, etc), are still manually retrieved by MetaOutputKms. GNOME/mutter#548 GNOME/mutter!525
-
Jonas Ådahl authored
It's a uint32_t, not a long. GNOME/mutter#548 GNOME/mutter!525
-
Jonas Ådahl authored
It was only used within one function, where it was always created, but still was kept around indefinitely for no reason. Lets get rid of it from the MetaOutputKms struct. GNOME/mutter#548 GNOME/mutter!525
-
Jonas Ådahl authored
A plane is one of three possible: primary, overlay and cursor. Each plane can have various properties, such as possible rotations, formats etc. Each plane can also be used with a set of CRTCs. A primary plane is the "backdrop" of a CRTC, i.e. the primary output for the composited frame that covers the whole CRTC. In general, mutter composites to a stage view frame onto a framebuffer that is then put on the primary plane. An overlay plane is a rectangular area that can be displayed on top of the primary plane. Eventually it will be used to place non-fullscreen surfaces, potentially avoiding stage redraws. A cursor plane is a plane placed on top of all the other planes, usually used to put the mouse cursor sprite. Initially, we only fetch the rotation properties, and we so far blacklist all rotations except ones that ends up with the same dimensions as with no rotations. This is because non-180° rotations doesn't work yet due to incorrect buffer modifiers. To make it possible to use non-180° rotations, changes necessary include among other things finding compatible modifiers using atomic modesetting. Until then, simply blacklist the ones we know doesn't work. GNOME/mutter#548 GNOME/mutter!525
-
Jonas Ådahl authored
Add MetaKmsCrtc to represent a CRTC on the associated device. Change MetaCrtcKms to use the ones discovered by the KMS abstraction. It still reads the resources handed over by MetaGpuKms, but eventually it will use only MetaKmsCrtc. MetaKmsCrtc is a type of object that is usable both from an impl task and from outside. All the API exposed via the non-private header is expected to be accessible from outside of the meta-kms namespace. GNOME/mutter#548 GNOME/mutter!525
-
Jonas Ådahl authored
The intention with KMS abstraction is to hide away accessing the drm functions behind an API that allows us to have different kind of KMS implementations, including legacy non-atomic and atomic. The intention is also that the code interacting with the drm device should be able to be run in a different thread than the main thread. This means that we need to make sure that all drm*() API usage must only occur from within tasks that eventually can be run in the dedicated thread. The idea here is that MetaKms provides a outward facing API other places of mutter can use (e.g. MetaGpuKms and friends), while MetaKmsImpl is an internal implementation that only gets interacted with via "tasks" posted via the MetaKms object. These tasks will in the future potentially be run on the dedicated KMS thread. Initially, we don't create any new threads. Likewise, MetaKmsDevice is a outward facing representation of a KMS device, while MetaKmsImplDevice is the corresponding implementation, which only runs from within the MetaKmsImpl tasks. This commit only moves opening and closing the device to this new API, while leaking the fd outside of the impl enclosure, effectively making the isolation for drm*() calls pointless. This, however, is necessary to allow gradual porting of drm interaction, and eventually the file descriptor in MetaGpuKms will be removed. For now, it's harmless, since everything still run in the main thread. #548 !525
-
Jonas Ådahl authored
It was unused. GNOME/mutter#548 GNOME/mutter!525
-
Jonas Ådahl authored
Lets work towards making MetaMonitorManager about managing monitors, and not about managing GPUs. This changes other units to keep a pointer to the backend instead of a monitor manager, in case their ownership changed, or their main usage of the monitor manager was to look up GPUs. #548 !525
-
Jonas Ådahl authored
Instead of dealing with udev details here, use the newly added 'hotplug' event emitted from MetaUdev. GNOME/mutter#548 GNOME/mutter!525
-
Jonas Ådahl authored
To be used my the monitor manager to handle hotplugs. GNOME/mutter#548 GNOME/mutter!525
-
Jonas Ådahl authored
Will be used to move out some udev related logic when adding GPUs. GNOME/mutter#548 GNOME/mutter!525
-
Jonas Ådahl authored
This means we can report the errors properly, instead of logging a warning and calling exit(1). GNOME/mutter#548 GNOME/mutter!525
-
Jonas Ådahl authored
To be used to signal devices added, hotplugs and other udev events. Currently the only event emitted is when a device is added. GNOME/mutter#548 GNOME/mutter!525
-
Jonas Ådahl authored
The object struct definition itself is private, so the object instance private serves no purpose. Thus, move the fields into the object struct and remove the instance private struct. GNOME/mutter#548 GNOME/mutter!525
-
Olivier Fourdan authored
Notify with a system sound when the modifiers lock state is changed. Closes: GNOME/mutter#637
-
Olivier Fourdan authored
The “togglekeys” setting is to emit a sounds whenever the state of one of the modifiers keys (CAPS lock, NUM Lock, SCROLL lock) is changed, it has nothing to do with the rest of the accessibility settings. Therefore, there is no need to reset the various timers used by accessibility whenever the “togglekeys” setting is changed. GNOME/mutter!614
-
Olivier Fourdan authored
The include <sys/random.h> was added to glibc-2.25, previously was <linux/random.h>. Adjust meson build and code to accomodate both. Fixes: a8984a81 "xwayland: Generate a Xauth file and pass this to Xwayland when starting it" !633
-
Hans de Goede authored
Fix the following compiler warning: ../src/backends/native/meta-renderer-native.c: In function ‘meta_renderer_native_create_view’: /usr/include/glib-2.0/glib/gmacros.h:523:17: warning: ‘formats’ may be used uninitialized in this function [-Wmaybe-uninitialized] 523 | { if (_ptr) (cleanup) ((ParentName *) _ptr); } \ | ^ ../src/backends/native/meta-renderer-native.c:773:22: note: ‘formats’ was declared here 773 | g_autoptr (GArray) formats; | ^~~~~~~ GNOME/mutter!632
-
Hans de Goede authored
Before this commit, sudo x11-app, e.g. sudo gvim /etc/some-file, fails when running a Wayland session. Where as doing this under a "GNOME on Xorg" session works fine. For a user switching from the Xorg session to the Wayland session, this is regression, which we want to avoid. This commit fixes this by creating and passing an xauth file to Xwayland when mutter starts it. Just like gdm or startx pass a xauth file to Xorg when they start Xorg. Fixes #643 #643
-
- 19 Jun, 2019 17 commits
-
-
Niels De Graef authored
This was introduced when the Cogl maintainers tried to move away from GLib. Since we always require it, we can just use `g_return_val_if_fail()` immediately. !629
-
Niels De Graef authored
This was introduced when the Cogl maintainers tried to move away from GLib. Since we always require it, we can just use `g_return_if_fail()` immediately. !629
-
Niels De Graef authored
We can safely remove it since it's used nowhere in the code base. If you would still like to use someting similar, there's `G_STATIC_ASSERT`. GNOME/mutter!629
-
Niels De Graef authored
Since commit 46942c24, we don't need the wrapper macro as we always require its implementation to be available on the build system. GNOME/mutter!629
-
Niels De Graef authored
`cogl_util_memmem` was used as a wrapper in case `memmem` wasn't defined, but since commit 46942c24 these are required. In case of `memmem`, we didn't explicitly require this in the meson build files, so add that as well. GNOME/mutter!629
-
Georges Basile Stavracas Neto authored
This uses the API introduced by the previous commit. By watching specific monitors directly, and not whole stage views, we avoid showing artifacts on multi-monitor setups. Fixes GNOME/mutter#424 GNOME/mutter!623
-
Georges Basile Stavracas Neto authored
MetaStageWatch, watch modes and the watch function are part of the new stage view watching API. It's design does not rely on signals on purpose; the number of signals that would be emitted would be too high, and would impact performance. MetaStageWatch is an opaque structure outside of MetaStage. This will be used by the screencast code to monitor a single view, which has a one-to-one relatioship to logical monitors. GNOME/mutter!623
-
Georges Basile Stavracas Neto authored
ClutterStage:after-paint now does not guarantee a valid implicit framebuffer pushed to the stack. Instead, use the new 'paint-view' signal, that is emitted at a point in the drawing routine where a framebuffer is pushed. In addition to that, stop using the implicit framebuffer API and port the actor-shader-effect test to read from the view's framebuffer directly. GNOME/mutter!623
-
Georges Basile Stavracas Neto authored
Now that ClutterStageView is embraced as part of the public set of Clutter classes, is it possible to give consumers of this API more information and control over the drawing routines of ClutterStage. Introduce ClutterStage:paint-view, a signal that is emitted for painting a specific view. It's defined as a RUN_LAST signal to give anyone connecting to it the ability to run before the view is actually painted, or after (using the G_CONNECT_AFTER flag, or g_signal_connect_after). This signal has a corresponding class handler, which allows Mutter to have much finer control over the painting routines. In fact, this will allow us to implement a "paint phase watcher" mechanism in the following patches. GNOME/mutter!623
-
Georges Basile Stavracas Neto authored
ClutterStage:after-paint is supposed to be emitted after all painting is done, but before the frame is finished. However, as it is right now, it is being emitted after each view is painted -- on multi-monitor setups, after-frame is being emitted multiple times. Send after-paint only once, after all views are painted and before finishing the frame. GNOME/mutter!623
-
Georges Basile Stavracas Neto authored
This function is exported as a Mutter-specific function, but now that ClutterStageView is part of the public API, ClutterStage can own this function. GNOME/mutter!623
-
Georges Basile Stavracas Neto authored
As a compositor toolkit, it makes sense to allow consumers of Clutter interact with the stage views themselves. As such, ClutterStageView should be a public class. As such, it is now included in clutter.h and should not be included directly. !623
-
Georges Basile Stavracas Neto authored
The GIR parser cannot figure out the ownership model of ClutterStageView.get_framebuffer() and .get_offscreen() without them, and throws us a couple of warnings. GNOME/mutter!623
-
Georges Basile Stavracas Neto authored
Next commits will expose ClutterStageView as a public class, so move the functions private to Clutter to a private header. GNOME/mutter!623
-
Jonas Ådahl authored
GNOME/mutter!628
-
Hans de Goede authored
This fixes the following compiler warning: In file included from /usr/include/glib-2.0/glib.h:114, from ../src/tests/test-utils.h:23, from ../src/tests/test-utils.c:22: ../src/tests/test-utils.c: In function ‘test_init’: /usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: warning: ‘basename’ may be used uninitialized in this function [-Wmaybe-uninitialized] 28 | g_free (*pp); | ^~~~~~~~~~~~ ../src/tests/test-utils.c:73:24: note: ‘basename’ was declared here 73 | g_autofree char *basename; | ^~~~~~~~ GNOME/mutter!627
-
Daniel Mustieles García authored
-
- 18 Jun, 2019 2 commits
-
-
Jonas Ådahl authored
Make sure to destroy the EGL surface after releasing held buffers, otherwise we'll get the following valgrind warnings: ==24016== Invalid read of size 8 ==24016== at 0x1739943F: release_buffer (platform_drm.c:73) ==24016== by 0x49AC355: meta_drm_buffer_gbm_finalize (meta-drm-buffer-gbm.c:213) ==24016== by 0x4B75B61: g_object_unref (gobject.c:3346) ==24016== by 0x49B4B41: free_current_bo (meta-renderer-native.c:991) ==24016== by 0x49B816F: meta_renderer_native_release_onscreen (meta-renderer-native.c:2971) ==24016== by 0x5209441: _cogl_onscreen_free (cogl-onscreen.c:167) ==24016== by 0x5208D81: _cogl_object_onscreen_indirect_free (cogl-onscreen.c:51) ==24016== by 0x51C8066: _cogl_object_default_unref (cogl-object.c:103) ==24016== by 0x5207989: _cogl_framebuffer_unref (cogl-framebuffer.c:1814) ==24016== by 0x51C80B1: cogl_object_unref (cogl-object.c:115) ==24016== by 0x53673C7: clutter_stage_view_dispose (clutter-stage-view.c:304) ==24016== by 0x4B75AF2: g_object_unref (gobject.c:3309) ==24016== Address 0x18e742a8 is 536 bytes inside a block of size 784 free'd ==24016== at 0x4839A0C: free (vg_replace_malloc.c:540) ==24016== by 0x17399764: dri2_drm_destroy_surface (platform_drm.c:231) ==24016== by 0x1738550A: eglDestroySurface (eglapi.c:1145) ==24016== by 0x5440286: eglDestroySurface (in /home/jonas/Dev/gnome/install/lib/libEGL.so.1.1.0) ==24016== by 0x49613A5: meta_egl_destroy_surface (meta-egl.c:432) ==24016== by 0x49B80F9: meta_renderer_native_release_onscreen (meta-renderer-native.c:2954) ==24016== by 0x5209441: _cogl_onscreen_free (cogl-onscreen.c:167) ==24016== by 0x5208D81: _cogl_object_onscreen_indirect_free (cogl-onscreen.c:51) ==24016== by 0x51C8066: _cogl_object_default_unref (cogl-object.c:103) ==24016== by 0x5207989: _cogl_framebuffer_unref (cogl-framebuffer.c:1814) ==24016== by 0x51C80B1: cogl_object_unref (cogl-object.c:115) ==24016== by 0x53673C7: clutter_stage_view_dispose (clutter-stage-view.c:304) ==24016== Block was alloc'd at ==24016== at 0x483AB1A: calloc (vg_replace_malloc.c:762) ==24016== by 0x173997AE: dri2_drm_create_window_surface (platform_drm.c:145) ==24016== by 0x17388906: _eglCreateWindowSurfaceCommon (eglapi.c:929) ==24016== by 0x5440197: eglCreateWindowSurface (in /home/jonas/Dev/gnome/install/lib/libEGL.so.1.1.0) ==24016== by 0x49612FF: meta_egl_create_window_surface (meta-egl.c:396) ==24016== by 0x49B752E: meta_renderer_native_create_surface_gbm (meta-renderer-native.c:2538) ==24016== by 0x49B7E6C: meta_onscreen_native_allocate (meta-renderer-native.c:2870) ==24016== by 0x49B8BCF: meta_renderer_native_create_view (meta-renderer-native.c:3387) ==24016== by 0x48D274B: meta_renderer_create_view (meta-renderer.c:78) ==24016== by 0x48D27DE: meta_renderer_rebuild_views (meta-renderer.c:111) ==24016== by 0x49BB4FB: meta_stage_native_rebuild_views (meta-stage-native.c:142) ==24016== by 0x49A733C: meta_backend_native_update_screen_size (meta-backend-native.c:517) GNOME/mutter!622
-
Jonas Ådahl authored
When making a new surface/context pair current, mesa may want to flush the old context. Make sure we don't try to flush any freed memory by unmaking a surface/context pair current before freeing it. Not doing this results in the following valgrind warnings: ==15986== Invalid read of size 8 ==15986== at 0x69A6D80: dri_flush_front_buffer (gbm_dri.c:92) ==15986== by 0x1750D458: intel_flush_front (brw_context.c:251) ==15986== by 0x1750D4BB: intel_glFlush (brw_context.c:296) ==15986== by 0x1739D8DD: dri2_make_current (egl_dri2.c:1461) ==15986== by 0x17393A3A: eglMakeCurrent (eglapi.c:869) ==15986== by 0x54381FB: InternalMakeCurrentVendor (in /home/jonas/Dev/gnome/install/lib/libEGL.so.1.1.0) ==15986== by 0x5438515: eglMakeCurrent (in /home/jonas/Dev/gnome/install/lib/libEGL.so.1.1.0) ==15986== by 0x522A782: _cogl_winsys_egl_make_current (cogl-winsys-egl.c:303) ==15986== by 0x49B64C8: meta_renderer_native_create_view (meta-renderer-native.c:3076) ==15986== by 0x48D26E7: meta_renderer_create_view (meta-renderer.c:78) ==15986== by 0x48D277A: meta_renderer_rebuild_views (meta-renderer.c:111) ==15986== by 0x49BF46E: meta_stage_native_rebuild_views (meta-stage-native.c:142) ==15986== Address 0x1b076600 is 0 bytes inside a block of size 48 free'd ==15986== at 0x4839A0C: free (vg_replace_malloc.c:540) ==15986== by 0x49B59F3: meta_renderer_native_release_onscreen (meta-renderer-native.c:2651) ==15986== by 0x5211441: _cogl_onscreen_free (cogl-onscreen.c:167) ==15986== by 0x5210D81: _cogl_object_onscreen_indirect_free (cogl-onscreen.c:51) ==15986== by 0x51D0066: _cogl_object_default_unref (cogl-object.c:103) ==15986== by 0x520F989: _cogl_framebuffer_unref (cogl-framebuffer.c:1814) ==15986== by 0x51D00B1: cogl_object_unref (cogl-object.c:115) ==15986== by 0x536F3C7: clutter_stage_view_dispose (clutter-stage-view.c:304) ==15986== by 0x4B7DAF2: g_object_unref (gobject.c:3309) ==15986== by 0x4A9596C: g_list_foreach (glist.c:1013) ==15986== by 0x4A9599A: g_list_free_full (glist.c:223) ==15986== by 0x48D2737: meta_renderer_rebuild_views (meta-renderer.c:100) ==15986== Block was alloc'd at ==15986== at 0x483AB1A: calloc (vg_replace_malloc.c:762) ==15986== by 0x69A76B2: gbm_dri_surface_create (gbm_dri.c:1252) ==15986== by 0x69A6BFE: gbm_surface_create (gbm.c:600) ==15986== by 0x49B4E29: meta_renderer_native_create_surface_gbm (meta-renderer-native.c:2221) ==15986== by 0x49B57DB: meta_onscreen_native_allocate (meta-renderer-native.c:2569) ==15986== by 0x49B6423: meta_renderer_native_create_view (meta-renderer-native.c:3062) ==15986== by 0x48D26E7: meta_renderer_create_view (meta-renderer.c:78) ==15986== by 0x48D277A: meta_renderer_rebuild_views (meta-renderer.c:111) ==15986== by 0x49BF46E: meta_stage_native_rebuild_views (meta-stage-native.c:142) ==15986== by 0x49A75B5: meta_backend_native_update_screen_size (meta-backend-native.c:520) ==15986== by 0x48B01BB: meta_backend_sync_screen_size (meta-backend.c:224) ==15986== by 0x48B09B7: meta_backend_real_post_init (meta-backend.c:501) GNOME/mutter!622
-