[Spice-devel] [PATCH xf86-video-qxl 1/2] Send correct count in qxl_update_monitors_config

Hans de Goede hdegoede at redhat.com
Thu Jan 24 03:54:16 PST 2013


When we've for example only output qxl-0 and qxl-2 enabled, the heads array
of the QxlMonitorsConfig struct we send will be sparse, containing a 0 width
and height entry at index 1. Since the qxl-dev (and subsequently the
spice-client) will only look at QxlMonitorsConfig.count entries in the heads
array (ignoring any 0x0 sized heads), the count must be 3 for this example
not 2 as we currently send.

Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
 src/qxl_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index e1893dc..c383c14 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -1101,7 +1101,7 @@ qxl_update_monitors_config (qxl_screen_t *qxl)
 	    head->height = crtc->mode.CrtcVDisplay;
 	    head->x = crtc->x;
 	    head->y = crtc->y;
-	    qxl->monitors_config->count++;
+	    qxl->monitors_config->count = i + 1;
 	    qxl_output->status = XF86OutputStatusConnected;
 	}
     }
-- 
1.8.1



More information about the Spice-devel mailing list