[mutter] monitor-config-manager: reuse old CRTC when possible
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] monitor-config-manager: reuse old CRTC when possible
- Date: Thu, 21 Feb 2019 15:38:38 +0000 (UTC)
commit f4f823f2380b94e97f7d7952bae200ab7e791699
Author: Emilio Pozuelo Monfort <emilio pozuelo collabora co uk>
Date: Tue Nov 6 15:03:50 2018 +0100
monitor-config-manager: reuse old CRTC when possible
We shouldn't change an output's CRTC if we don't have to, as
that causes the output to go black.
This patch depends on
"monitor-unit-tests: initial crtcs in custom_lid_switch".
https://gitlab.gnome.org/GNOME/mutter/issues/373
src/backends/meta-monitor-config-manager.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/src/backends/meta-monitor-config-manager.c b/src/backends/meta-monitor-config-manager.c
index 431f1c1c3..335c3f34b 100644
--- a/src/backends/meta-monitor-config-manager.c
+++ b/src/backends/meta-monitor-config-manager.c
@@ -2,6 +2,7 @@
/*
* Copyright (C) 2016 Red Hat
+ * Copyright (c) 2018 DisplayLink (UK) Ltd.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -96,11 +97,16 @@ static MetaCrtc *
find_unassigned_crtc (MetaOutput *output,
GPtrArray *crtc_infos)
{
+ MetaCrtc *crtc;
unsigned int i;
+ crtc = meta_output_get_assigned_crtc (output);
+ if (crtc && !is_crtc_assigned (crtc, crtc_infos))
+ return crtc;
+
for (i = 0; i < output->n_possible_crtcs; i++)
{
- MetaCrtc *crtc = output->possible_crtcs[i];
+ crtc = output->possible_crtcs[i];
if (is_crtc_assigned (crtc, crtc_infos))
continue;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]