From b64b577363cd27e2b0973a00b7210baefc9077ea Mon Sep 17 00:00:00 2001 Message-Id: <b64b577363cd27e2b0973a00b7210baefc9077ea.1358430965.git.uril@redhat.com> In-Reply-To: <cover.1358430965.git.uril@redhat.com> References: <cover.1358430965.git.uril@redhat.com> From: Uri Lublin <uril@redhat.com> Date: Thu, 17 Jan 2013 13:14:22 +0200 Subject: [xf86 qxl driver PATCH 4/5] qxl_driver: simplify calling qxl_update_monitors_config 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(-) 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; } -- 1.7.1