summaryrefslogtreecommitdiff
path: root/src/backends/native/meta-gpu-kms.c
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2019-01-11 14:45:44 +0100
committerJonas Ådahl <jadahl@gmail.com>2019-04-02 13:49:59 +0000
commit4cae9b5b1132a61cbff7c4aaa2addf83efa5e4c6 (patch)
tree88eeb3b91de2e374ee4ff920ffd73e77bdf29194 /src/backends/native/meta-gpu-kms.c
parent72aeeb8c378836f7eb6132bafe83354eb6a8963a (diff)
downloadmutter-4cae9b5b1132a61cbff7c4aaa2addf83efa5e4c6.tar.gz
monitor-manager: Clean up DPMS state tracking
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
Diffstat (limited to 'src/backends/native/meta-gpu-kms.c')
-rw-r--r--src/backends/native/meta-gpu-kms.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/backends/native/meta-gpu-kms.c b/src/backends/native/meta-gpu-kms.c
index d924466f8..c569b948e 100644
--- a/src/backends/native/meta-gpu-kms.c
+++ b/src/backends/native/meta-gpu-kms.c
@@ -210,7 +210,7 @@ meta_gpu_kms_is_crtc_active (MetaGpuKms *gpu_kms,
g_assert (meta_crtc_get_gpu (crtc) == META_GPU (gpu_kms));
- if (monitor_manager->power_save_mode != META_POWER_SAVE_ON)
+ if (meta_monitor_manager_get_power_save_mode (monitor_manager))
return FALSE;
connected_crtc_found = FALSE;
@@ -273,7 +273,8 @@ meta_gpu_kms_flip_crtc (MetaGpuKms *gpu_kms,
int ret = -1;
g_assert (meta_crtc_get_gpu (crtc) == gpu);
- g_assert (monitor_manager->power_save_mode == META_POWER_SAVE_ON);
+ g_assert (meta_monitor_manager_get_power_save_mode (monitor_manager) ==
+ META_POWER_SAVE_ON);
get_crtc_drm_connectors (gpu, crtc, &connectors, &n_connectors);
g_assert (n_connectors > 0);
@@ -836,8 +837,6 @@ meta_gpu_kms_read_current (MetaGpu *gpu,
GError **error)
{
MetaGpuKms *gpu_kms = META_GPU_KMS (gpu);
- MetaMonitorManager *monitor_manager =
- meta_gpu_get_monitor_manager (gpu);
MetaKmsResources resources;
g_autoptr (GError) local_error = NULL;
@@ -855,8 +854,6 @@ meta_gpu_kms_read_current (MetaGpu *gpu,
gpu_kms->max_buffer_width = resources.resources->max_width;
gpu_kms->max_buffer_height = resources.resources->max_height;
- monitor_manager->power_save_mode = META_POWER_SAVE_ON;
-
/* Note: we must not free the public structures (output, crtc, monitor
mode and monitor info) here, they must be kept alive until the API
users are done with them after we emit monitors-changed, and thus