summaryrefslogtreecommitdiff
path: root/src/backends/meta-monitor-manager-private.h
Commit message (Collapse)AuthorAgeFilesLines
* monitor-manager: Restore old config in idle callback when unconfirmedJonas Ådahl2023-03-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We might get told to restore the old monitor configuration by the monitor configuration prompt, in case the user pressed "revert" or equivalent. This might be in response to a button press, and those happen during frame clock dispatch. If we would restore an old configuration during dispatch, it means we would reconfigure the monitors including their stage views while dispatching, which means we'd destroy the frame clock while it's dispatching. Doing that causes problems, as the frame clock isn't expecting to be destroyed mid-function. Specifically, We'd enter clutter_frame_clock_dispatch (clutter-frame-clock.c:811) frame_clock_source_dispatch (clutter-frame-clock.c:839) g_main_dispatch (gmain.c:3454) g_main_context_dispatch (gmain.c:4172) g_main_context_iterate.constprop.0 (gmain.c:4248) g_main_loop_run (gmain.c:4448) meta_context_run_main_loop (meta-context.c:482) main (main.c:663) which would first call _clutter_process_event (clutter-main.c:920) _clutter_stage_process_queued_events (clutter-stage.c:757) handle_frame_clock_before_frame (clutter-stage-view.c:1150) which would emit e.g. a button event all the way to a button press handler, which would e.g. deny the new configuration: restore_previous_config (meta-monitor-manager.c:1931) confirm_configuration (meta-monitor-manager.c:2866) meta_monitor_manager_confirm_configuration (meta-monitor-manager.c:2880) meta_plugin_complete_display_change (meta-plugin.c:172) That would then regenerate the monitor configuration and stage view layout, which would destroy the old stage view and frame clock. meta_stage_native_rebuild_views (meta-stage-native.c:68) meta_backend_native_update_screen_size (meta-backend-native.c:457) meta_backend_sync_screen_size (meta-backend.c:266) meta_backend_monitors_changed (meta-backend.c:337) meta_monitor_manager_notify_monitors_changed (meta-monitor-manager.c:3595) meta_monitor_manager_rebuild (meta-monitor-manager.c:3683) meta_monitor_manager_native_apply_monitors_config (meta-monitor-manager-native.c:343) meta_monitor_manager_apply_monitors_config (meta-monitor-manager.c:704) After returning back to the original clutter_frame_clock_dispatch() frame, various state in the frame clock will be gone and we'd crash. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2901>
* monitor-manager: Use guint for handle IDsJonas Ådahl2023-03-181-3/+2
| | | | | | To follow convention. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2901>
* crtc: Get/set gamma via helper structJonas Ådahl2022-09-011-0/+1
| | | | | | | | | | | Instead of passing 4 arguments (red, green and blue arrays as well as a size), always pass them together in a new struct MetaGammaLut. Makes things slightly less tedious. The KMS layer still has its own variant, but lets leave it as that for now, to keep the KMS layer "below" the cross backend CRTC layer. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2165>
* monitor-manager: Move gamma LUT manipulation API to MetaCrtcJonas Ådahl2022-09-011-34/+0
| | | | | | | | | | | | | | | In practice, for KMS backend CRTC's, we cache the gamma in the monitor manager instance, so that anyone asking gets the pending or up to date value, instead of the potentially not up to date value if one queries after gamma was scheduled to be updated, and before it was actually updated. While this is true, lets still move the API to the MetaCrtc type; the backend specific implementation can still look up cached values from the MetaMonitorManager, but for users, it becomes less cumbersome to not have to go via the monitor manager. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2165>
* monitor-manager: Move PNP lookup to MetaBackendJonas Ådahl2022-09-011-7/+0
| | | | | | | | | It's not really about monitors, even though it is used for monitors. Lets shrink MetaMonitorManager a bit moving it to the backend. While at it, stop leaking it too. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2141>
* monitor: Add API to set GAMMA LUTJonas Ådahl2022-09-011-0/+7
| | | | | | It's effectively a for-each for every active CRTC of the monitor. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2141>
* monitor: Add API to get GAMMA LUT sizeJonas Ådahl2022-09-011-0/+7
| | | | | | Will be used to generate look up tables. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2141>
* monitor-manager-private: Add max_bpc to MetaOutputAssignmentDaniel van Vugt2022-08-191-0/+2
| | | | Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2412>
* tests: Add test for remembering configured monitor scalesJonas Ådahl2022-08-151-0/+1
| | | | | | | Tests that switching using the same API used by the key binding remembers the monitor scale from previous configurations. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2479>
* monitor-manager: Remove struct member indentationDaniel van Vugt2022-08-101-9/+9
| | | | | | To silence CI warnings from check-code-style. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2511>
* monitor-manager: Don't include generated header in headerJonas Ådahl2022-08-081-1/+0
| | | | | | This tends to result in build system race conditions. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2555>
* kms: Notify about privacy screen changes via predictionsJonas Ådahl2022-07-251-3/+0
| | | | | | | | | | | | | | | | | | | | | | When we change the privacy screen, we added a result listener to the KMS update object to notify the upper layer about the privacy screen state change. This was slightly awkward as one might have changed the state multiple times for a single update, thus it was necessary to remove any old result listeners to an update before adding a new one. Doing this will not be possible when updates are fully async and managed by the KMS impl device. To handle this, instead make the post-commit prediction notify about changes that happens in response to a successfully committed update. We already predicted the new privacy screen state, so the necessary change was to plumb the actual change into a callback which emits the signal if there actually was a privacy screen change. This will then be communicated via the same signal listener that already listens to the 'resources-changed' signal. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2340>
* monitor-manager: Ensure monitors settings after backend has been updatedMarco Trevisan (Treviño)2022-05-111-0/+1
| | | | | | | | | | | | | | | | | The monitors settings such as the privacy screen property is propagated to the monitors via kms updates, however during initialization and on monitors changes, we end up clearing the pending KMS updates because such settings are added to the queue before the backend has fully initialized the monitors, and this may lead to discarding all the pending updates, including the one we've just planned. To avoid this, move settings applications after we've both initialized the backend and notified it about changes. Also avoid to try set the settings during actual initialization, but delay that after post-init. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2372>
* wayland/xdg-shell: Add toplevel bounds supportJonas Ådahl2022-03-041-0/+1
| | | | | | | | | | This implements the new 'bounds' event that is part of the xdg_toplevel interface in the xdg-shell protocol. It aims to let clients create "good" default window sizes that depends on e.g. the resolution of the monitor the window will be mapped on, whether there are panels taking up space, and things like that. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2167>
* meson: Allow to build without gnome-desktopBilal Elmoussaoui2022-03-031-0/+5
| | | | | | | | | | gnome-desktop is used to retrieve the monitor vendor name which in some use cases is not needed as it brings a bunch of gnome-desktop unwanted dependencies. The change makes mutter fallback to an "Undefined" vendor name if it is built without gnome-desktop Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2317>
* monitor-manager: Notify privacy screen changes on hotkey pressMarco Trevisan (Treviño)2022-01-251-0/+13
| | | | | | | | | | | | | | When privacy screen is changed and this happens on explicit user request (that is not a setting change) we should notify about this via an OSD. To perform this, we keep track of the reason that lead to a privacy screen change, and when we record it we try to notify the user about. When the hardware has not an explicit hotkey signal but we record a change we must still fallback to this case. Fixes: #2105 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1952>
* monitor-manager: Apply privacy monitor settings on changesMarco Trevisan (Treviño)2022-01-251-0/+3
| | | | | | | | | When both a setting change and a monitor change happens we need to ensure that the monitor settings are applied. This is currently only related to privacy settings, but will in future also handle other monitor parameters such as brightness. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1952>
* monitor-manager: Use connect_object to connect to settings signalsMarco Trevisan (Treviño)2021-09-201-2/+0
| | | | | | | We were disconnecting from the wrong object, so instead of adjusting it we can simply use "new" utility functions instead. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1964>
* monitor-unit-tests: Add tests with dynamic orientation changesMarco Trevisan (Treviño)2021-09-041-0/+1
| | | | | | | Verify monitors disposition when we have rotation changes coming from MetaOrientationManager, using our mock dbus implementation. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1233>
* monitor-manager: Pass the Logical mode when computing the monitor scaleMarco Trevisan (Treviño)2021-07-221-6/+8
| | | | | | | | In order to compute proper default scaling value we need to know if the fractional scaling is enabled or not and thus if we're using a logical mode or not. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/336>
* monitor-manager: Don't include generated code in header fileJonas Ådahl2021-04-141-3/+3
| | | | | | | | | | | | | | | | Meson doesn't seem to handle depending on generated headers, at least when those headers are pulled in indirectly via another header file. Luckily, we don't actually need to include the generated D-Bus boiler plate in meta-monitor-manager-private.h, since the MetaMonitorManager type no longer is based on the D-Bus service skeleton. So, by moving the inclusion of the generated D-Bus header file into meta-monitor-manager.c, we should hopefully get rid of the sporadic build issues. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1682 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1819>
* tests: Add virtual monitor testsJonas Ådahl2021-03-121-0/+1
| | | | | | | | | | | | The testing currently done is: * Creating a virtual monitor succeeds and gets the right configuration * Painting a few times results in the expected output * Changing the content of the stage also changes the painted content accordingly * Destroying the virtual monitor works as expected Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1698>
* tests: Add reference test frameworkJonas Ådahl2021-03-121-0/+1
| | | | | | | | | | | | | | | | This adds a test framework that makes it possible to compare the result of painting a view against a reference image. Test reference as PNG images are stored in src/tests/ref-tests/. Reference images needs to be created for testing to be able to succeed. Adding a test reference image is done using the `MUTTER_REF_TEST_UPDATE` environment variable. See meta-ref-test.c for details. The image comparison code is largely based on the reference image test framework in weston; see meta-ref-test.c for details. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1698>
* Introduce virtual monitorsJonas Ådahl2021-03-121-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Virtual monitors are monitors that isn't backed by any monitor like hardware. It would typically be backed by e.g. a remote desktop service, or a network display. It is currently only supported by the native backend, and whether the X11 backend will ever see virtual monitors is an open question. This rest of this commit message describes how it works under the native backend. Each virutal monitor consists of virtualized mode setting components: * A virtual CRTC mode (MetaCrtcModeVirtual) * A virtual CRTC (MetaCrtcVirtual) * A virtual connector (MetaOutputVirtual) In difference to the corresponding mode setting objects that represents KMS objects, the virtual ones isn't directly tied to a MetaGpu, other than the CoglFramebuffer being part of the GPU context of the primary GPU, which is the case for all monitors no matter what GPU they are connected to. Part of the reason for this is that a MetaGpu in practice represents a mode setting device, and its CRTCs and outputs, are all backed by real mode setting objects, while a virtual monitor is only backed by a framebuffer that is tied to the primary GPU. Maybe this will be reevaluated in the future, but since a virtual monitor is not tied to any GPU currently, so is the case for the virtual mode setting objects. The native rendering backend, including the cursor renderer, is adapted to handle the situation where a CRTC does not have a GPU associated with it; this in practice means that it e.g. will not try to upload HW cursor buffers when the cursor is only on a virtual monitor. The same applies to the native renderer, which is made to avoid creating MetaOnscreenNative for views that are backed by virtual CRTCs, as well as to avoid trying to mode set on such views. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1698>
* monitor-manager: Clean up hot-plug paths slightlyJonas Ådahl2021-01-281-2/+3
| | | | | | | | | | Make the API used more shared and better named. meta_monitor_manager_on_hotplug() was renamed meta_monitor_manager_reconfigure(), and meta_monitor_manager_reload() was introduced to combine reading the current state and reconfiguring. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1689>
* monitor-manager: Cleanup class structJonas Ådahl2021-01-281-47/+47
| | | | | | | It was wierdly formatted, missed argument variable names, didn't use stdint types. Clean this up a bit. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1689>
* x11: Support the CTM (color transform matrix) RandR propertyAaron Plattner2021-01-111-0/+16
| | | | | | | | | | | | When supported, this property allows the window system to apply a 3x3 color correction matrix in order to transform colors from the window system's native color space to the measured color space of a display device. Query for this property and set the 'supports-color-transform' property in the GetResource reply. Add support for the SetOutputCTM DBus method and plumb that through to the server's CTM property. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1048>
* backends: Add simple object to delegate logical monitor layout queriesCarlos Garnacho2020-11-271-0/+3
| | | | | | | | This object can be passed to random places, and be trusted to remain unchanged till replaced. Makes it an ideal replacement for MetaMonitorManager across threads. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
* output: Move edid parse function to the right fileUday Kiran Pichika2020-10-211-6/+1
| | | | | | | Move the edid parsing function from MetaMonitorManager to MetaOutput to read the monitor manufacturer,serial,vendor,etc. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1516/
* backends: Hook ClutterSeat::touch-mode to PanelOrientationManagedCarlos Garnacho2020-09-051-0/+2
| | | | | | | | We only want the panel autorotation to happen if the laptop has an accelerometer, and is in tablet mode. Regular laptop mode should lock the orientation, and let it be configured manually. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1311
* backends: Centralize panel autorotation in a DisplayConfig propertyCarlos Garnacho2020-09-051-0/+2
| | | | | | | | | | | | Instead of having everyone check net.hadess.SensorProxy themselves, have this all controlled by the MetaOrientationManager, and proxied everywhere else via a readonly property in org.gnome.Mutter.DisplayConfig. We want to attach more complex policies here, and it seems better to centralize the handling of the autorotation feature rather than implementing policy changes all over the place. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1311
* monitor-manager: Rename *Info structs to *AssignmentJonas Ådahl2020-06-101-11/+11
| | | | | | | | | | | | | MetaCrtcInfo and MetaOutputInfo did not represent information about MetaCrtc and MetaOutput, but the result of the monitor configuration assignment algorithm, thus rename it to MetaCrtcAssignment and MetaOutputAssignment. The purpose for this is to be able to introduce a struct that actually carries information about the CRTCs and outputs, as retrieved from the backend implementations. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1287
* output: Move configureable state to instance privateJonas Ådahl2020-06-101-0/+18
| | | | | | | | | | That is is_presentation, is_primary, is_underscanning and backlight. The first three are set during CRTC assignment as they are only valid when active. The other is set separately, as it is untied to monitor configuration. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1287
* monitor-manager: Remove 'mirror' capabilityJonas Ådahl2020-03-181-3/+2
| | | | | | | | With per-CRTC views, there is nothing stopping NVIDA EGLStream based rendering to not support monitor mirroring, so lets remove that restriction. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1098
* crtc: Move configured state to separate structJonas Ådahl2020-02-251-2/+2
| | | | | | | | | | | | | To make it more reliable to distinguish between values that are read from the backend implementation (which is likely to be irrelevant for anything but the backend implementation), split out those values (e.g. layout). This changes the meaning of what was MetaCrtc::rect, to a MetaCrtcConfig::layout which is the layout the CRTC has in the global coordinate space. https://gitlab.gnome.org/GNOME/mutter/merge_requests/1042
* monitor-manager: Add `get_vendor_name` APIOlivier Fourdan2019-06-281-0/+3
| | | | | | | The monitor manager keeps the list of PnP Ids, add a new API to get the vendor name from a given PnP ID. https://gitlab.gnome.org/GNOME/mutter/issues/645
* backend: Move GPU ownership from the monitor manager to the backendJonas Ådahl2019-06-201-8/+1
| | | | | | | | | | 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. https://gitlab.gnome.org/GNOME/mutter/issues/548 https://gitlab.gnome.org/GNOME/mutter/merge_requests/525
* monitor-manager: Clean up DPMS state trackingJonas Ådahl2019-04-021-2/+7
| | | | | | | | | | | | | | DPMS is configured from a bit all over the place: via D-Bus, via X11 and when reading the current KMS state. Each of these places did it slightly differently, directly poking at the field in MetaMonitorManager. To make things a bit more managable, move the field into a new MetaMonitorManagerPrivate, and add helpers to get and set the current value. Prior to this, there were for example situations where the DPMS setting was changed, but without signal listeners being notified about it. https://gitlab.gnome.org/GNOME/mutter/merge_requests/506
* monitor-manager: Don't use wacky physical dimensions in display nameDariusz Gadomski2019-02-041-0/+2
|
* meta: Hide libmutter symbols by default and selectively export themMarco Trevisan (Treviño)2019-01-231-1/+18
| | | | | | | | | | | | | Make meson link libmutter using -fvisibility=hidden, and introduce META_EXPORT and META_EXPORT_TEST defines to mark a symbols as visible. The TEST version is meant to be used to flag symbols that are only used internally by mutter tests, but that should not be considered public API. This allows us to be more precise in selecting what is exported and what is not, without the need of a version-script file that would be more complicated to maintain. https://gitlab.gnome.org/GNOME/mutter/merge_requests/395
* MonitorManager: Use composition instead of inheriting from dbus skeletonMarco Trevisan (Treviño)2019-01-231-1/+3
| | | | | | | | | | | | | | | MonitorManager was inheriting from MetaDBusDisplayConfigSkeleton, this was causing introspection to see this like a GDBus skeleton object exposing to clients methods that were not required. Also, this required us to export meta_dbus_* symbols to the library, while these should be actually private. So, make MetaMonitorManager to be just a simple GObject holding a skeleton instance, and connect to its signals reusing most of the code with just few minor changes. https://gitlab.gnome.org/GNOME/mutter/merge_requests/395
* Add some gtk-doc comments.Niels De Graef2019-01-061-12/+42
|
* monitor-transform: Move helper functions into their own fileRobert Mader2019-01-051-15/+1
| | | | | | | The existing ones are statically inlined, so there is no .c file right now. https://gitlab.gnome.org/GNOME/mutter/merge_requests/366
* monitor-manager: remove get_edid_file() vfuncNiels De Graef2018-11-261-2/+0
| | | | | | | | It wasn't implemented by any subclass, it's not provided by DRM either. And even if a subclass were to have only a file available, it could read it into a GBytes as well and just use `read_edid()`. Found this while working on !269.
* Clean up include macros messJonas Ådahl2018-11-061-38/+5
| | | | | | The order and way include macros were structured was chaotic, with no real common thread between files. Try to tidy up the mess with some common scheme, to make things look less messy.
* backend: Move lid-is-closed handling to MetaBackendBastien Nocera2018-07-181-7/+0
| | | | | | | | Rather than handle UpClient in both MetaBackend (to reset the idletime when the lid is opened), and in MetaMonitorManager and MetaMonitorConfigManager (to turn the screen under the lid on/off depending on its status), move the ability to get the lid status from UPower or mock it in one place, in MetaBackend.
* monitor-manager: Cache the last known value of "lid-is-closed"Bastien Nocera2018-07-181-0/+1
| | | | | | | | | Restarting UPower will make every property of UpClient emit a "notify" signal (as a GDBusProxy would). Avoid mutter reconfiguring the displays when upower restarts by caching the last known value of "lid-is-closed" and only reconfiguring the displays if it actually changed. This fixes a black out of the screen when UPower restarts.
* Stop using MetaScreen where it is unnecessaryArmin Krezović2018-07-061-1/+0
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=759538
* Move monitor management API to MetaDisplayArmin Krezović2018-07-061-3/+3
| | | | | | | This includes changing various users to use MetaDisplay directly, who used MetaScreen only for this before. https://bugzilla.gnome.org/show_bug.cgi?id=759538
* monitor-manager: Take panel orientation into account when getting input matrixHans de Goede2017-12-251-0/+1
| | | | | | | | | | | | If a LCD panel has a non normal orientation (mounted upside-down or 90 degrees rotated) then the kernel will report touchscreen coordinates with the origin matching the native (e.g. upside down) coordinates of the panel. Since we transparently rotate the image on the panel to correct for the non normal panel-orientation, we must apply the same transform to input coordinates to keep the aligned. https://bugzilla.gnome.org/show_bug.cgi?id=782294