[gnome-flashback] monitor-config-manager: reuse old CRTC when possible



commit 8faac12cf5d6cfbe151328e0498b2b2216e1f273
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Tue Jul 16 23:20:03 2019 +0300

    monitor-config-manager: reuse old CRTC when possible
    
    Based on mutter commit:
    https://gitlab.gnome.org/GNOME/mutter/commit/f4f823f2380b94e97f7d

 backends/gf-monitor-config-manager.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/backends/gf-monitor-config-manager.c b/backends/gf-monitor-config-manager.c
index 3aa6fe3..48025e4 100644
--- a/backends/gf-monitor-config-manager.c
+++ b/backends/gf-monitor-config-manager.c
@@ -1,6 +1,7 @@
 /*
  * Copyright (C) 2016 Red Hat
  * Copyright (C) 2017-2019 Alberts Muktupāvels
+ * 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 published by
@@ -476,11 +477,16 @@ static GfCrtc *
 find_unassigned_crtc (GfOutput  *output,
                       GPtrArray *crtc_infos)
 {
+  GfCrtc *crtc;
   unsigned int i;
 
+  crtc = gf_output_get_assigned_crtc (output);
+  if (crtc && !is_crtc_assigned (crtc, crtc_infos))
+    return crtc;
+
   for (i = 0; i < output->n_possible_crtcs; i++)
     {
-      GfCrtc *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]