[Spice-devel,xf86,qxl,driver,4/5] qxl_driver: simplify calling qxl_update_monitors_config

Submitted by Uri Lublin on Jan. 17, 2013, 2:26 p.m.

Details

Message ID b64b577363cd27e2b0973a00b7210baefc9077ea.1358430965.git.uril@redhat.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Uri Lublin Jan. 17, 2013, 2:26 p.m.
Simplify by calling check_crtc from within qxl_update_monitors_config,
instead of calling check_crtc before every call to
qxl_update_monitors_config.
---
 src/qxl_driver.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index d8abb7b..05c357b 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -1076,7 +1076,8 @@  qxl_update_monitors_config (qxl_screen_t *qxl)
     qxl_output_private *qxl_output;
     QXLRam * ram = get_ram_header (qxl);
     
-    check_crtc (qxl);
+    if (check_crtc (qxl) == 0)
+        return;
     
     qxl->monitors_config->count = 0;
     qxl->monitors_config->max_allowed = qxl->num_heads;
@@ -2175,7 +2176,6 @@  qxl_crtc_set_mode_major (xf86CrtcPtr crtc, DisplayModePtr mode,
     if (!crtc_set_mode_major (crtc, mode, rotation, x, y))
 	return FALSE;
     
-    check_crtc (qxl);
     qxl_update_monitors_config (qxl);
     
     return TRUE;
@@ -2271,8 +2271,7 @@  qxl_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height)
     
     // when starting, no monitor is enabled, and count == 0
     // we want to avoid server/client freaking out with temporary config
-    if (check_crtc (qxl) != 0)
-	qxl_update_monitors_config (qxl);
+    qxl_update_monitors_config (qxl);
     
     return TRUE;
 }