[xrandr] Only use the current information when setting modes

Chris Wilson chris at chris-wilson.co.uk
Sun Sep 13 03:40:37 PDT 2015


Before we change the state (e.g. adding a mode or applying one to an
output), we query the screen resources for the right identifiers. This
should only use the current information rather than force a reprobe on
all hardware - not only can that reprobe be very slow (e.g. EDID
timeouts on the order of seconds), but it may perturb the setup that the
user is trying to configure.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 xrandr.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/xrandr.c b/xrandr.c
index 181c76e..dcfdde0 100644
--- a/xrandr.c
+++ b/xrandr.c
@@ -3325,7 +3325,7 @@ main (int argc, char **argv)
     {
 	umode_t	*m;
 
-        get_screen (current);
+        get_screen (True);
 	get_crtcs();
 	get_outputs();
 	
@@ -3374,7 +3374,7 @@ main (int argc, char **argv)
     {
 	output_t *output;
 
-        get_screen (current);
+        get_screen (True);
 	get_crtcs();
 	get_outputs();
 	
@@ -3465,7 +3465,7 @@ main (int argc, char **argv)
 	if (!has_1_4)
 	    fatal ("--setprovideroutputsource requires RandR 1.4\n");
 
-	get_screen (current);
+	get_screen (True);
 	get_providers ();
 
 	provider = find_provider (&provider_name);
@@ -3480,7 +3480,7 @@ main (int argc, char **argv)
 	if (!has_1_4)
 	    fatal ("--setprovideroffloadsink requires RandR 1.4\n");
 
-	get_screen (current);
+	get_screen (True);
 	get_providers ();
 
 	provider = find_provider (&provider_name);
@@ -3490,7 +3490,7 @@ main (int argc, char **argv)
     }
     if (setit_1_2)
     {
-	get_screen (current);
+	get_screen (True);
 	get_crtcs ();
 	get_outputs ();
 	set_positions ();
@@ -3589,7 +3589,7 @@ main (int argc, char **argv)
 	    exit(0);
 	}
 
-	get_screen(current);
+	get_screen(True);
 	get_monitors(True);
 	get_crtcs();
 	get_outputs();
-- 
2.5.1



More information about the xorg-devel mailing list